aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/kvm/kvm_main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index ce7fe640f18d..b54caf0ceeb1 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -1944,17 +1944,17 @@ int kvm_init_arch(struct kvm_arch_ops *ops, struct module *module)
1944 return -EEXIST; 1944 return -EEXIST;
1945 } 1945 }
1946 1946
1947 kvm_arch_ops = ops; 1947 if (!ops->cpu_has_kvm_support()) {
1948
1949 if (!kvm_arch_ops->cpu_has_kvm_support()) {
1950 printk(KERN_ERR "kvm: no hardware support\n"); 1948 printk(KERN_ERR "kvm: no hardware support\n");
1951 return -EOPNOTSUPP; 1949 return -EOPNOTSUPP;
1952 } 1950 }
1953 if (kvm_arch_ops->disabled_by_bios()) { 1951 if (ops->disabled_by_bios()) {
1954 printk(KERN_ERR "kvm: disabled by bios\n"); 1952 printk(KERN_ERR "kvm: disabled by bios\n");
1955 return -EOPNOTSUPP; 1953 return -EOPNOTSUPP;
1956 } 1954 }
1957 1955
1956 kvm_arch_ops = ops;
1957
1958 r = kvm_arch_ops->hardware_setup(); 1958 r = kvm_arch_ops->hardware_setup();
1959 if (r < 0) 1959 if (r < 0)
1960 return r; 1960 return r;