]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: VMX: Optimize vmx_set_rflags() for unrestricted guest
authorSean Christopherson <sean.j.christopherson@intel.com>
Fri, 27 Sep 2019 21:45:19 +0000 (14:45 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 22 Oct 2019 11:34:12 +0000 (13:34 +0200)
commitfdf7698cd92c48662e2c41a0a2bd7587e9ebd492
tree0cac7d88e06cf67e852ba60245998ba7e98c5d83
parent1dcfc5501420c4ab775712add23b47e137f57ba5
KVM: VMX: Optimize vmx_set_rflags() for unrestricted guest

Rework vmx_set_rflags() to avoid the extra code need to handle emulation
of real mode and invalid state when unrestricted guest is disabled.  The
primary reason for doing so is to avoid the call to vmx_get_rflags(),
which will incur a VMREAD when RFLAGS is not already available.  When
running nested VMs, the majority of calls to vmx_set_rflags() will occur
without an associated vmx_get_rflags(), i.e. when stuffing GUEST_RFLAGS
during transitions between vmcs01 and vmcs02.

Note, vmx_get_rflags() guarantees RFLAGS is marked available.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
[Replace "else" with early "return" in the unrestricted guest branch. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/vmx.c