[PATCH] KVM: Disallow the kvm-amd module on intel hardware, and vice versa
authorAvi Kivity <avi@qumranet.com>
Wed, 13 Dec 2006 08:34:14 +0000 (00:34 -0800)
committerLinus Torvalds <torvalds@woody.osdl.org>
Wed, 13 Dec 2006 17:05:48 +0000 (09:05 -0800)
They're not on speaking terms.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/kvm/svm.c
drivers/kvm/vmx.c

index 73a022c1f7b620240e7c170c9f841ba3c78bd928..0e6bc8c649ce9ada43835a155be4c40fd439365d 100644 (file)
@@ -377,6 +377,7 @@ static __init int svm_hardware_setup(void)
        void *msrpm_va;
        int r;
 
+       kvm_emulator_want_group7_invlpg();
 
        iopm_pages = alloc_pages(GFP_KERNEL, IOPM_ALLOC_ORDER);
 
@@ -1628,9 +1629,7 @@ static struct kvm_arch_ops svm_arch_ops = {
 
 static int __init svm_init(void)
 {
-       kvm_emulator_want_group7_invlpg();
-       kvm_init_arch(&svm_arch_ops, THIS_MODULE);
-       return 0;
+       return kvm_init_arch(&svm_arch_ops, THIS_MODULE);
 }
 
 static void __exit svm_exit(void)
index 43622061660b282f1fa5a1136e68e104739d5096..d046296a930429ff0bde6899691c0a1e851c09e4 100644 (file)
@@ -2000,8 +2000,7 @@ static struct kvm_arch_ops vmx_arch_ops = {
 
 static int __init vmx_init(void)
 {
-       kvm_init_arch(&vmx_arch_ops, THIS_MODULE);
-       return 0;
+       return kvm_init_arch(&vmx_arch_ops, THIS_MODULE);
 }
 
 static void __exit vmx_exit(void)