summaryrefslogtreecommitdiff
path: root/arch/x86
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/include/asm/hardirq.h1
-rw-r--r--arch/x86/include/asm/idtentry.h1
-rw-r--r--arch/x86/include/asm/irq_vectors.h1
-rw-r--r--arch/x86/kernel/idt.c1
-rw-r--r--arch/x86/kernel/irq.c16
5 files changed, 20 insertions, 0 deletions
diff --git a/arch/x86/include/asm/hardirq.h b/arch/x86/include/asm/hardirq.h
index a4623fdb65a1..de7fdd2cabd9 100644
--- a/arch/x86/include/asm/hardirq.h
+++ b/arch/x86/include/asm/hardirq.h
@@ -23,6 +23,7 @@ typedef struct {
#ifdef CONFIG_X86_USER_INTERRUPTS
unsigned int uintr_spurious_count;
unsigned int uintr_kernel_notifications;
+ unsigned int uintr_event_notifications;
#endif
unsigned int x86_platform_ipis; /* arch dependent */
unsigned int apic_perf_irqs;
diff --git a/arch/x86/include/asm/idtentry.h b/arch/x86/include/asm/idtentry.h
index 0ac7ef592283..c98adb309f95 100644
--- a/arch/x86/include/asm/idtentry.h
+++ b/arch/x86/include/asm/idtentry.h
@@ -674,6 +674,7 @@ DECLARE_IDTENTRY_SYSVEC(POSTED_INTR_NESTED_VECTOR, sysvec_kvm_posted_intr_nested
#ifdef CONFIG_X86_USER_INTERRUPTS
DECLARE_IDTENTRY_SYSVEC(UINTR_NOTIFICATION_VECTOR, sysvec_uintr_spurious_interrupt);
DECLARE_IDTENTRY_SYSVEC(UINTR_KERNEL_VECTOR, sysvec_uintr_kernel_notification);
+DECLARE_IDTENTRY_SYSVEC(UINTR_EVENT_VECTOR, sysvec_uintr_event_notification);
#endif
#if IS_ENABLED(CONFIG_HYPERV)
diff --git a/arch/x86/include/asm/irq_vectors.h b/arch/x86/include/asm/irq_vectors.h
index 1d289b3ee0da..66d1b9505120 100644
--- a/arch/x86/include/asm/irq_vectors.h
+++ b/arch/x86/include/asm/irq_vectors.h
@@ -107,6 +107,7 @@
/* Vector for User interrupt notifications */
#define UINTR_NOTIFICATION_VECTOR 0xec
#define UINTR_KERNEL_VECTOR 0xeb
+#define UINTR_EVENT_VECTOR 0xe9
#define LOCAL_TIMER_VECTOR 0xea
diff --git a/arch/x86/kernel/idt.c b/arch/x86/kernel/idt.c
index 8d4fd7509523..2d68768f74dc 100644
--- a/arch/x86/kernel/idt.c
+++ b/arch/x86/kernel/idt.c
@@ -150,6 +150,7 @@ static const __initconst struct idt_data apic_idts[] = {
#ifdef CONFIG_X86_USER_INTERRUPTS
INTG(UINTR_NOTIFICATION_VECTOR, asm_sysvec_uintr_spurious_interrupt),
INTG(UINTR_KERNEL_VECTOR, asm_sysvec_uintr_kernel_notification),
+ INTG(UINTR_EVENT_VECTOR, asm_sysvec_uintr_event_notification),
#endif
# ifdef CONFIG_IRQ_WORK
INTG(IRQ_WORK_VECTOR, asm_sysvec_irq_work),
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
index 22349f5c301b..cb38c8737602 100644
--- a/arch/x86/kernel/irq.c
+++ b/arch/x86/kernel/irq.c
@@ -193,6 +193,11 @@ int arch_show_interrupts(struct seq_file *p, int prec)
for_each_online_cpu(j)
seq_printf(p, "%10u ", irq_stats(j)->uintr_kernel_notifications);
seq_puts(p, " User-interrupt kernel notification event\n");
+
+ seq_printf(p, "%*s: ", prec, "UKN");
+ for_each_online_cpu(j)
+ seq_printf(p, "%10u ", irq_stats(j)->uintr_event_notifications);
+ seq_puts(p, " User-interrupt event notification\n");
#endif
return 0;
}
@@ -374,6 +379,17 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_uintr_kernel_notification)
uintr_wake_up_process();
}
+/*
+ * Handler for UINTR_EVENT_VECTOR.
+ */
+DEFINE_IDTENTRY_SYSVEC(sysvec_uintr_event_notification)
+{
+ /* TODO: Add entry-exit tracepoints */
+ ack_APIC_irq();
+ inc_irq_stat(uintr_event_notifications);
+
+ /* do event things */
+}
#endif