diff options
author | Peter Wemm <peter@FreeBSD.org> | 2004-11-05 18:25:22 +0000 |
---|---|---|
committer | Peter Wemm <peter@FreeBSD.org> | 2004-11-05 18:25:22 +0000 |
commit | 9ad69266e116abed75c2966a068665444fa13472 (patch) | |
tree | 2e89b29c1d65f533e7b5845842725ea5941f0404 | |
parent | 7681443a260ba18f5644d6a8d5b5b23766ff8f08 (diff) | |
download | src-9ad69266e116abed75c2966a068665444fa13472.tar.gz src-9ad69266e116abed75c2966a068665444fa13472.zip |
MFi386 1.238 (jhb): Allow hints to disable cpus
Notes
Notes:
svn path=/head/; revision=137262
-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 efe8eace0038..58848a64ef9c 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 */ |