summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2026-04-13 12:49:36 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2026-04-13 12:49:36 +0200
commit7e7a6e2ad24b45b323a5c2e474847650e982b82a (patch)
tree54e026fbcda2f1d4196685f0ef9ef34a3b4e512c
parentaa856775be633b00f4f535ce6d2ce0e6ae5ecb2f (diff)
parent577da677aa7cbc13040e4951170d39ec7663ad8a (diff)
downloadlinux-next-7e7a6e2ad24b45b323a5c2e474847650e982b82a.tar.gz
linux-next-7e7a6e2ad24b45b323a5c2e474847650e982b82a.zip
Merge tag 'kvm-x86-vmx-7.1' of https://github.com/kvm-x86/linux into HEAD
KVM VMX changes for 7.1 - Drop obsolete (largely ignored by hardwre) branch hint prefixes from the VMX instruction macros, as saving a byte of code per instruction provides more benefits than the (mostly) superfluous prefixes. - Use ASM_INPUT_RM() in __vmcs_writel() to coerce clang into using a register input when appropriate. - Drop unnecessary parentheses in cpu_has_load_cet_ctrl() so as not to suggest that "return (x & y);" is KVM's preferred style.
-rw-r--r--arch/x86/kvm/vmx/capabilities.h2
-rw-r--r--arch/x86/kvm/vmx/vmx_ops.h5
2 files changed, 2 insertions, 5 deletions
diff --git a/arch/x86/kvm/vmx/capabilities.h b/arch/x86/kvm/vmx/capabilities.h
index 4e371c93ae16..56cacc06225e 100644
--- a/arch/x86/kvm/vmx/capabilities.h
+++ b/arch/x86/kvm/vmx/capabilities.h
@@ -107,7 +107,7 @@ static inline bool cpu_has_load_perf_global_ctrl(void)
static inline bool cpu_has_load_cet_ctrl(void)
{
- return (vmcs_config.vmentry_ctrl & VM_ENTRY_LOAD_CET_STATE);
+ return vmcs_config.vmentry_ctrl & VM_ENTRY_LOAD_CET_STATE;
}
static inline bool cpu_has_save_perf_global_ctrl(void)
diff --git a/arch/x86/kvm/vmx/vmx_ops.h b/arch/x86/kvm/vmx/vmx_ops.h
index 96677576c836..81784befaaf4 100644
--- a/arch/x86/kvm/vmx/vmx_ops.h
+++ b/arch/x86/kvm/vmx/vmx_ops.h
@@ -119,7 +119,6 @@ do_exception:
#else /* !CONFIG_CC_HAS_ASM_GOTO_OUTPUT */
asm volatile("1: vmread %[field], %[output]\n\t"
- ".byte 0x3e\n\t" /* branch taken hint */
"ja 3f\n\t"
/*
@@ -191,7 +190,6 @@ static __always_inline unsigned long vmcs_readl(unsigned long field)
#define vmx_asm1(insn, op1, error_args...) \
do { \
asm goto("1: " __stringify(insn) " %0\n\t" \
- ".byte 0x2e\n\t" /* branch not taken hint */ \
"jna %l[error]\n\t" \
_ASM_EXTABLE(1b, %l[fault]) \
: : op1 : "cc" : error, fault); \
@@ -208,7 +206,6 @@ fault: \
#define vmx_asm2(insn, op1, op2, error_args...) \
do { \
asm goto("1: " __stringify(insn) " %1, %0\n\t" \
- ".byte 0x2e\n\t" /* branch not taken hint */ \
"jna %l[error]\n\t" \
_ASM_EXTABLE(1b, %l[fault]) \
: : op1, op2 : "cc" : error, fault); \
@@ -224,7 +221,7 @@ fault: \
static __always_inline void __vmcs_writel(unsigned long field, unsigned long value)
{
- vmx_asm2(vmwrite, "r"(field), "rm"(value), field, value);
+ vmx_asm2(vmwrite, "r" (field), ASM_INPUT_RM (value), field, value);
}
static __always_inline void vmcs_write16(unsigned long field, u16 value)