DragonFly-18.104.22.1682.g223bf master sys/platform/pc32/i386 mp_machdep.c mp_madt.c sys/platform/pc32/include smp.h
sephe at crater.dragonflybsd.org
Sun Jun 14 06:24:33 PDT 2009
Author: Sepherosa Ziehau <sephe at dragonflybsd.org>
Date: Sun Jun 14 19:39:44 2009 +0800
MADT MP probe: Rework cpuid mapping, and cpuid to apicid mapping
- Don't use the ACPI ProcessorID as our cpuid, some BIOSes count ProcessorID
from 1, and ACPI standards actually allow that. Instead, except for BSP,
we set the processor's cpuid in the order that we found the MADT LAPIC
- Since MADT does not provide a way to identify the BSP, we will have to do
Split the madt_parse() into three parts:
o madt_check(), preliminary length and revision check.
o madt_pass1(), locate the LAPIC address.
o madt_pass2(), set mp_naps and map cpuid to apicid.
After madt_pass1(), the lapic is mapped, so we could get the current CPU's
apic id. Since the current CPU is BSP, we have the BSP's apic id.
In madt_pass2(), we match the MADT LAPIC entry's apic_id field against the
the value read from the current CPU's lapic id field. Any matching means
that entry contains information concerning BSP.
Reported-by: tuxillo on EFnet #dragonflybsd
Summary of changes:
sys/platform/pc32/i386/mp_machdep.c | 14 ++++-
sys/platform/pc32/i386/mp_madt.c | 115 +++++++++++++++++++++++++----------
sys/platform/pc32/include/smp.h | 4 +-
3 files changed, 97 insertions(+), 36 deletions(-)
DragonFly BSD source repository
More information about the Commits