]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: cleanup enter_rmode()
authorZhenzhong Duan <zhenzhong.duan@intel.com>
Fri, 11 Mar 2022 10:26:42 +0000 (18:26 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 2 Apr 2022 09:37:26 +0000 (05:37 -0400)
commit7a3aa671ae0ee1f3ed0bca8199f5ae12aaea9b8e
tree25608201b2735e84600ad36beaac04d567ac2b35
parent1836f8ad24d1826ad3ab6d0d513b70b2b2ac7ca0
KVM: x86: cleanup enter_rmode()

vmx_set_efer() sets uret->data but, in fact if the value of uret->data
will be used vmx_setup_uret_msrs() will have rewritten it with the value
returned by update_transition_efer().  uret->data is consumed if and only
if uret->load_into_hardware is true, and vmx_setup_uret_msrs() takes care
of (a) updating uret->data before setting uret->load_into_hardware to true
(b) setting uret->load_into_hardware to false if uret->data isn't updated.

Opportunistically use "vmx" directly instead of redoing to_vmx().

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Message-Id: <20220311102643.807507-2-zhenzhong.duan@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/vmx.c