Commit 551896e0 authored by Uros Bizjak's avatar Uros Bizjak Committed by Paolo Bonzini

KVM: VMX: Improve handle_external_interrupt_irqoff inline assembly

Improve handle_external_interrupt_irqoff inline assembly in several ways:
- remove unneeded %c operand modifiers and "$" prefixes
- use %rsp instead of _ASM_SP, since we are in CONFIG_X86_64 part
- use $-16 immediate to align %rsp
- remove unneeded use of __ASM_SIZE macro
- define "ss" named operand only for X86_64

The patch introduces no functional changes.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: default avatarUros Bizjak <ubizjak@gmail.com>
Message-Id: <20200504155706.2516956-1-ubizjak@gmail.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 62315b63
...@@ -6382,13 +6382,13 @@ static void handle_external_interrupt_irqoff(struct kvm_vcpu *vcpu) ...@@ -6382,13 +6382,13 @@ static void handle_external_interrupt_irqoff(struct kvm_vcpu *vcpu)
asm volatile( asm volatile(
#ifdef CONFIG_X86_64 #ifdef CONFIG_X86_64
"mov %%" _ASM_SP ", %[sp]\n\t" "mov %%rsp, %[sp]\n\t"
"and $0xfffffffffffffff0, %%" _ASM_SP "\n\t" "and $-16, %%rsp\n\t"
"push $%c[ss]\n\t" "push %[ss]\n\t"
"push %[sp]\n\t" "push %[sp]\n\t"
#endif #endif
"pushf\n\t" "pushf\n\t"
__ASM_SIZE(push) " $%c[cs]\n\t" "push %[cs]\n\t"
CALL_NOSPEC CALL_NOSPEC
: :
#ifdef CONFIG_X86_64 #ifdef CONFIG_X86_64
...@@ -6397,7 +6397,9 @@ static void handle_external_interrupt_irqoff(struct kvm_vcpu *vcpu) ...@@ -6397,7 +6397,9 @@ static void handle_external_interrupt_irqoff(struct kvm_vcpu *vcpu)
ASM_CALL_CONSTRAINT ASM_CALL_CONSTRAINT
: :
[thunk_target]"r"(entry), [thunk_target]"r"(entry),
#ifdef CONFIG_X86_64
[ss]"i"(__KERNEL_DS), [ss]"i"(__KERNEL_DS),
#endif
[cs]"i"(__KERNEL_CS) [cs]"i"(__KERNEL_CS)
); );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment