diff options
author | Jue Wang <juew@google.com> | 2022-06-10 10:11:30 -0700 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-06-24 04:52:02 -0400 |
commit | 4b903561ec499eef233bf690076cd71b1f8604cf (patch) | |
tree | 2012c0ed9626ed3da2875fb10d5cdb0c44f69cc4 /arch/x86/kvm/lapic.h | |
parent | 987f625e0799c9666ce0a0e18c2d0c001db96fad (diff) | |
download | linux-4b903561ec499eef233bf690076cd71b1f8604cf.tar.gz linux-4b903561ec499eef233bf690076cd71b1f8604cf.tar.bz2 linux-4b903561ec499eef233bf690076cd71b1f8604cf.zip |
KVM: x86: Add Corrected Machine Check Interrupt (CMCI) emulation to lapic.
This patch calculates the number of lvt entries as part of
KVM_X86_MCE_SETUP conditioned on the presence of MCG_CMCI_P bit in
MCG_CAP and stores result in kvm_lapic. It translats from APIC_LVTx
register to index in lapic_lvt_entry enum. It extends the APIC_LVTx
macro as well as other lapic write/reset handling etc to support
Corrected Machine Check Interrupt.
Signed-off-by: Jue Wang <juew@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20220610171134.772566-5-juew@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/lapic.h')
-rw-r--r-- | arch/x86/kvm/lapic.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86/kvm/lapic.h b/arch/x86/kvm/lapic.h index 08843c21084d..762bf6163798 100644 --- a/arch/x86/kvm/lapic.h +++ b/arch/x86/kvm/lapic.h @@ -35,11 +35,12 @@ enum lapic_lvt_entry { LVT_LINT0, LVT_LINT1, LVT_ERROR, + LVT_CMCI, KVM_APIC_MAX_NR_LVT_ENTRIES, }; -#define APIC_LVTx(x) (APIC_LVTT + 0x10 * (x)) +#define APIC_LVTx(x) ((x) == LVT_CMCI ? APIC_LVTCMCI : APIC_LVTT + 0x10 * (x)) struct kvm_timer { struct hrtimer timer; @@ -78,6 +79,7 @@ struct kvm_lapic { struct gfn_to_hva_cache vapic_cache; unsigned long pending_events; unsigned int sipi_vector; + int nr_lvt_entries; }; struct dest_map; |