KVM: x86: Move guts of kvm_arch_init() to standalone helper
authorSean Christopherson <seanjc@google.com>
Wed, 30 Nov 2022 23:08:57 +0000 (23:08 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Mar 2023 07:50:17 +0000 (08:50 +0100)
commitadc0dd8b043932af005f03028592f725116b6606
tree7b40367e615d4fed3ce5c9810e3d5eb7e98d80e2
parent5daa32be8c02f9cfc7e9dbc9c38828060739bd0e
KVM: x86: Move guts of kvm_arch_init() to standalone helper

[ Upstream commit 4f8396b96a9fc672964842fe7adbe8ddca8a3adf ]

Move the guts of kvm_arch_init() to a new helper, kvm_x86_vendor_init(),
so that VMX can do _all_ arch and vendor initialization before calling
kvm_init().  Calling kvm_init() must be the _very_ last step during init,
as kvm_init() exposes /dev/kvm to userspace, i.e. allows creating VMs.

No functional change intended.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20221130230934.1014142-14-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Stable-dep-of: e32b120071ea ("KVM: VMX: Do _all_ initialization before exposing /dev/kvm to userspace")
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/svm/svm.c
arch/x86/kvm/vmx/vmx.c
arch/x86/kvm/x86.c