Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Nov 2018 20:09:03 +0200
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Guido Falsi <mad@madpilot.net>
Cc:        freebsd-current@freebsd.org
Subject:   Re: 13.0 failing to boot multiuser on one PC due to system utilities crashing during rc scipt
Message-ID:  <20181112180903.GC2378@kib.kiev.ua>
In-Reply-To: <9100b044-0d94-4933-f43c-a8aebd42cfd9@madpilot.net>
References:  <62bdb5ff-4d68-cf52-4dd5-f0a3cfa1c788@madpilot.net> <791e3488-b838-5cfd-8dca-8db8c74167a0@madpilot.net> <20181110230744.GN2378@kib.kiev.ua> <5176caee-126f-2709-d09a-0dcf5190e319@madpilot.net> <fa1aedd3-a7ea-ffe2-9614-03054cbed30b@madpilot.net> <20181111211434.GS2378@kib.kiev.ua> <d23f5ea2-c55d-607e-989b-502807b60fe2@madpilot.net> <20181112143353.GX2378@kib.kiev.ua> <9100b044-0d94-4933-f43c-a8aebd42cfd9@madpilot.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Nov 12, 2018 at 06:08:11PM +0100, Guido Falsi wrote:
> On 12/11/18 15:33, Konstantin Belousov wrote:
> > On Mon, Nov 12, 2018 at 11:52:25AM +0100, Guido Falsi wrote:
> >> cpu_stdext_feature:     281
> > ...
> >> cpu_set_user_tls+0x2d:  call    set_pcb_flags_raw
> > ...
> >>
> >> The patch does produce a working kernel. In fact I'm running that kernel
> >> now.
> > 
> > Do you have a bios option called like 'limit max cpuid value' set ?
> > If yes, try to disable it and see how it works out.
> > 
> 
> Yes it does and switching it from "enabled" to "disabled" actually made
> the problem disappear.
> 
> I don't know why I had that enabled. It looks like the default is disabled.
> 
> Maybe I enabled it sometime in the past while trying to diagnose
> something else and left it enabled since.
> 
> So, to fix it for me disabling that option is ok, and thanks for helping
> me finding out!
> 
> But maybe some safety is still required to avoid other stumbling in the
> same problem. Or at least a notice in the docs.
> 
> My BIOS presents the disabled option as a compatibility thing for
> Windows 95, which could encourage people tom enable it.
> 
Try this patch, with the option enabled.

diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index 6e36ae97523..55db65ffc63 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -1581,6 +1581,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
 
 	identify_cpu1();
 	identify_hypervisor();
+	identify_cpu_fixup_bsp();
 	identify_cpu2();
 	initializecpucache();
 
diff --git a/sys/x86/include/x86_var.h b/sys/x86/include/x86_var.h
index 286c01261f0..8f53b41fd19 100644
--- a/sys/x86/include/x86_var.h
+++ b/sys/x86/include/x86_var.h
@@ -129,6 +129,7 @@ void	dump_drop_page(vm_paddr_t);
 void	finishidentcpu(void);
 void	identify_cpu1(void);
 void	identify_cpu2(void);
+void	identify_cpu_fixup_bsp(void);
 void	identify_hypervisor(void);
 void	initializecpu(void);
 void	initializecpucache(void);
diff --git a/sys/x86/x86/identcpu.c b/sys/x86/x86/identcpu.c
index 8e406f053ba..56186b2f3ba 100644
--- a/sys/x86/x86/identcpu.c
+++ b/sys/x86/x86/identcpu.c
@@ -1467,6 +1467,19 @@ identify_cpu2(void)
 	}
 }
 
+void
+identify_cpu_fixup_bsp(void)
+{
+	u_int regs[4];
+
+	cpu_vendor_id = find_cpu_vendor_id();
+
+	if (fix_cpuid()) {
+		do_cpuid(0, regs);
+		cpu_high = regs[0];
+	}
+}
+
 /*
  * Final stage of CPU identification.
  */
@@ -1478,12 +1491,7 @@ finishidentcpu(void)
 	u_char ccr3;
 #endif
 
-	cpu_vendor_id = find_cpu_vendor_id();
-
-	if (fix_cpuid()) {
-		do_cpuid(0, regs);
-		cpu_high = regs[0];
-	}
+	identify_cpu_fixup_bsp();
 
 	if (cpu_high >= 5 && (cpu_feature2 & CPUID2_MON) != 0) {
 		do_cpuid(5, regs);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20181112180903.GC2378>