Skip to content

Commit a09ed81

Browse files
committed
kern/intr: add bus flag for multi-proc interrupts
Some interrupt types can be signaled on multiple processors. These need adjustment to their handling (notably adjustment to counter handling). Mark clk_intr_event as being multi-processor (it is). Differential Revision: https://reviews.freebsd.org/D38448
1 parent 3a762ba commit a09ed81

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

sys/dev/acpica/acpi_apei.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,8 @@ apei_attach(device_t dev)
730730
TAILQ_INSERT_TAIL(&sc->nges.ges, ge, nlink);
731731
if (sc->nges.swi_ih == NULL) {
732732
swi_add(&clk_intr_event, "apei", apei_nmi_swi,
733-
&sc->nges, SWI_CLOCK, INTR_MPSAFE,
733+
&sc->nges, SWI_CLOCK,
734+
INTR_MPSAFE | INTR_MULTIPROC,
734735
&sc->nges.swi_ih);
735736
apei_nmi_nges = &sc->nges;
736737
apei_nmi = apei_nmi_handler;

sys/kern/kern_intr.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,18 +1083,22 @@ swi_add(struct intr_event **eventp, const char *name, driver_intr_t handler,
10831083
void *arg, int pri, enum intr_type flags, void **cookiep)
10841084
{
10851085
struct intr_event *ie;
1086+
int ieflags = IE_SOFT;
10861087
int error = 0;
10871088

10881089
if (flags & INTR_ENTROPY)
10891090
return (EINVAL);
10901091

1092+
if (flags & INTR_MULTIPROC)
1093+
ieflags |= IE_MULTIPROC;
1094+
10911095
ie = (eventp != NULL) ? *eventp : NULL;
10921096

10931097
if (ie != NULL) {
10941098
if (!(ie->ie_flags & IE_SOFT))
10951099
return (EINVAL);
10961100
} else {
1097-
error = intr_event_create(&ie, NULL, IE_SOFT, 0,
1101+
error = intr_event_create(&ie, NULL, ieflags, 0,
10981102
NULL, NULL, NULL, swi_assign_cpu, "swi%d:", pri);
10991103
if (error)
11001104
return (error);
@@ -1678,8 +1682,11 @@ static void
16781682
start_softintr(void *dummy)
16791683
{
16801684

1685+
KASSERT(clk_intr_event == NULL, ("clk_intr_event non-NULL at %s()",
1686+
__func__));
1687+
16811688
if (swi_add(&clk_intr_event, "clk", NULL, NULL, SWI_CLOCK,
1682-
INTR_MPSAFE, NULL))
1689+
INTR_MPSAFE | INTR_MULTIPROC, NULL))
16831690
panic("died while creating clk swi ithread");
16841691
}
16851692
SYSINIT(start_softintr, SI_SUB_SOFTINTR, SI_ORDER_FIRST, start_softintr,

sys/sys/bus.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,8 @@ enum intr_type {
279279
INTR_MD1 = 4096, /* flag reserved for MD use */
280280
INTR_MD2 = 8192, /* flag reserved for MD use */
281281
INTR_MD3 = 16384, /* flag reserved for MD use */
282-
INTR_MD4 = 32768 /* flag reserved for MD use */
282+
INTR_MD4 = 32768, /* flag reserved for MD use */
283+
INTR_MULTIPROC = 0x10000, /* interrupt occurs on multiple procs */
283284
};
284285

285286
enum intr_trigger {

0 commit comments

Comments
 (0)