aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/mpparse.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/i386/kernel/mpparse.c')
-rw-r--r--arch/i386/kernel/mpparse.c38
1 files changed, 14 insertions, 24 deletions
diff --git a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c
index 5d0b9a8fc43d..15949fd08109 100644
--- a/arch/i386/kernel/mpparse.c
+++ b/arch/i386/kernel/mpparse.c
@@ -122,8 +122,8 @@ static int MP_valid_apicid(int apicid, int version)
122 122
123static void __init MP_processor_info (struct mpc_config_processor *m) 123static void __init MP_processor_info (struct mpc_config_processor *m)
124{ 124{
125 int ver, apicid, cpu, found_bsp = 0; 125 int ver, apicid;
126 physid_mask_t tmp; 126 physid_mask_t phys_cpu;
127 127
128 if (!(m->mpc_cpuflag & CPU_ENABLED)) 128 if (!(m->mpc_cpuflag & CPU_ENABLED))
129 return; 129 return;
@@ -181,7 +181,6 @@ static void __init MP_processor_info (struct mpc_config_processor *m)
181 if (m->mpc_cpuflag & CPU_BOOTPROCESSOR) { 181 if (m->mpc_cpuflag & CPU_BOOTPROCESSOR) {
182 Dprintk(" Bootup CPU\n"); 182 Dprintk(" Bootup CPU\n");
183 boot_cpu_physical_apicid = m->mpc_apicid; 183 boot_cpu_physical_apicid = m->mpc_apicid;
184 found_bsp = 1;
185 } 184 }
186 185
187 if (num_processors >= NR_CPUS) { 186 if (num_processors >= NR_CPUS) {
@@ -195,29 +194,26 @@ static void __init MP_processor_info (struct mpc_config_processor *m)
195 " Processor ignored.\n", maxcpus); 194 " Processor ignored.\n", maxcpus);
196 return; 195 return;
197 } 196 }
198 num_processors++;
199 ver = m->mpc_apicver; 197 ver = m->mpc_apicver;
200 198
201 if (!MP_valid_apicid(apicid, ver)) { 199 if (!MP_valid_apicid(apicid, ver)) {
202 printk(KERN_WARNING "Processor #%d INVALID. (Max ID: %d).\n", 200 printk(KERN_WARNING "Processor #%d INVALID. (Max ID: %d).\n",
203 m->mpc_apicid, MAX_APICS); 201 m->mpc_apicid, MAX_APICS);
204 --num_processors;
205 return; 202 return;
206 } 203 }
207 204
208 if (found_bsp) 205 cpu_set(num_processors, cpu_possible_map);
209 cpu = 0; 206 num_processors++;
210 else 207 phys_cpu = apicid_to_cpu_present(apicid);
211 cpu = num_processors - 1; 208 physids_or(phys_cpu_present_map, phys_cpu_present_map, phys_cpu);
212 cpu_set(cpu, cpu_possible_map); 209
213 tmp = apicid_to_cpu_present(apicid);
214 physids_or(phys_cpu_present_map, phys_cpu_present_map, tmp);
215
216 /* 210 /*
217 * Validate version 211 * Validate version
218 */ 212 */
219 if (ver == 0x0) { 213 if (ver == 0x0) {
220 printk(KERN_WARNING "BIOS bug, APIC version is 0 for CPU#%d! fixing up to 0x10. (tell your hw vendor)\n", m->mpc_apicid); 214 printk(KERN_WARNING "BIOS bug, APIC version is 0 for CPU#%d! "
215 "fixing up to 0x10. (tell your hw vendor)\n",
216 m->mpc_apicid);
221 ver = 0x10; 217 ver = 0x10;
222 } 218 }
223 apic_version[m->mpc_apicid] = ver; 219 apic_version[m->mpc_apicid] = ver;
@@ -668,8 +664,6 @@ void __init get_smp_config (void)
668 struct intel_mp_floating *mpf = mpf_found; 664 struct intel_mp_floating *mpf = mpf_found;
669 665
670 /* 666 /*
671 * ACPI may be used to obtain the entire SMP configuration or just to
672 * enumerate/configure processors (CONFIG_ACPI_BOOT). Note that
673 * ACPI supports both logical (e.g. Hyper-Threading) and physical 667 * ACPI supports both logical (e.g. Hyper-Threading) and physical
674 * processors, where MPS only supports physical. 668 * processors, where MPS only supports physical.
675 */ 669 */
@@ -825,7 +819,7 @@ void __init find_smp_config (void)
825 ACPI-based MP Configuration 819 ACPI-based MP Configuration
826 -------------------------------------------------------------------------- */ 820 -------------------------------------------------------------------------- */
827 821
828#ifdef CONFIG_ACPI_BOOT 822#ifdef CONFIG_ACPI
829 823
830void __init mp_register_lapic_address ( 824void __init mp_register_lapic_address (
831 u64 address) 825 u64 address)
@@ -871,7 +865,7 @@ void __init mp_register_lapic (
871 MP_processor_info(&processor); 865 MP_processor_info(&processor);
872} 866}
873 867
874#if defined(CONFIG_X86_IO_APIC) && (defined(CONFIG_ACPI_INTERPRETER) || defined(CONFIG_ACPI_BOOT)) 868#ifdef CONFIG_X86_IO_APIC
875 869
876#define MP_ISA_BUS 0 870#define MP_ISA_BUS 0
877#define MP_MAX_IOAPIC_PIN 127 871#define MP_MAX_IOAPIC_PIN 127
@@ -1086,11 +1080,9 @@ int mp_register_gsi (u32 gsi, int edge_level, int active_high_low)
1086 */ 1080 */
1087 static int gsi_to_irq[MAX_GSI_NUM]; 1081 static int gsi_to_irq[MAX_GSI_NUM];
1088 1082
1089#ifdef CONFIG_ACPI_BUS
1090 /* Don't set up the ACPI SCI because it's already set up */ 1083 /* Don't set up the ACPI SCI because it's already set up */
1091 if (acpi_fadt.sci_int == gsi) 1084 if (acpi_fadt.sci_int == gsi)
1092 return gsi; 1085 return gsi;
1093#endif
1094 1086
1095 ioapic = mp_find_ioapic(gsi); 1087 ioapic = mp_find_ioapic(gsi);
1096 if (ioapic < 0) { 1088 if (ioapic < 0) {
@@ -1133,13 +1125,11 @@ int mp_register_gsi (u32 gsi, int edge_level, int active_high_low)
1133 if (gsi < MAX_GSI_NUM) { 1125 if (gsi < MAX_GSI_NUM) {
1134 if (gsi > 15) 1126 if (gsi > 15)
1135 gsi = pci_irq++; 1127 gsi = pci_irq++;
1136#ifdef CONFIG_ACPI_BUS
1137 /* 1128 /*
1138 * Don't assign IRQ used by ACPI SCI 1129 * Don't assign IRQ used by ACPI SCI
1139 */ 1130 */
1140 if (gsi == acpi_fadt.sci_int) 1131 if (gsi == acpi_fadt.sci_int)
1141 gsi = pci_irq++; 1132 gsi = pci_irq++;
1142#endif
1143 gsi_to_irq[irq] = gsi; 1133 gsi_to_irq[irq] = gsi;
1144 } else { 1134 } else {
1145 printk(KERN_ERR "GSI %u is too high\n", gsi); 1135 printk(KERN_ERR "GSI %u is too high\n", gsi);
@@ -1153,5 +1143,5 @@ int mp_register_gsi (u32 gsi, int edge_level, int active_high_low)
1153 return gsi; 1143 return gsi;
1154} 1144}
1155 1145
1156#endif /*CONFIG_X86_IO_APIC && (CONFIG_ACPI_INTERPRETER || CONFIG_ACPI_BOOT)*/ 1146#endif /* CONFIG_X86_IO_APIC */
1157#endif /*CONFIG_ACPI_BOOT*/ 1147#endif /* CONFIG_ACPI */