aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/kvm_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/kvm/kvm_main.c')
-rw-r--r--drivers/kvm/kvm_main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index 38375e2bb703..06314071c6d2 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -1865,6 +1865,11 @@ int kvm_init_arch(struct kvm_arch_ops *ops, struct module *module)
1865{ 1865{
1866 int r; 1866 int r;
1867 1867
1868 if (kvm_arch_ops) {
1869 printk(KERN_ERR "kvm: already loaded the other module\n");
1870 return -EEXIST;
1871 }
1872
1868 kvm_arch_ops = ops; 1873 kvm_arch_ops = ops;
1869 1874
1870 if (!kvm_arch_ops->cpu_has_kvm_support()) { 1875 if (!kvm_arch_ops->cpu_has_kvm_support()) {
@@ -1907,6 +1912,7 @@ void kvm_exit_arch(void)
1907 unregister_reboot_notifier(&kvm_reboot_notifier); 1912 unregister_reboot_notifier(&kvm_reboot_notifier);
1908 on_each_cpu(kvm_arch_ops->hardware_disable, 0, 0, 1); 1913 on_each_cpu(kvm_arch_ops->hardware_disable, 0, 0, 1);
1909 kvm_arch_ops->hardware_unsetup(); 1914 kvm_arch_ops->hardware_unsetup();
1915 kvm_arch_ops = NULL;
1910} 1916}
1911 1917
1912static __init int kvm_init(void) 1918static __init int kvm_init(void)