cme...@cmeerw.org (Christof Meerwald) writes:

>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.

That's a confusing number, the chip has 14 cores and 28 threads.
If HTT is disabled, that would still be only 14 threads. So
I guess, the VM software fakes these values.


>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;
>       }

Wouldn't that tell that we only have 1 core / 1 thread ?

Maybe instead of failing when lp_max < core_max, we should just
gracefully handle this case as lp_max == core_max.

Reply via email to