]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Enumerate logical hyperthread CPUs manually if they aren't already listed
authorjhb <jhb@FreeBSD.org>
Wed, 8 Jan 2003 01:33:18 +0000 (01:33 +0000)
committerjhb <jhb@FreeBSD.org>
Wed, 8 Jan 2003 01:33:18 +0000 (01:33 +0000)
commit5f30baaaa4ed270d5138472eaf7212526e3a734c
treef0e28539ac4d30213a00c93806856a633c9d60dd
parenta331d8e0375791cf9ad202823d8afdc3dc4d02ba
Enumerate logical hyperthread CPUs manually if they aren't already listed
in the mptable.  The way this works is that we determine if the system
has hyperthreading and how many logical CPU's should be in each physical
CPU by using the information returned by cpuid.  During the first pass of
the mptable, we build a bitmask of the APIC IDs of the CPUs listed in the
mptable.  We then scan that bitmask to see if the CPUs are already listed
by the mptable, or if there are any APIC IDs already in use that would
conflict with the APIC IDs of the logical CPUs.  If that test succeeds,
then we fixup the count of application processors.  Later on during the
second pass of the mptable we create fake processor entries for logical
CPUs and add them to the system.

We only need this type of fixup hack when using the mptable to enumerate
CPUs.  The ACPI MADT table properly enumerates all logical CPUs.
sys/amd64/amd64/mp_machdep.c
sys/amd64/amd64/mptable.c
sys/amd64/include/mptable.h
sys/i386/i386/mp_machdep.c
sys/i386/i386/mptable.c
sys/i386/include/mptable.h