13.0 failing to boot multiuser on one PC due to system utilities crashing during rc scipt
Konstantin Belousov
kostikbel at gmail.com
Mon Nov 12 18:09:20 UTC 2018
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);
More information about the freebsd-current
mailing list