summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2026-02-13 17:26:47 -0800
committerSean Christopherson <seanjc@google.com>2026-03-04 08:52:19 -0800
commit4059172b2a78a71d15d8fcd8d3fd8ea1ba65d25b (patch)
tree1387dc3feb2ff9700c10163107daa95507f2b21c /include
parent11439c4635edd669ae435eec308f4ab8a0804808 (diff)
downloadlinux-4059172b2a78a71d15d8fcd8d3fd8ea1ba65d25b.tar.gz
linux-4059172b2a78a71d15d8fcd8d3fd8ea1ba65d25b.zip
KVM: x86: Move kvm_rebooting to x86
Move kvm_rebooting, which is only read by x86, to KVM x86 so that it can be moved again to core x86 code. Add a "shutdown" arch hook to facilate setting the flag in KVM x86, along with a pile of comments to provide more context around what KVM x86 is doing and why. Reviewed-by: Chao Gao <chao.gao@intel.com> Acked-by: Dave Hansen <dave.hansen@linux.intel.com> Tested-by: Chao Gao <chao.gao@intel.com> Reviewed-by: Dan Williams <dan.j.williams@intel.com> Tested-by: Sagi Shahar <sagis@google.com> Link: https://patch.msgid.link/20260214012702.2368778-2-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/kvm_host.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 34759a262b28..7c4ebd5210ec 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -1628,6 +1628,13 @@ static inline void kvm_create_vcpu_debugfs(struct kvm_vcpu *vcpu) {}
#ifdef CONFIG_KVM_GENERIC_HARDWARE_ENABLING
/*
+ * kvm_arch_shutdown() is invoked immediately prior to forcefully disabling
+ * hardware virtualization on all CPUs via IPI function calls (in preparation
+ * for shutdown or reboot), e.g. to allow arch code to prepare for disabling
+ * virtualization while KVM may be actively running vCPUs.
+ */
+void kvm_arch_shutdown(void);
+/*
* kvm_arch_{enable,disable}_virtualization() are called on one CPU, under
* kvm_usage_lock, immediately after/before 0=>1 and 1=>0 transitions of
* kvm_usage_count, i.e. at the beginning of the generic hardware enabling
@@ -2313,7 +2320,6 @@ static inline bool kvm_check_request(int req, struct kvm_vcpu *vcpu)
#ifdef CONFIG_KVM_GENERIC_HARDWARE_ENABLING
extern bool enable_virt_at_load;
-extern bool kvm_rebooting;
#endif
extern unsigned int halt_poll_ns;