]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
KVM: VMX: Drop obsolete branch hint prefixes from inline asm
authorUros Bizjak <ubizjak@gmail.com>
Wed, 11 Feb 2026 10:28:49 +0000 (11:28 +0100)
committerSean Christopherson <seanjc@google.com>
Mon, 2 Mar 2026 22:32:57 +0000 (14:32 -0800)
Remove explicit branch hint prefixes (.byte 0x2e / 0x3e) from VMX
inline assembly sequences.

These prefixes (CS/DS segment overrides used as branch hints on
very old x86 CPUs) have been ignored by modern processors for a
long time. Keeping them provides no measurable benefit and only
enlarges the generated code.

No functional change intended.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Cc: Sean Christopherson <seanjc@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Thomas Gleixner <tglx@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Link: https://patch.msgid.link/20260211102928.100944-1-ubizjak@gmail.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/vmx/vmx_ops.h

index 96677576c836d5cf00820e11d125baea8f9fc7a0..1000d37f5b0c228e2359ee5fc6647559af48a3e2 100644 (file)
@@ -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);          \