]> www.infradead.org Git - users/dwmw2/linux.git/commit
KVM: Allocate cpus_hardware_enabled after arch hardware setup
authorSean Christopherson <seanjc@google.com>
Wed, 30 Nov 2022 23:08:47 +0000 (23:08 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 13 Jan 2023 15:47:11 +0000 (10:47 -0500)
commitda8de651943a6a3c57c8acdb98de13cec87a33b8
treeaf74629fd8d6e8abccbe566711e1f82707bbc838
parentdff01c0d47f9fcc686759565bdd19ce2a93eea82
KVM: Allocate cpus_hardware_enabled after arch hardware setup

Allocate cpus_hardware_enabled after arch hardware setup so that arch
"init" and "hardware setup" are called back-to-back and thus can be
combined in a future patch.  cpus_hardware_enabled is never used before
kvm_create_vm(), i.e. doesn't have a dependency with hardware setup and
only needs to be allocated before /dev/kvm is exposed to userspace.

Free the object before the arch hooks are invoked to maintain symmetry,
and so that arch code can move away from the hooks without having to
worry about ordering changes.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Yuan Yao <yuan.yao@intel.com>
Message-Id: <20221130230934.1014142-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
virt/kvm/kvm_main.c