summaryrefslogtreecommitdiff
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw@amazon.co.uk>2021-02-02 15:48:05 +0000
committerDavid Woodhouse <dwmw@amazon.co.uk>2021-02-04 14:19:38 +0000
commit7d6bbebb7bb0294ede7bda04847272854e34f87c (patch)
treef406d06318ceeb0e6dffa26c415f0100b69eb9c5 /arch/x86/kvm/x86.c
parent78e9878cb376969d184a4b7fff392528fe17a3ce (diff)
downloadlwn-7d6bbebb7bb0294ede7bda04847272854e34f87c.tar.gz
lwn-7d6bbebb7bb0294ede7bda04847272854e34f87c.zip
KVM: x86/xen: Add kvm_xen_enabled static key
The code paths for Xen support are all fairly lightweight but if we hide them behind this, they're even *more* lightweight for any system which isn't actually hosting Xen guests. Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 673dcc6fde7e..ffc4ab3bd6ec 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -7988,6 +7988,7 @@ void kvm_arch_exit(void)
kvm_mmu_module_exit();
free_percpu(user_return_msrs);
kmem_cache_destroy(x86_fpu_cache);
+ WARN_ON(static_branch_unlikely(&kvm_xen_enabled.key));
}
static int __kvm_vcpu_halt(struct kvm_vcpu *vcpu, int state, int reason)
@@ -10581,6 +10582,7 @@ void kvm_arch_destroy_vm(struct kvm *kvm)
kfree(srcu_dereference_check(kvm->arch.pmu_event_filter, &kvm->srcu, 1));
kvm_mmu_uninit_vm(kvm);
kvm_page_track_cleanup(kvm);
+ kvm_xen_destroy_vm(kvm);
kvm_hv_destroy_vm(kvm);
}