aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/vmx.c
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2018-10-23 00:09:11 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2018-11-27 12:53:45 +0100
commit00df9181de2a116af2bc81cce7e3dda4e0431a2d (patch)
tree3928e952f37f549d9bc6a0a501d1bf0dff184fec /arch/x86/kvm/vmx.c
parentKVM: nVMX: Unrestricted guest mode requires EPT (diff)
downloadlinux-dev-00df9181de2a116af2bc81cce7e3dda4e0431a2d.tar.xz
linux-dev-00df9181de2a116af2bc81cce7e3dda4e0431a2d.zip
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: Uros Bizjak <ubizjak@gmail.com> Reviewed-by: Jim Mattson <jmattson@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r--arch/x86/kvm/vmx.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 2806f79e7631..6aaf4079541a 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -11274,7 +11274,7 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
"je 3f \n\t"
"mov %%" _ASM_AX", %%cr2 \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"
/* Load guest registers. Don't clobber flags. */
"mov %c[rax](%0), %%" _ASM_AX " \n\t"
@@ -13298,15 +13298,13 @@ static int __noclone nested_vmx_check_vmentry_hw(struct kvm_vcpu *vcpu)
__ex("vmwrite %%" _ASM_SP ", %%" _ASM_DX) "\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"
- "je 1f\n\t"
- __ex("vmresume") "\n\t"
- "jmp 2f\n\t"
- "1: " __ex("vmlaunch") "\n\t"
+ "jne 1f\n\t"
+ __ex("vmlaunch") "\n\t"
"jmp 2f\n\t"
+ "1: " __ex("vmresume") "\n\t"
"2: "
-
/* Set vmx->fail accordingly */
"setbe %c[fail](%0)\n\t"