kvm: svm: Do not support AVIC if not CONFIG_X86_LOCAL_APIC
Add logic to disable AVIC #ifndef CONFIG_X86_LOCAL_APIC. Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
7d669f5084
commit
5b8abf1f33
|
@ -238,7 +238,9 @@ module_param(nested, int, S_IRUGO);
|
||||||
|
|
||||||
/* enable / disable AVIC */
|
/* enable / disable AVIC */
|
||||||
static int avic;
|
static int avic;
|
||||||
|
#ifdef CONFIG_X86_LOCAL_APIC
|
||||||
module_param(avic, int, S_IRUGO);
|
module_param(avic, int, S_IRUGO);
|
||||||
|
#endif
|
||||||
|
|
||||||
static void svm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0);
|
static void svm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0);
|
||||||
static void svm_flush_tlb(struct kvm_vcpu *vcpu);
|
static void svm_flush_tlb(struct kvm_vcpu *vcpu);
|
||||||
|
@ -981,11 +983,14 @@ static __init int svm_hardware_setup(void)
|
||||||
} else
|
} else
|
||||||
kvm_disable_tdp();
|
kvm_disable_tdp();
|
||||||
|
|
||||||
if (avic && (!npt_enabled || !boot_cpu_has(X86_FEATURE_AVIC)))
|
if (avic) {
|
||||||
avic = false;
|
if (!npt_enabled ||
|
||||||
|
!boot_cpu_has(X86_FEATURE_AVIC) ||
|
||||||
if (avic)
|
!IS_ENABLED(CONFIG_X86_LOCAL_APIC))
|
||||||
pr_info("AVIC enabled\n");
|
avic = false;
|
||||||
|
else
|
||||||
|
pr_info("AVIC enabled\n");
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue