KVM: VMX: Fix operand constraint of PUSH instructions
PATCH v2 1/1 KVM: VMX: Fix operand constraint of PUSH instructions
PUSH instructions can't handle 64-bit immediate operands, so "i" operand constraint is not correct. Use "er" 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 the 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.
v2: Add casts.
Cc Paolo Bonzini <[email protected]>
Cc Sean Christopherson <[email protected]>
Signed-off-by Uros Bizjak <[email protected]>
--- arch/x86/kvm/vmx/vmx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kvm/vmx/vmx.c +2 -2
@@ -6390,9 +6390,9 @@ static void handle_external_interrupt_irqoff(struct kvm_vcpu *vcpu) : [thunk_target]"r"(entry), #ifdef CONFIG_X86_64 - [ss]"i"(__KERNEL_DS), + [ss]"er"((unsigned long)__KERNEL_DS), #endif - [cs]"i"(__KERNEL_CS) + [cs]"er"((unsigned long)__KERNEL_CS) );kvm_after_interrupt (vcpu);
Signature · 1 line
2.25.4