KVM: VMX: Fold loaded_vmcs_init() into alloc_loaded_vmcs()
authorSean Christopherson <sean.j.christopherson@intel.com>
Sat, 21 Mar 2020 19:37:50 +0000 (12:37 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 23 Mar 2020 19:44:26 +0000 (15:44 -0400)
commitd260f9ef50c76c5587353fa71719be8cf5525f06
tree7d0bec7ab628358774ff76a405dbbddf90940827
parent31603d4fc2bb4f0815245d496cb970b27b4f636a
KVM: VMX: Fold loaded_vmcs_init() into alloc_loaded_vmcs()

Subsume loaded_vmcs_init() into alloc_loaded_vmcs(), its only remaining
caller, and drop the VMCLEAR on the shadow VMCS, which is guaranteed to
be NULL.  loaded_vmcs_init() was previously used by loaded_vmcs_clear(),
but loaded_vmcs_clear() also subsumed loaded_vmcs_init() to properly
handle smp_wmb() with respect to VMCLEAR.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Message-Id: <20200321193751.24985-3-sean.j.christopherson@intel.com>
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/vmx.c
arch/x86/kvm/vmx/vmx.h