Commit b67107a
KVM: Add arch hooks for enabling/disabling virtualization
Add arch hooks that are invoked when KVM enables/disable virtualization.
x86 will use the hooks to register an "emergency disable" callback, which
is essentially an x86-specific shutdown notifier that is used when the
kernel is doing an emergency reboot/shutdown/kexec.
Add comments for the declarations to help arch code understand exactly
when the callbacks are invoked. Alternatively, the APIs themselves could
communicate most of the same info, but kvm_arch_pre_enable_virtualization()
and kvm_arch_post_disable_virtualization() are a bit cumbersome, and make
it a bit less obvious that they are intended to be implemented as a pair.
Reviewed-by: Chao Gao <chao.gao@intel.com>
Reviewed-by: Kai Huang <kai.huang@intel.com>
Acked-by: Kai Huang <kai.huang@intel.com>
Tested-by: Farrah Chen <farrah.chen@intel.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-ID: <20240830043600.127750-9-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>1 parent b4886fa commit b67107a
2 files changed
+28
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1521 | 1521 | | |
1522 | 1522 | | |
1523 | 1523 | | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
1524 | 1538 | | |
1525 | 1539 | | |
1526 | 1540 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5581 | 5581 | | |
5582 | 5582 | | |
5583 | 5583 | | |
| 5584 | + | |
| 5585 | + | |
| 5586 | + | |
| 5587 | + | |
| 5588 | + | |
| 5589 | + | |
| 5590 | + | |
| 5591 | + | |
| 5592 | + | |
| 5593 | + | |
5584 | 5594 | | |
5585 | 5595 | | |
5586 | 5596 | | |
| |||
5680 | 5690 | | |
5681 | 5691 | | |
5682 | 5692 | | |
| 5693 | + | |
| 5694 | + | |
5683 | 5695 | | |
5684 | 5696 | | |
5685 | 5697 | | |
| |||
5710 | 5722 | | |
5711 | 5723 | | |
5712 | 5724 | | |
| 5725 | + | |
5713 | 5726 | | |
5714 | 5727 | | |
5715 | 5728 | | |
| |||
5723 | 5736 | | |
5724 | 5737 | | |
5725 | 5738 | | |
| 5739 | + | |
5726 | 5740 | | |
5727 | 5741 | | |
5728 | 5742 | | |
| |||
0 commit comments