]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Remove redundant vm_entry_controls_clearbit() call
authorZhenzhong Duan <zhenzhong.duan@intel.com>
Fri, 11 Mar 2022 10:26:43 +0000 (18:26 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 2 Apr 2022 09:37:26 +0000 (05:37 -0400)
commitdbe95652226dcc16b5e78f62a90a0f17e40470b3
tree76a329197cd01455b867b9c66e6113baeafc26d7
parent7a3aa671ae0ee1f3ed0bca8199f5ae12aaea9b8e
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>
arch/x86/kvm/vmx/vmx.c