diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2004-11-01 22:11:27 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2004-11-01 22:11:27 +0000 |
| commit | 291fd55363488420dd6669c5e2fd85bc91b13cbc (patch) | |
| tree | cb4a9db44747d54706511df02d249e813b3dbd4f | |
| parent | 08e2a38eda182cc0669c1b6b8a2f926e667a4481 (diff) | |
Notes
| -rw-r--r-- | sys/i386/i386/mp_machdep.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c index b4af6e42de80..eeb39f372454 100644 --- a/sys/i386/i386/mp_machdep.c +++ b/sys/i386/i386/mp_machdep.c @@ -197,6 +197,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]; @@ -419,7 +420,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); @@ -635,9 +640,19 @@ start_all_aps(void) /* start each AP */ for (cpu = 0, 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 */ |
