Index: amd64/acpi_machdep.c =================================================================== RCS file: /cvs/src/sys/arch/amd64/amd64/acpi_machdep.c,v retrieving revision 1.67 diff -u -p -r1.67 acpi_machdep.c --- amd64/acpi_machdep.c 18 Dec 2014 05:33:48 -0000 1.67 +++ amd64/acpi_machdep.c 6 Jan 2015 03:22:11 -0000 @@ -426,6 +426,7 @@ acpi_resume_mp(void) pcb->pcb_rbp = 0; ci->ci_idepth = 0; + ci->ci_handled_intr_level = IPL_NONE; ci->ci_flags &= ~CPUF_PRESENT; cpu_start_secondary(ci); Index: amd64/cpu.c =================================================================== RCS file: /cvs/src/sys/arch/amd64/amd64/cpu.c,v retrieving revision 1.76 diff -u -p -r1.76 cpu.c --- amd64/cpu.c 18 Dec 2014 16:23:26 -0000 1.76 +++ amd64/cpu.c 6 Jan 2015 03:22:11 -0000 @@ -432,6 +432,7 @@ cpu_attach(struct device *parent, struct ci->ci_cpuid = 0; /* False for APs, but they're not used anyway */ #endif ci->ci_func = caa->cpu_func; + ci->ci_handled_intr_level = IPL_NONE; #if defined(MULTIPROCESSOR) /* Index: amd64/intr.c =================================================================== RCS file: /cvs/src/sys/arch/amd64/amd64/intr.c,v retrieving revision 1.39 diff -u -p -r1.39 intr.c --- amd64/intr.c 2 Dec 2014 18:13:10 -0000 1.39 +++ amd64/intr.c 6 Jan 2015 03:22:11 -0000 @@ -514,6 +514,8 @@ intr_disestablish(struct intrhand *ih) int intr_handler(struct intrframe *frame, struct intrhand *ih) { + struct cpu_info *ci = curcpu(); + int floor; int rc; #ifdef MULTIPROCESSOR int need_lock; @@ -526,7 +528,9 @@ intr_handler(struct intrframe *frame, st if (need_lock) __mp_lock(&kernel_lock); #endif + floor = atomic_swap_uint(&ci->ci_handled_intr_level, ih->ih_level); rc = (*ih->ih_fun)(ih->ih_arg ? ih->ih_arg : frame); + ci->ci_handled_intr_level = floor; #ifdef MULTIPROCESSOR if (need_lock) __mp_unlock(&kernel_lock); Index: amd64/ipi.c =================================================================== RCS file: /cvs/src/sys/arch/amd64/amd64/ipi.c,v retrieving revision 1.12 diff -u -p -r1.12 ipi.c --- amd64/ipi.c 6 Jan 2015 00:38:32 -0000 1.12 +++ amd64/ipi.c 6 Jan 2015 03:22:11 -0000 @@ -102,9 +102,11 @@ x86_ipi_handler(void) struct cpu_info *ci = curcpu(); u_int32_t pending; int bit; + int floor; - pending = atomic_swap_uint(&ci->ci_ipis, 0); + floor = atomic_swap_uint(&ci->ci_handled_intr_level, ci->ci_ilevel); + pending = atomic_swap_uint(&ci->ci_ipis, 0); for (bit = 0; bit < X86_NIPI && pending; bit++) { if (pending & (1<ci_handled_intr_level = floor; } Index: amd64/lapic.c =================================================================== RCS file: /cvs/src/sys/arch/amd64/amd64/lapic.c,v retrieving revision 1.36 diff -u -p -r1.36 lapic.c --- amd64/lapic.c 18 Dec 2014 05:33:48 -0000 1.36 +++ amd64/lapic.c 6 Jan 2015 03:22:11 -0000 @@ -35,6 +35,7 @@ #include #include #include +#include #include @@ -272,8 +273,12 @@ u_int32_t lapic_delaytab[26]; void lapic_clockintr(void *arg, struct intrframe frame) { + struct cpu_info *ci = curcpu(); + int floor; + floor = atomic_swap_uint(&ci->ci_handled_intr_level, ci->ci_ilevel); hardclock((struct clockframe *)&frame); + ci->ci_handled_intr_level = floor; clk_count.ec_count++; } Index: amd64/machdep.c =================================================================== RCS file: /cvs/src/sys/arch/amd64/amd64/machdep.c,v retrieving revision 1.204 diff -u -p -r1.204 machdep.c --- amd64/machdep.c 21 Dec 2014 16:27:07 -0000 1.204 +++ amd64/machdep.c 6 Jan 2015 03:22:11 -0000 @@ -1774,14 +1774,15 @@ void splassert_check(int wantipl, const char *func) { int cpl = curcpu()->ci_ilevel; + int floor = curcpu()->ci_handled_intr_level; if (cpl < wantipl) { splassert_fail(wantipl, cpl, func); } - - if (wantipl == IPL_NONE && curcpu()->ci_idepth != 0) { - splassert_fail(-1, curcpu()->ci_idepth, func); + if (floor > wantipl) { + splassert_fail(wantipl, floor, func); } + } #endif Index: amd64/softintr.c =================================================================== RCS file: /cvs/src/sys/arch/amd64/amd64/softintr.c,v retrieving revision 1.6 diff -u -p -r1.6 softintr.c --- amd64/softintr.c 12 Jul 2014 18:44:41 -0000 1.6 +++ amd64/softintr.c 6 Jan 2015 03:22:11 -0000 @@ -76,8 +76,12 @@ softintr_init(void) void softintr_dispatch(int which) { + struct cpu_info *ci = curcpu(); struct x86_soft_intr *si = &x86_soft_intrs[which]; struct x86_soft_intrhand *sih; + int floor; + + floor = atomic_swap_uint(&ci->ci_handled_intr_level, ci->ci_ilevel); for (;;) { mtx_enter(&si->softintr_lock); @@ -95,6 +99,8 @@ softintr_dispatch(int which) (*sih->sih_fn)(sih->sih_arg); } + + ci->ci_handled_intr_level = floor; } /* Index: include/cpu.h =================================================================== RCS file: /cvs/src/sys/arch/amd64/include/cpu.h,v retrieving revision 1.88 diff -u -p -r1.88 cpu.h --- include/cpu.h 16 Dec 2014 21:20:23 -0000 1.88 +++ include/cpu.h 6 Jan 2015 03:22:11 -0000 @@ -85,6 +85,7 @@ struct cpu_info { u_int64_t ci_ipending; int ci_ilevel; int ci_idepth; + int ci_handled_intr_level; u_int64_t ci_imask[NIPL]; u_int64_t ci_iunmask[NIPL]; #ifdef DIAGNOSTIC