KVM: SVM: Allocate IOPM pages after initial setup in svm_hardware_setup()
authorSean Christopherson <seanjc@google.com>
Tue, 10 Jun 2025 22:57:07 +0000 (15:57 -0700)
committerSean Christopherson <seanjc@google.com>
Fri, 20 Jun 2025 20:05:39 +0000 (13:05 -0700)
commitfb96d5cf0fdaacd2165797982502d5b157f8bcf5
tree9118c5ce797ea161af993c9fb73d76640c6bc7af
parent674ffc65035119be0ea2664684d1e8d004409ae1
KVM: SVM: Allocate IOPM pages after initial setup in svm_hardware_setup()

Allocate pages for the IOPM after initial setup has been completed in
svm_hardware_setup(), so that sanity checks can be added in the setup flow
without needing to free the IOPM pages.  The IOPM is only referenced (via
iopm_base) in init_vmcb() and svm_hardware_unsetup(), so there's no need
to allocate it early on.

No functional change intended (beyond the obvious ordering differences,
e.g. if the allocation fails).

Link: https://lore.kernel.org/r/20250610225737.156318-3-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/svm.c