summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorZhenzhong Duan <zhenzhong.duan@intel.com>2022-03-11 18:26:43 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2022-04-02 05:37:26 -0400
commit4335edbbc1284259b17590f76a21fd4a162b4305 (patch)
tree76a329197cd01455b867b9c66e6113baeafc26d7 /arch
parentb76edfe91a87a5cca19cdca09bf6d08f08d4d6e9 (diff)
downloadlinux-4335edbbc1284259b17590f76a21fd4a162b4305.tar.bz2
KVM: x86: Remove redundant vm_entry_controls_clearbit() call
When emulating exit from long mode, EFER_LMA is cleared with vmx_set_efer(). This will already unset the VM_ENTRY_IA32E_MODE control bit as requested by SDM, so there is no need to unset VM_ENTRY_IA32E_MODE again in exit_lmode() explicitly. In case EFER isn't supported by hardware, long mode isn't supported, so exit_lmode() cannot be reached. Note that, thanks to the shadow controls mechanism, this change doesn't eliminate vmread or vmwrite. Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Message-Id: <20220311102643.807507-3-zhenzhong.duan@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kvm/vmx/vmx.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index 2d122416b1e8..04d170c4b61e 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -2902,7 +2902,6 @@ static void enter_lmode(struct kvm_vcpu *vcpu)
static void exit_lmode(struct kvm_vcpu *vcpu)
{
- vm_entry_controls_clearbit(to_vmx(vcpu), VM_ENTRY_IA32E_MODE);
vmx_set_efer(vcpu, vcpu->arch.efer & ~EFER_LMA);
}