diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -202,6 +202,7 @@ long Maxmem = 0; long realmem = 0; +int late_console = 1; struct kva_md_info kmi; @@ -1301,7 +1302,6 @@ struct user_segment_descriptor *gdt; struct region_descriptor r_gdt; size_t kstack0_sz; - int late_console; TSRAW(&thread0, TS_ENTER, __func__, NULL); @@ -1521,7 +1521,6 @@ * Default to late console initialization to support these drivers. * This loses mainly printf()s in getmemsize() and early debugging. */ - late_console = 1; TUNABLE_INT_FETCH("debug.late_console", &late_console); if (!late_console) { cninit(); diff --git a/sys/dev/uart/uart_cpu_x86.c b/sys/dev/uart/uart_cpu_x86.c --- a/sys/dev/uart/uart_cpu_x86.c +++ b/sys/dev/uart/uart_cpu_x86.c @@ -44,6 +44,8 @@ bus_space_tag_t uart_bus_space_io = X86_BUS_SPACE_IO; bus_space_tag_t uart_bus_space_mem = X86_BUS_SPACE_MEM; +extern int late_console; + int uart_cpu_eqres(struct uart_bas *b1, struct uart_bas *b2) { @@ -66,8 +68,12 @@ return (0); #ifdef DEV_ACPI - /* Check if SPCR can tell us what console to use. */ - if (uart_cpu_acpi_spcr(devtype, di) == 0) + /* + * Check if SPCR can tell us what console to use. If running with + * !late_console, we haven't set up our own page tables yet, so we + * can't map ACPI tables to look at them. + */ + if (late_console && uart_cpu_acpi_spcr(devtype, di) == 0) return (0); #endif diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -178,6 +178,7 @@ long Maxmem = 0; long realmem = 0; +int late_console = 1; #ifdef PAE FEATURE(pae, "Physical Address Extensions"); @@ -1396,7 +1397,6 @@ caddr_t kmdp; vm_offset_t addend; size_t ucode_len; - int late_console; thread0.td_kstack = proc0kstack; thread0.td_kstack_pages = TD0_KSTACK_PAGES; @@ -1541,7 +1541,6 @@ * Default to late console initialization to support these drivers. * This loses mainly printf()s in getmemsize() and early debugging. */ - late_console = 1; TUNABLE_INT_FETCH("debug.late_console", &late_console); if (!late_console) { cninit();