KVM: VMX: Improve handle_external_interrupt_irqoff inline assembly
PATCH v5 1/1 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.
--- arch/x86/kvm/vmx/vmx.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
arch/x86/kvm/vmx/vmx.c +6 -4
@@ -6283,13 +6283,13 @@ static void handle_external_interrupt_irqoff(struct kvm_vcpu *vcpu) asm volatile( #ifdef CONFIG_X86_64 - "mov %%" _ASM_SP ", %[sp]\n\t" - "and $0xfffffffffffffff0, %%" _ASM_SP "\n\t" - "push $%c[ss]\n\t" + "mov %%rsp, %[sp]\n\t" + "and $-16, %%rsp\n\t" + "push %[ss]\n\t" "push %[sp]\n\t" #endif "pushf\n\t" - __ASM_SIZE(push) " $%c[cs]\n\t" + "push %[cs]\n\t" CALL_NOSPEC : #ifdef CONFIG_X86_64
@@ -6298,7 +6298,9 @@ static void handle_external_interrupt_irqoff(struct kvm_vcpu *vcpu)ASM_CALL_CONSTRAINT : [thunk_target]"r"(entry), +#ifdef CONFIG_X86_64 [ss]"i"(__KERNEL_DS), +#endif [cs]"i"(__KERNEL_CS) );
Signature · 1 line
2.25.4
Quoted 40 lines · Uros Bizjak
Improve
handle_external_interrupt_irqoffinline assembly in several ways:
- remove unneeded %c operand modifiers and "$" prefixes
- use %rsp instead of_ASM_SP, since we are inCONFIG_X86_64part
- use $-16 immediate to align %rsp
- remove unneeded use of__ASM_SIZEmacro
- define "ss" named operand only forX86_64The patch introduces no functional changes.
Cc Paolo Bonzini <[email protected]>Cc Sean Christopherson <[email protected]>Signed-off-by Uros Bizjak <[email protected]>--- arch/x86/kvm/vmx/vmx.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)arch/x86/kvm/vmx/vmx.c +4
-4@@ -6283,13 +6283,13 @@ static void handle_external_interrupt_irqoff(struct kvm_vcpu *vcpu) asm volatile( #ifdef CONFIG_X86_64 - "mov %%" _ASM_SP ", %[sp]\n\t" - "and $0xfffffffffffffff0, %%" _ASM_SP "\n\t" - "push $%c[ss]\n\t" + "mov %%rsp, %[sp]\n\t" + "and $-16, %%rsp\n\t" + "push %[ss]\n\t" "push %[sp]\n\t" #endif "pushf\n\t" - __ASM_SIZE(push) " $%c[cs]\n\t" + "push %[cs]\n\t" CALL_NOSPEC : #ifdef CONFIG_X86_64
arch/x86/kvm/vmx/vmx.c static void handle_external_interrupt_irqoff(struct kvm_vcpu *vcpu) · line 6306
Quoted 9 lines
arch/x86/kvm/vmx/vmx.c +2
-0@@ -6298,7 +6298,9 @@ static void handle_external_interrupt_irqoff(struct kvm_vcpu *vcpu)ASM_CALL_CONSTRAINT : [thunk_target]"r"(entry), +#ifdef CONFIG_X86_64 [ss]"i"(__KERNEL_DS), +#endif [cs]"i"(__KERNEL_CS) );
Queued, thanks.
Paolo