diff options
author | Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> | 2022-05-19 05:26:55 -0500 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-06-24 12:44:54 -0400 |
commit | 4bdec12aa8d6d0fd7f1ac6740c456bf726e53c0b (patch) | |
tree | 575b704109e9b67a85d2251c58ee2b75527264fb /arch/x86/kvm/svm/svm.h | |
parent | bf348f667ed36c0799dd6d10adb7be9cdfea48c3 (diff) | |
download | lwn-4bdec12aa8d6d0fd7f1ac6740c456bf726e53c0b.tar.gz lwn-4bdec12aa8d6d0fd7f1ac6740c456bf726e53c0b.zip |
KVM: SVM: Detect X2APIC virtualization (x2AVIC) support
Add CPUID check for the x2APIC virtualization (x2AVIC) feature.
If available, the SVM driver can support both AVIC and x2AVIC modes
when load the kvm_amd driver with avic=1. The operating mode will be
determined at runtime depending on the guest APIC mode.
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
Reviewed-by: Pankaj Gupta <pankaj.gupta@amd.com>
Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Message-Id: <20220519102709.24125-4-suravee.suthikulpanit@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/svm/svm.h')
-rw-r--r-- | arch/x86/kvm/svm/svm.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/x86/kvm/svm/svm.h b/arch/x86/kvm/svm/svm.h index d51de3c9264a..6d6390f785c5 100644 --- a/arch/x86/kvm/svm/svm.h +++ b/arch/x86/kvm/svm/svm.h @@ -36,6 +36,14 @@ extern bool npt_enabled; extern int vgif; extern bool intercept_smi; +enum avic_modes { + AVIC_MODE_NONE = 0, + AVIC_MODE_X1, + AVIC_MODE_X2, +}; + +extern enum avic_modes avic_mode; + /* * Clean bits in VMCB. * VMCB_ALL_CLEAN_MASK might also need to @@ -607,6 +615,7 @@ extern struct kvm_x86_nested_ops svm_nested_ops; /* avic.c */ +bool avic_hardware_setup(struct kvm_x86_ops *ops); int avic_ga_log_notifier(u32 ga_tag); void avic_vm_destroy(struct kvm *kvm); int avic_vm_init(struct kvm *kvm); |