tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

assertion "lp_max >= core_max" failed



For the past few days I have been trying to install NetBSD on an
x86-64 (VirtFusion) VM, which was very painful as the NetBSD kernel
just rebooted immediately without printing any diagnostics/panics to
the console at all.

I finally managed to figure out what's wrong and got to

  assertion "lp_max >= core_max" failed

(which is probably too early in the kernel code to have the console
inintialised already, so had to extract the panic message from the
memory after it rebooted)

Turns out in my case the CPUID_HTT flag is not set (so lp_max = 1),
but the maximum number of cores per package is set to 16 - 1, so
core_max = 16.

BTW, the CPU is an "Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz" in a
VirtFusion VM (not sure if VirtFusion makes a difference or if it's a
more general qemu issue).

I am not entirely sure if what cpuid reports is inconsistent in this
case, or if the NetBSD kernel code should be able to handle this case.

Looking at the source in sys/arch/x86/x86/cpu_topology.c I see that
for AMD we have:

	/* In a case of AMD, HTT flag means CMP support. */
	if ((ci->ci_feat_val[0] & CPUID_HTT) == 0) {
		core_max = 1;
		break;
	}

but we don't check for that condition in the Intel case - should we?
Adding that case for Intel seems to fix it for me, e.g.

	/* Check for leaf 4 support. */
	if (ci->ci_max_cpuid >= 4 &&
	    (ci->ci_feat_val[0] & CPUID_HTT) != 0) {
		/* Maximum number of Cores per package (eax[31:26]). */
		x86_cpuid2(4, 0, descs);
		core_max = __SHIFTOUT(descs[0], CPUID_DCP_CORE_P_PKG)
		    + 1;
	} else {
		core_max = 1;
	}

Any thoughts/insights?


Christof

-- 

https://cmeerw.org                             sip:cmeerw at cmeerw.org
mailto:cmeerw at cmeerw.org                   xmpp:cmeerw at cmeerw.org


Home | Main Index | Thread Index | Old Index