Commit 00df9181 authored by Uros Bizjak's avatar Uros Bizjak Committed by Paolo Bonzini

KVM/nVMX: Remove unneeded forward jump in nested_vmx_check_vmentry_hw asm

There is no need to jump just after the jump insn itself. Also, make
code similar to entering guest mode in vmx_vcpu_run.
Signed-off-by: default avatarUros Bizjak <ubizjak@gmail.com>
Reviewed-by: default avatarJim Mattson <jmattson@google.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 88656040
...@@ -11274,7 +11274,7 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu) ...@@ -11274,7 +11274,7 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
"je 3f \n\t" "je 3f \n\t"
"mov %%" _ASM_AX", %%cr2 \n\t" "mov %%" _ASM_AX", %%cr2 \n\t"
"3: \n\t" "3: \n\t"
/* Check if vmlaunch of vmresume is needed */ /* Check if vmlaunch or vmresume is needed */
"cmpl $0, %c[launched](%0) \n\t" "cmpl $0, %c[launched](%0) \n\t"
/* Load guest registers. Don't clobber flags. */ /* Load guest registers. Don't clobber flags. */
"mov %c[rax](%0), %%" _ASM_AX " \n\t" "mov %c[rax](%0), %%" _ASM_AX " \n\t"
...@@ -13298,15 +13298,13 @@ static int __noclone nested_vmx_check_vmentry_hw(struct kvm_vcpu *vcpu) ...@@ -13298,15 +13298,13 @@ static int __noclone nested_vmx_check_vmentry_hw(struct kvm_vcpu *vcpu)
__ex("vmwrite %%" _ASM_SP ", %%" _ASM_DX) "\n\t" __ex("vmwrite %%" _ASM_SP ", %%" _ASM_DX) "\n\t"
"mov %%" _ASM_SP ", %c[host_rsp](%0)\n\t" "mov %%" _ASM_SP ", %c[host_rsp](%0)\n\t"
/* Check if vmlaunch of vmresume is needed */ /* Check if vmlaunch or vmresume is needed */
"cmpl $0, %c[launched](%0)\n\t" "cmpl $0, %c[launched](%0)\n\t"
"je 1f\n\t" "jne 1f\n\t"
__ex("vmresume") "\n\t" __ex("vmlaunch") "\n\t"
"jmp 2f\n\t"
"1: " __ex("vmlaunch") "\n\t"
"jmp 2f\n\t" "jmp 2f\n\t"
"1: " __ex("vmresume") "\n\t"
"2: " "2: "
/* Set vmx->fail accordingly */ /* Set vmx->fail accordingly */
"setbe %c[fail](%0)\n\t" "setbe %c[fail](%0)\n\t"
......
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