From 31911d3c394d6556a67ff63cf0093049ef6dcdd7 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Wed, 14 Jan 2026 22:18:15 +0100 Subject: [PATCH] x86/paravirt: Use XOR r32,r32 to clear register in pv_vcpu_is_preempted() x86_64 zero extends 32bit operations, so for 64bit operands, XOR r32,r32 is functionally equal to XOR r64,r64, but avoids a REX prefix byte when legacy registers are used. Signed-off-by: Uros Bizjak Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Juergen Gross Acked-by: H. Peter Anvin Acked-by: Alexey Makhalov Link: https://patch.msgid.link/20260114211948.74774-2-ubizjak@gmail.com --- arch/x86/include/asm/paravirt-spinlock.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/paravirt-spinlock.h b/arch/x86/include/asm/paravirt-spinlock.h index 458b888aba84b..7beffcb08ed6b 100644 --- a/arch/x86/include/asm/paravirt-spinlock.h +++ b/arch/x86/include/asm/paravirt-spinlock.h @@ -45,7 +45,7 @@ static __always_inline void pv_queued_spin_unlock(struct qspinlock *lock) static __always_inline bool pv_vcpu_is_preempted(long cpu) { return PVOP_ALT_CALLEE1(bool, pv_ops_lock, vcpu_is_preempted, cpu, - "xor %%" _ASM_AX ", %%" _ASM_AX, + "xor %%eax, %%eax", ALT_NOT(X86_FEATURE_VCPUPREEMPT)); } -- 2.47.3