KVM: Register syscore (suspend/resume) ops early in kvm_init()
authorSean Christopherson <seanjc@google.com>
Wed, 30 Nov 2022 23:09:32 +0000 (23:09 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 29 Dec 2022 20:48:36 +0000 (15:48 -0500)
commit35774a9f94db08df78e1c08d2b097666deec4e76
treecae899afbeab9749b7509f4071ef0d0b935f4f40
parente6fb7d6eb4217badb018169ec2871da8e92f6555
KVM: Register syscore (suspend/resume) ops early in kvm_init()

Register the suspend/resume notifier hooks at the same time KVM registers
its reboot notifier so that all the code in kvm_init() that deals with
enabling/disabling hardware is bundled together.  Opportunstically move
KVM's implementations to reside near the reboot notifier code for the
same reason.

Bunching the code together will allow architectures to opt out of KVM's
generic hardware enable/disable logic with minimal #ifdeffery.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20221130230934.1014142-49-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
virt/kvm/kvm_main.c