summaryrefslogtreecommitdiff
path: root/arch/x86/kvm/ioapic.h
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2025-06-11 14:35:56 -0700
committerSean Christopherson <seanjc@google.com>2025-06-20 13:52:52 -0700
commit37b1761fe89529a1531b971d4d869b4e6d345704 (patch)
tree89c81fcb06ae9f41eeb6a2d222fdb98a4409849a /arch/x86/kvm/ioapic.h
parent8fd2a6d43a10184f8edcc7adc0547e1871df6705 (diff)
KVM: x86: Move IRQ mask notifier infrastructure to I/O APIC emulation
Move the IRQ mask logic to ioapic.c as KVM's only user is its in-kernel I/O APIC emulation. In addition to encapsulating more I/O APIC specific code, trimming down irq_comm.c helps pave the way for removing it entirely. Acked-by: Kai Huang <kai.huang@intel.com> Link: https://lore.kernel.org/r/20250611213557.294358-18-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'arch/x86/kvm/ioapic.h')
-rw-r--r--arch/x86/kvm/ioapic.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/x86/kvm/ioapic.h b/arch/x86/kvm/ioapic.h
index dc92bd7c37bc..bf28dbc11ff6 100644
--- a/arch/x86/kvm/ioapic.h
+++ b/arch/x86/kvm/ioapic.h
@@ -86,8 +86,24 @@ struct kvm_ioapic {
struct delayed_work eoi_inject;
u32 irq_eoi[IOAPIC_NUM_PINS];
u32 irr_delivered;
+
+ /* reads protected by irq_srcu, writes by irq_lock */
+ struct hlist_head mask_notifier_list;
+};
+
+struct kvm_irq_mask_notifier {
+ void (*func)(struct kvm_irq_mask_notifier *kimn, bool masked);
+ int irq;
+ struct hlist_node link;
};
+void kvm_register_irq_mask_notifier(struct kvm *kvm, int irq,
+ struct kvm_irq_mask_notifier *kimn);
+void kvm_unregister_irq_mask_notifier(struct kvm *kvm, int irq,
+ struct kvm_irq_mask_notifier *kimn);
+void kvm_fire_mask_notifiers(struct kvm *kvm, unsigned irqchip, unsigned pin,
+ bool mask);
+
#ifdef DEBUG
#define ASSERT(x) \
do { \