From 7a2c1d8c60850da299d6c4ebd7c3be07fb3685ac Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Thu, 24 Mar 2016 00:24:07 +0000 Subject: [PATCH] Enable interrupts on the BSP once all PICs are initialized. This moves the enabling of interrupts slightly earlier (the old location was still before devices were enumerated and probed) and does it in the interrupt code (rather than in the device configuration code). This also avoids tripping over an assertion on the first TLB shootdown with earlier AP startup. Reviewed by: kib Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D5710 --- sys/amd64/amd64/autoconf.c | 7 ------- sys/i386/i386/autoconf.c | 7 ------- sys/x86/x86/intr_machdep.c | 15 +++++++++++++++ 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/sys/amd64/amd64/autoconf.c b/sys/amd64/amd64/autoconf.c index ee3274040390..c0819b457f89 100644 --- a/sys/amd64/amd64/autoconf.c +++ b/sys/amd64/amd64/autoconf.c @@ -100,13 +100,6 @@ configure(dummy) void *dummy; { - /* - * Enable interrupts on the processor. The interrupts are still - * disabled in the interrupt controllers until interrupt handlers - * are registered. - */ - enable_intr(); - /* initialize new bus architecture */ root_bus_configure(); diff --git a/sys/i386/i386/autoconf.c b/sys/i386/i386/autoconf.c index 029ed2ef9dbe..458b42ffda6b 100644 --- a/sys/i386/i386/autoconf.c +++ b/sys/i386/i386/autoconf.c @@ -101,13 +101,6 @@ configure(dummy) void *dummy; { - /* - * Enable interrupts on the processor. The interrupts are still - * disabled in the interrupt controllers until interrupt handlers - * are registered. - */ - enable_intr(); - /* initialize new bus architecture */ root_bus_configure(); diff --git a/sys/x86/x86/intr_machdep.c b/sys/x86/x86/intr_machdep.c index 35ec99253be4..667888737f8a 100644 --- a/sys/x86/x86/intr_machdep.c +++ b/sys/x86/x86/intr_machdep.c @@ -393,6 +393,21 @@ intr_init(void *dummy __unused) } SYSINIT(intr_init, SI_SUB_INTR, SI_ORDER_FIRST, intr_init, NULL); +static void +intr_init_final(void *dummy __unused) +{ + + /* + * Enable interrupts on the BSP after all of the interrupt + * controllers are initialized. Device interrupts are still + * disabled in the interrupt controllers until interrupt + * handlers are registered. Interrupts are enabled on each AP + * after their first context switch. + */ + enable_intr(); +} +SYSINIT(intr_init_final, SI_SUB_INTR, SI_ORDER_ANY, intr_init_final, NULL); + #ifndef DEV_ATPIC /* Initialize the two 8259A's to a known-good shutdown state. */ void