aboutsummaryrefslogtreecommitdiff
path: root/sys/x86/xen
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2020-07-25 15:19:38 +0000
committerAlexander Motin <mav@FreeBSD.org>2020-07-25 15:19:38 +0000
commitaba10e131fe7a9ea168af9ff9002e95559a2f80b (patch)
tree6b027a503ad6ff4e2529aa6e9e153aeec455af80 /sys/x86/xen
parent3024e8af1eba0abfac452ceb71d15d002a15520f (diff)
downloadsrc-aba10e131fe7a9ea168af9ff9002e95559a2f80b.tar.gz
src-aba10e131fe7a9ea168af9ff9002e95559a2f80b.zip
Allow swi_sched() to be called from NMI context.
For purposes of handling hardware error reported via NMIs I need a way to escape NMI context, being too restrictive to do something significant. To do it this change introduces new swi_sched() flag SWI_FROMNMI, making it careful about used KPIs. On platforms allowing IPI sending from NMI context (x86 for now) it immediately wakes clk_intr_event via new IPI_SWI, otherwise it works just like SWI_DELAY. To handle the delayed SWIs this patch calls clk_intr_event on every hardclock() tick. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D25754
Notes
Notes: svn path=/head/; revision=363527
Diffstat (limited to 'sys/x86/xen')
-rw-r--r--sys/x86/xen/xen_apic.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/x86/xen/xen_apic.c b/sys/x86/xen/xen_apic.c
index 7d23f0a50417..78471eb1d997 100644
--- a/sys/x86/xen/xen_apic.c
+++ b/sys/x86/xen/xen_apic.c
@@ -76,6 +76,7 @@ static driver_filter_t xen_invlcache;
static driver_filter_t xen_ipi_bitmap_handler;
static driver_filter_t xen_cpustop_handler;
static driver_filter_t xen_cpususpend_handler;
+static driver_filter_t xen_ipi_swi_handler;
#endif
/*---------------------------------- Macros ----------------------------------*/
@@ -103,6 +104,7 @@ static struct xen_ipi_handler xen_ipis[] =
[IPI_TO_IDX(IPI_BITMAP_VECTOR)] = { xen_ipi_bitmap_handler, "b" },
[IPI_TO_IDX(IPI_STOP)] = { xen_cpustop_handler, "st" },
[IPI_TO_IDX(IPI_SUSPEND)] = { xen_cpususpend_handler, "sp" },
+ [IPI_TO_IDX(IPI_SWI)] = { xen_ipi_swi_handler, "sw" },
};
#endif
@@ -522,6 +524,15 @@ xen_cpususpend_handler(void *arg)
return (FILTER_HANDLED);
}
+static int
+xen_ipi_swi_handler(void *arg)
+{
+ struct trapframe *frame = arg;
+
+ ipi_swi_handler(*frame);
+ return (FILTER_HANDLED);
+}
+
/*----------------------------- XEN PV IPI setup -----------------------------*/
/*
* Those functions are provided outside of the Xen PV APIC implementation