diff options
author | peter <peter@FreeBSD.org> | 2004-11-05 18:25:22 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2004-11-05 18:25:22 +0000 |
commit | 56b95b228cd911dad423bb6f4fbebaf72b3c84e1 (patch) | |
tree | 2e89b29c1d65f533e7b5845842725ea5941f0404 /sys/amd64 | |
parent | 44e0a1bb901a6d318199a416a0f0fdd02048127f (diff) | |
download | FreeBSD-src-56b95b228cd911dad423bb6f4fbebaf72b3c84e1.zip FreeBSD-src-56b95b228cd911dad423bb6f4fbebaf72b3c84e1.tar.gz |
MFi386 1.238 (jhb): Allow hints to disable cpus
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/mp_machdep.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index efe8eac..58848a6 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -127,6 +127,7 @@ static volatile int aps_ready = 0; struct cpu_info { int cpu_present:1; int cpu_bsp:1; + int cpu_disabled:1; } static cpu_info[MAXCPU]; static int cpu_apic_ids[MAXCPU]; @@ -350,7 +351,11 @@ cpu_mp_announce(void) /* List CPUs */ printf(" cpu0 (BSP): APIC ID: %2d\n", boot_cpu_id); for (i = 1, x = 0; x < MAXCPU; x++) { - if (cpu_info[x].cpu_present && !cpu_info[x].cpu_bsp) { + if (!cpu_info[x].cpu_present || cpu_info[x].cpu_bsp) + continue; + if (cpu_info[x].cpu_disabled) + printf(" cpu (AP): APIC ID: %2d (disabled)\n", x); + else { KASSERT(i < mp_ncpus, ("mp_ncpus and actual cpus are out of whack")); printf(" cpu%d (AP): APIC ID: %2d\n", i++, x); @@ -582,9 +587,19 @@ start_all_aps(void) /* start each AP */ cpu = 0; for (apic_id = 0; apic_id < MAXCPU; apic_id++) { + + /* Ignore non-existent CPUs and the BSP. */ if (!cpu_info[apic_id].cpu_present || cpu_info[apic_id].cpu_bsp) continue; + + /* Don't use this CPU if it has been disabled by a tunable. */ + if (resource_disabled("lapic", apic_id)) { + cpu_info[apic_id].cpu_disabled = 1; + mp_ncpus--; + continue; + } + cpu++; /* save APIC ID for this logical ID */ |