diff mbox series

KVM: VMX: Fix operand constraint of PUSH instructions

Message ID 20200504184700.3078839-1-ubizjak@gmail.com (mailing list archive)
State New, archived
Headers show
Series KVM: VMX: Fix operand constraint of PUSH instructions | expand

Commit Message

Uros Bizjak May 4, 2020, 6:47 p.m. UTC
PUSH instructions can't handle 64-bit immediate operands, so "i"
operand constraint is not correct. Use "re" operand constraint
to limit the range of the immediate operand to a signed 32-bit
value and also to leave the compiler the freedom to pass the value
via a register.

Please note that memory operands are not allowed here. These
operands include stack slots, and these are not valid in this
asm block due to the clobbered %rsp register.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
---
 arch/x86/kvm/vmx/vmx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index 22f3324600e1..56c742effb30 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -6299,9 +6299,9 @@  static void handle_external_interrupt_irqoff(struct kvm_vcpu *vcpu)
 		:
 		[thunk_target]"r"(entry),
 #ifdef CONFIG_X86_64
-		[ss]"i"(__KERNEL_DS),
+		[ss]"re"(__KERNEL_DS),
 #endif
-		[cs]"i"(__KERNEL_CS)
+		[cs]"re"(__KERNEL_CS)
 	);
 
 	kvm_after_interrupt(vcpu);