]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit - sys/amd64/amd64/mp_machdep.c
Allow swi_sched() to be called from NMI context.
authormav <mav@FreeBSD.org>
Sat, 25 Jul 2020 15:19:38 +0000 (15:19 +0000)
committermav <mav@FreeBSD.org>
Sat, 25 Jul 2020 15:19:38 +0000 (15:19 +0000)
commitc4714481537323db9384ddcfda5e024de6369e77
tree6b027a503ad6ff4e2529aa6e9e153aeec455af80
parentcddea6e05fc605e73ced4a09582ebddd1d0ce995
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
13 files changed:
share/man/man9/swi.9
sys/amd64/amd64/apic_vector.S
sys/amd64/amd64/mp_machdep.c
sys/amd64/include/smp.h
sys/i386/i386/apic_vector.s
sys/i386/i386/mp_machdep.c
sys/kern/kern_clock.c
sys/kern/kern_intr.c
sys/sys/interrupt.h
sys/x86/include/apicvar.h
sys/x86/include/x86_smp.h
sys/x86/x86/mp_x86.c
sys/x86/xen/xen_apic.c