diff options
author | Jue Wang <juew@google.com> | 2022-06-10 10:11:29 -0700 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-06-24 04:52:02 -0400 |
commit | 987f625e0799c9666ce0a0e18c2d0c001db96fad (patch) | |
tree | 73d025bbe7c19c7e2a728927029399d0a8dee7c1 /arch/x86/kvm/lapic.h | |
parent | 1d8c681fb6ed459128ab9d5e36adb7ec06a26aea (diff) |
KVM: x86: Add APIC_LVTx() macro.
An APIC_LVTx macro is introduced to calcualte the APIC_LVTx register
offset based on the index in the lapic_lvt_entry enum. Later patches
will extend the APIC_LVTx macro to support the APIC_LVTCMCI register
in order to implement Corrected Machine Check Interrupt signaling.
Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Jue Wang <juew@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20220610171134.772566-4-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 | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kvm/lapic.h b/arch/x86/kvm/lapic.h index af26777fb0ea..08843c21084d 100644 --- a/arch/x86/kvm/lapic.h +++ b/arch/x86/kvm/lapic.h @@ -39,6 +39,8 @@ enum lapic_lvt_entry { KVM_APIC_MAX_NR_LVT_ENTRIES, }; +#define APIC_LVTx(x) (APIC_LVTT + 0x10 * (x)) + struct kvm_timer { struct hrtimer timer; s64 period; /* unit: ns */ |