Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
x86: workaround VMs reporting invalid core/thread info
Check some CPUID outputs before dividing since some VMs do not report coherent values. Crostini / Chrome M99 on Acer C933 Chromebook gets a division by zero error because: CPUID leaf 0x1 returns register EDX with bit HTT=28 unset. According to the Intel x86 manual, this means: "A value of 0 for HTT indicates there is only a single logical processor in the package and software should assume only a single APIC ID is reserved." This seems wrong on a quad-core Celeron 4100 processor. Moreover, CPUID leaf 0x4 with subleaf 0 returns a valid first level of cache which says (in EAX bits 26-31)that there are 4 cores in the physical package. This is correct, and contradicts CPUID leaf 0x1 above. Thanks to Peter Bense for the report. Closes #525 Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
- Loading branch information