Re: 13.0 failing to boot multiuser on one PC due to system utilities crashing during rc scipt

From: Konstantin Belousov <kostikbel_at_gmail.com>
Date: Mon, 12 Nov 2018 20:09:03 +0200
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
_at__at_ -1581,6 +1581,7 _at__at_ 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
_at__at_ -129,6 +129,7 _at__at_ 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
_at__at_ -1467,6 +1467,19 _at__at_ 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.
  */
_at__at_ -1478,12 +1491,7 _at__at_ 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);
Received on Mon Nov 12 2018 - 17:09:20 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:19 UTC