MFi386 1.238 (jhb): Allow hints to disable cpus

This commit is contained in:
Peter Wemm 2004-11-05 18:25:22 +00:00
parent 7681443a26
commit 9ad69266e1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=137262

View File

@ -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 */