KVM: SVM: Detect X2APIC virtualization (x2AVIC) support
[linux-2.6-microblaze.git] / arch / x86 / kvm / svm / svm.c
index 136298c..e45568a 100644 (file)
@@ -188,9 +188,6 @@ module_param(tsc_scaling, int, 0444);
 static bool avic;
 module_param(avic, bool, 0444);
 
-static bool force_avic;
-module_param_unsafe(force_avic, bool, 0444);
-
 bool __read_mostly dump_invalid_vmcb;
 module_param(dump_invalid_vmcb, bool, 0644);
 
@@ -5016,17 +5013,9 @@ static __init int svm_hardware_setup(void)
                        nrips = false;
        }
 
-       enable_apicv = avic = avic && npt_enabled && (boot_cpu_has(X86_FEATURE_AVIC) || force_avic);
+       enable_apicv = avic = avic && avic_hardware_setup(&svm_x86_ops);
 
-       if (enable_apicv) {
-               if (!boot_cpu_has(X86_FEATURE_AVIC)) {
-                       pr_warn("AVIC is not supported in CPUID but force enabled");
-                       pr_warn("Your system might crash and burn");
-               } else
-                       pr_info("AVIC enabled\n");
-
-               amd_iommu_register_ga_log_notifier(&avic_ga_log_notifier);
-       } else {
+       if (!enable_apicv) {
                svm_x86_ops.vcpu_blocking = NULL;
                svm_x86_ops.vcpu_unblocking = NULL;
                svm_x86_ops.vcpu_get_apicv_inhibit_reasons = NULL;