mpparse.c 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234
  1. /*
  2. * Intel Multiprocessor Specification 1.1 and 1.4
  3. * compliant MP-table parsing routines.
  4. *
  5. * (c) 1995 Alan Cox, Building #3 <alan@redhat.com>
  6. * (c) 1998, 1999, 2000 Ingo Molnar <mingo@redhat.com>
  7. * (c) 2008 Alexey Starikovskiy <astarikovskiy@suse.de>
  8. */
  9. #include <linux/mm.h>
  10. #include <linux/init.h>
  11. #include <linux/delay.h>
  12. #include <linux/bootmem.h>
  13. #include <linux/kernel_stat.h>
  14. #include <linux/mc146818rtc.h>
  15. #include <linux/bitops.h>
  16. #include <linux/acpi.h>
  17. #include <linux/module.h>
  18. #include <asm/smp.h>
  19. #include <asm/mtrr.h>
  20. #include <asm/mpspec.h>
  21. #include <asm/pgalloc.h>
  22. #include <asm/io_apic.h>
  23. #include <asm/proto.h>
  24. #include <asm/acpi.h>
  25. #include <asm/bios_ebda.h>
  26. #include <asm/e820.h>
  27. #include <asm/trampoline.h>
  28. #include <mach_apic.h>
  29. #ifdef CONFIG_X86_32
  30. #include <mach_apicdef.h>
  31. #include <mach_mpparse.h>
  32. #endif
  33. /*
  34. * Checksum an MP configuration block.
  35. */
  36. static int __init mpf_checksum(unsigned char *mp, int len)
  37. {
  38. int sum = 0;
  39. while (len--)
  40. sum += *mp++;
  41. return sum & 0xFF;
  42. }
  43. #ifdef CONFIG_X86_NUMAQ
  44. int found_numaq;
  45. /*
  46. * Have to match translation table entries to main table entries by counter
  47. * hence the mpc_record variable .... can't see a less disgusting way of
  48. * doing this ....
  49. */
  50. struct mpc_config_translation {
  51. unsigned char mpc_type;
  52. unsigned char trans_len;
  53. unsigned char trans_type;
  54. unsigned char trans_quad;
  55. unsigned char trans_global;
  56. unsigned char trans_local;
  57. unsigned short trans_reserved;
  58. };
  59. static int mpc_record;
  60. static struct mpc_config_translation *translation_table[MAX_MPC_ENTRY]
  61. __cpuinitdata;
  62. static inline int generate_logical_apicid(int quad, int phys_apicid)
  63. {
  64. return (quad << 4) + (phys_apicid ? phys_apicid << 1 : 1);
  65. }
  66. static inline int mpc_apic_id(struct mpc_config_processor *m,
  67. struct mpc_config_translation *translation_record)
  68. {
  69. int quad = translation_record->trans_quad;
  70. int logical_apicid = generate_logical_apicid(quad, m->mpc_apicid);
  71. printk(KERN_DEBUG "Processor #%d %u:%u APIC version %d (quad %d, apic %d)\n",
  72. m->mpc_apicid,
  73. (m->mpc_cpufeature & CPU_FAMILY_MASK) >> 8,
  74. (m->mpc_cpufeature & CPU_MODEL_MASK) >> 4,
  75. m->mpc_apicver, quad, logical_apicid);
  76. return logical_apicid;
  77. }
  78. int mp_bus_id_to_node[MAX_MP_BUSSES];
  79. int mp_bus_id_to_local[MAX_MP_BUSSES];
  80. static void mpc_oem_bus_info(struct mpc_config_bus *m, char *name,
  81. struct mpc_config_translation *translation)
  82. {
  83. int quad = translation->trans_quad;
  84. int local = translation->trans_local;
  85. mp_bus_id_to_node[m->mpc_busid] = quad;
  86. mp_bus_id_to_local[m->mpc_busid] = local;
  87. printk(KERN_INFO "Bus #%d is %s (node %d)\n",
  88. m->mpc_busid, name, quad);
  89. }
  90. int quad_local_to_mp_bus_id [NR_CPUS/4][4];
  91. static void mpc_oem_pci_bus(struct mpc_config_bus *m,
  92. struct mpc_config_translation *translation)
  93. {
  94. int quad = translation->trans_quad;
  95. int local = translation->trans_local;
  96. quad_local_to_mp_bus_id[quad][local] = m->mpc_busid;
  97. }
  98. #endif
  99. static void __cpuinit MP_processor_info(struct mpc_config_processor *m)
  100. {
  101. int apicid;
  102. char *bootup_cpu = "";
  103. if (!(m->mpc_cpuflag & CPU_ENABLED)) {
  104. disabled_cpus++;
  105. return;
  106. }
  107. #ifdef CONFIG_X86_NUMAQ
  108. if (found_numaq)
  109. apicid = mpc_apic_id(m, translation_table[mpc_record]);
  110. else
  111. apicid = m->mpc_apicid;
  112. #else
  113. apicid = m->mpc_apicid;
  114. #endif
  115. if (m->mpc_cpuflag & CPU_BOOTPROCESSOR) {
  116. bootup_cpu = " (Bootup-CPU)";
  117. boot_cpu_physical_apicid = m->mpc_apicid;
  118. }
  119. printk(KERN_INFO "Processor #%d%s\n", m->mpc_apicid, bootup_cpu);
  120. generic_processor_info(apicid, m->mpc_apicver);
  121. }
  122. #ifdef CONFIG_X86_IO_APIC
  123. static void __init MP_bus_info(struct mpc_config_bus *m)
  124. {
  125. char str[7];
  126. memcpy(str, m->mpc_bustype, 6);
  127. str[6] = 0;
  128. #ifdef CONFIG_X86_NUMAQ
  129. if (found_numaq)
  130. mpc_oem_bus_info(m, str, translation_table[mpc_record]);
  131. #else
  132. printk(KERN_INFO "Bus #%d is %s\n", m->mpc_busid, str);
  133. #endif
  134. #if MAX_MP_BUSSES < 256
  135. if (m->mpc_busid >= MAX_MP_BUSSES) {
  136. printk(KERN_WARNING "MP table busid value (%d) for bustype %s "
  137. " is too large, max. supported is %d\n",
  138. m->mpc_busid, str, MAX_MP_BUSSES - 1);
  139. return;
  140. }
  141. #endif
  142. if (strncmp(str, BUSTYPE_ISA, sizeof(BUSTYPE_ISA) - 1) == 0) {
  143. set_bit(m->mpc_busid, mp_bus_not_pci);
  144. #if defined(CONFIG_EISA) || defined (CONFIG_MCA)
  145. mp_bus_id_to_type[m->mpc_busid] = MP_BUS_ISA;
  146. #endif
  147. } else if (strncmp(str, BUSTYPE_PCI, sizeof(BUSTYPE_PCI) - 1) == 0) {
  148. #ifdef CONFIG_X86_NUMAQ
  149. if (found_numaq)
  150. mpc_oem_pci_bus(m, translation_table[mpc_record]);
  151. #endif
  152. clear_bit(m->mpc_busid, mp_bus_not_pci);
  153. #if defined(CONFIG_EISA) || defined (CONFIG_MCA)
  154. mp_bus_id_to_type[m->mpc_busid] = MP_BUS_PCI;
  155. } else if (strncmp(str, BUSTYPE_EISA, sizeof(BUSTYPE_EISA) - 1) == 0) {
  156. mp_bus_id_to_type[m->mpc_busid] = MP_BUS_EISA;
  157. } else if (strncmp(str, BUSTYPE_MCA, sizeof(BUSTYPE_MCA) - 1) == 0) {
  158. mp_bus_id_to_type[m->mpc_busid] = MP_BUS_MCA;
  159. #endif
  160. } else
  161. printk(KERN_WARNING "Unknown bustype %s - ignoring\n", str);
  162. }
  163. #endif
  164. #ifdef CONFIG_X86_IO_APIC
  165. static int bad_ioapic(unsigned long address)
  166. {
  167. if (nr_ioapics >= MAX_IO_APICS) {
  168. printk(KERN_ERR "ERROR: Max # of I/O APICs (%d) exceeded "
  169. "(found %d)\n", MAX_IO_APICS, nr_ioapics);
  170. panic("Recompile kernel with bigger MAX_IO_APICS!\n");
  171. }
  172. if (!address) {
  173. printk(KERN_ERR "WARNING: Bogus (zero) I/O APIC address"
  174. " found in table, skipping!\n");
  175. return 1;
  176. }
  177. return 0;
  178. }
  179. static void __init MP_ioapic_info(struct mpc_config_ioapic *m)
  180. {
  181. if (!(m->mpc_flags & MPC_APIC_USABLE))
  182. return;
  183. printk(KERN_INFO "I/O APIC #%d Version %d at 0x%X.\n",
  184. m->mpc_apicid, m->mpc_apicver, m->mpc_apicaddr);
  185. if (bad_ioapic(m->mpc_apicaddr))
  186. return;
  187. mp_ioapics[nr_ioapics].mp_apicaddr = m->mpc_apicaddr;
  188. mp_ioapics[nr_ioapics].mp_apicid = m->mpc_apicid;
  189. mp_ioapics[nr_ioapics].mp_type = m->mpc_type;
  190. mp_ioapics[nr_ioapics].mp_apicver = m->mpc_apicver;
  191. mp_ioapics[nr_ioapics].mp_flags = m->mpc_flags;
  192. nr_ioapics++;
  193. }
  194. static void print_MP_intsrc_info(struct mpc_config_intsrc *m)
  195. {
  196. printk(KERN_CONT "Int: type %d, pol %d, trig %d, bus %02x,"
  197. " IRQ %02x, APIC ID %x, APIC INT %02x\n",
  198. m->mpc_irqtype, m->mpc_irqflag & 3,
  199. (m->mpc_irqflag >> 2) & 3, m->mpc_srcbus,
  200. m->mpc_srcbusirq, m->mpc_dstapic, m->mpc_dstirq);
  201. }
  202. static void __init print_mp_irq_info(struct mp_config_intsrc *mp_irq)
  203. {
  204. printk(KERN_CONT "Int: type %d, pol %d, trig %d, bus %02x,"
  205. " IRQ %02x, APIC ID %x, APIC INT %02x\n",
  206. mp_irq->mp_irqtype, mp_irq->mp_irqflag & 3,
  207. (mp_irq->mp_irqflag >> 2) & 3, mp_irq->mp_srcbus,
  208. mp_irq->mp_srcbusirq, mp_irq->mp_dstapic, mp_irq->mp_dstirq);
  209. }
  210. static void assign_to_mp_irq(struct mpc_config_intsrc *m,
  211. struct mp_config_intsrc *mp_irq)
  212. {
  213. mp_irq->mp_dstapic = m->mpc_dstapic;
  214. mp_irq->mp_type = m->mpc_type;
  215. mp_irq->mp_irqtype = m->mpc_irqtype;
  216. mp_irq->mp_irqflag = m->mpc_irqflag;
  217. mp_irq->mp_srcbus = m->mpc_srcbus;
  218. mp_irq->mp_srcbusirq = m->mpc_srcbusirq;
  219. mp_irq->mp_dstirq = m->mpc_dstirq;
  220. }
  221. static void __init assign_to_mpc_intsrc(struct mp_config_intsrc *mp_irq,
  222. struct mpc_config_intsrc *m)
  223. {
  224. m->mpc_dstapic = mp_irq->mp_dstapic;
  225. m->mpc_type = mp_irq->mp_type;
  226. m->mpc_irqtype = mp_irq->mp_irqtype;
  227. m->mpc_irqflag = mp_irq->mp_irqflag;
  228. m->mpc_srcbus = mp_irq->mp_srcbus;
  229. m->mpc_srcbusirq = mp_irq->mp_srcbusirq;
  230. m->mpc_dstirq = mp_irq->mp_dstirq;
  231. }
  232. static int mp_irq_mpc_intsrc_cmp(struct mp_config_intsrc *mp_irq,
  233. struct mpc_config_intsrc *m)
  234. {
  235. if (mp_irq->mp_dstapic != m->mpc_dstapic)
  236. return 1;
  237. if (mp_irq->mp_type != m->mpc_type)
  238. return 2;
  239. if (mp_irq->mp_irqtype != m->mpc_irqtype)
  240. return 3;
  241. if (mp_irq->mp_irqflag != m->mpc_irqflag)
  242. return 4;
  243. if (mp_irq->mp_srcbus != m->mpc_srcbus)
  244. return 5;
  245. if (mp_irq->mp_srcbusirq != m->mpc_srcbusirq)
  246. return 6;
  247. if (mp_irq->mp_dstirq != m->mpc_dstirq)
  248. return 7;
  249. return 0;
  250. }
  251. void MP_intsrc_info(struct mpc_config_intsrc *m)
  252. {
  253. int i;
  254. print_MP_intsrc_info(m);
  255. for (i = 0; i < mp_irq_entries; i++) {
  256. if (!mp_irq_mpc_intsrc_cmp(&mp_irqs[i], m))
  257. return;
  258. }
  259. assign_to_mp_irq(m, &mp_irqs[mp_irq_entries]);
  260. if (++mp_irq_entries == MAX_IRQ_SOURCES)
  261. panic("Max # of irq sources exceeded!!\n");
  262. }
  263. #endif
  264. static void __init MP_lintsrc_info(struct mpc_config_lintsrc *m)
  265. {
  266. printk(KERN_INFO "Lint: type %d, pol %d, trig %d, bus %02x,"
  267. " IRQ %02x, APIC ID %x, APIC LINT %02x\n",
  268. m->mpc_irqtype, m->mpc_irqflag & 3,
  269. (m->mpc_irqflag >> 2) & 3, m->mpc_srcbusid,
  270. m->mpc_srcbusirq, m->mpc_destapic, m->mpc_destapiclint);
  271. }
  272. #ifdef CONFIG_X86_NUMAQ
  273. static void __init MP_translation_info(struct mpc_config_translation *m)
  274. {
  275. printk(KERN_INFO
  276. "Translation: record %d, type %d, quad %d, global %d, local %d\n",
  277. mpc_record, m->trans_type, m->trans_quad, m->trans_global,
  278. m->trans_local);
  279. if (mpc_record >= MAX_MPC_ENTRY)
  280. printk(KERN_ERR "MAX_MPC_ENTRY exceeded!\n");
  281. else
  282. translation_table[mpc_record] = m; /* stash this for later */
  283. if (m->trans_quad < MAX_NUMNODES && !node_online(m->trans_quad))
  284. node_set_online(m->trans_quad);
  285. }
  286. /*
  287. * Read/parse the MPC oem tables
  288. */
  289. static void __init smp_read_mpc_oem(struct mp_config_oemtable *oemtable,
  290. unsigned short oemsize)
  291. {
  292. int count = sizeof(*oemtable); /* the header size */
  293. unsigned char *oemptr = ((unsigned char *)oemtable) + count;
  294. mpc_record = 0;
  295. printk(KERN_INFO "Found an OEM MPC table at %8p - parsing it ... \n",
  296. oemtable);
  297. if (memcmp(oemtable->oem_signature, MPC_OEM_SIGNATURE, 4)) {
  298. printk(KERN_WARNING
  299. "SMP mpc oemtable: bad signature [%c%c%c%c]!\n",
  300. oemtable->oem_signature[0], oemtable->oem_signature[1],
  301. oemtable->oem_signature[2], oemtable->oem_signature[3]);
  302. return;
  303. }
  304. if (mpf_checksum((unsigned char *)oemtable, oemtable->oem_length)) {
  305. printk(KERN_WARNING "SMP oem mptable: checksum error!\n");
  306. return;
  307. }
  308. while (count < oemtable->oem_length) {
  309. switch (*oemptr) {
  310. case MP_TRANSLATION:
  311. {
  312. struct mpc_config_translation *m =
  313. (struct mpc_config_translation *)oemptr;
  314. MP_translation_info(m);
  315. oemptr += sizeof(*m);
  316. count += sizeof(*m);
  317. ++mpc_record;
  318. break;
  319. }
  320. default:
  321. {
  322. printk(KERN_WARNING
  323. "Unrecognised OEM table entry type! - %d\n",
  324. (int)*oemptr);
  325. return;
  326. }
  327. }
  328. }
  329. }
  330. void numaq_mps_oem_check(struct mp_config_table *mpc, char *oem,
  331. char *productid)
  332. {
  333. if (strncmp(oem, "IBM NUMA", 8))
  334. printk("Warning! Not a NUMA-Q system!\n");
  335. else
  336. found_numaq = 1;
  337. if (mpc->mpc_oemptr)
  338. smp_read_mpc_oem((struct mp_config_oemtable *)mpc->mpc_oemptr,
  339. mpc->mpc_oemsize);
  340. }
  341. #endif /* CONFIG_X86_NUMAQ */
  342. /*
  343. * Read/parse the MPC
  344. */
  345. static int __init smp_check_mpc(struct mp_config_table *mpc, char *oem,
  346. char *str)
  347. {
  348. if (memcmp(mpc->mpc_signature, MPC_SIGNATURE, 4)) {
  349. printk(KERN_ERR "MPTABLE: bad signature [%c%c%c%c]!\n",
  350. mpc->mpc_signature[0], mpc->mpc_signature[1],
  351. mpc->mpc_signature[2], mpc->mpc_signature[3]);
  352. return 0;
  353. }
  354. if (mpf_checksum((unsigned char *)mpc, mpc->mpc_length)) {
  355. printk(KERN_ERR "MPTABLE: checksum error!\n");
  356. return 0;
  357. }
  358. if (mpc->mpc_spec != 0x01 && mpc->mpc_spec != 0x04) {
  359. printk(KERN_ERR "MPTABLE: bad table version (%d)!!\n",
  360. mpc->mpc_spec);
  361. return 0;
  362. }
  363. if (!mpc->mpc_lapic) {
  364. printk(KERN_ERR "MPTABLE: null local APIC address!\n");
  365. return 0;
  366. }
  367. memcpy(oem, mpc->mpc_oem, 8);
  368. oem[8] = 0;
  369. printk(KERN_INFO "MPTABLE: OEM ID: %s\n", oem);
  370. memcpy(str, mpc->mpc_productid, 12);
  371. str[12] = 0;
  372. printk(KERN_INFO "MPTABLE: Product ID: %s\n", str);
  373. printk(KERN_INFO "MPTABLE: APIC at: 0x%X\n", mpc->mpc_lapic);
  374. return 1;
  375. }
  376. static int __init smp_read_mpc(struct mp_config_table *mpc, unsigned early)
  377. {
  378. char str[16];
  379. char oem[10];
  380. int count = sizeof(*mpc);
  381. unsigned char *mpt = ((unsigned char *)mpc) + count;
  382. if (!smp_check_mpc(mpc, oem, str))
  383. return 0;
  384. #ifdef CONFIG_X86_32
  385. /*
  386. * need to make sure summit and es7000's mps_oem_check is safe to be
  387. * called early via genericarch 's mps_oem_check
  388. */
  389. if (early) {
  390. #ifdef CONFIG_X86_NUMAQ
  391. numaq_mps_oem_check(mpc, oem, str);
  392. #endif
  393. } else
  394. mps_oem_check(mpc, oem, str);
  395. #endif
  396. /* save the local APIC address, it might be non-default */
  397. if (!acpi_lapic)
  398. mp_lapic_addr = mpc->mpc_lapic;
  399. if (early)
  400. return 1;
  401. /*
  402. * Now process the configuration blocks.
  403. */
  404. #ifdef CONFIG_X86_NUMAQ
  405. mpc_record = 0;
  406. #endif
  407. while (count < mpc->mpc_length) {
  408. switch (*mpt) {
  409. case MP_PROCESSOR:
  410. {
  411. struct mpc_config_processor *m =
  412. (struct mpc_config_processor *)mpt;
  413. /* ACPI may have already provided this data */
  414. if (!acpi_lapic)
  415. MP_processor_info(m);
  416. mpt += sizeof(*m);
  417. count += sizeof(*m);
  418. break;
  419. }
  420. case MP_BUS:
  421. {
  422. struct mpc_config_bus *m =
  423. (struct mpc_config_bus *)mpt;
  424. #ifdef CONFIG_X86_IO_APIC
  425. MP_bus_info(m);
  426. #endif
  427. mpt += sizeof(*m);
  428. count += sizeof(*m);
  429. break;
  430. }
  431. case MP_IOAPIC:
  432. {
  433. #ifdef CONFIG_X86_IO_APIC
  434. struct mpc_config_ioapic *m =
  435. (struct mpc_config_ioapic *)mpt;
  436. MP_ioapic_info(m);
  437. #endif
  438. mpt += sizeof(struct mpc_config_ioapic);
  439. count += sizeof(struct mpc_config_ioapic);
  440. break;
  441. }
  442. case MP_INTSRC:
  443. {
  444. #ifdef CONFIG_X86_IO_APIC
  445. struct mpc_config_intsrc *m =
  446. (struct mpc_config_intsrc *)mpt;
  447. MP_intsrc_info(m);
  448. #endif
  449. mpt += sizeof(struct mpc_config_intsrc);
  450. count += sizeof(struct mpc_config_intsrc);
  451. break;
  452. }
  453. case MP_LINTSRC:
  454. {
  455. struct mpc_config_lintsrc *m =
  456. (struct mpc_config_lintsrc *)mpt;
  457. MP_lintsrc_info(m);
  458. mpt += sizeof(*m);
  459. count += sizeof(*m);
  460. break;
  461. }
  462. default:
  463. /* wrong mptable */
  464. printk(KERN_ERR "Your mptable is wrong, contact your HW vendor!\n");
  465. printk(KERN_ERR "type %x\n", *mpt);
  466. print_hex_dump(KERN_ERR, " ", DUMP_PREFIX_ADDRESS, 16,
  467. 1, mpc, mpc->mpc_length, 1);
  468. count = mpc->mpc_length;
  469. break;
  470. }
  471. #ifdef CONFIG_X86_NUMAQ
  472. ++mpc_record;
  473. #endif
  474. }
  475. #ifdef CONFIG_X86_GENERICARCH
  476. generic_bigsmp_probe();
  477. #endif
  478. setup_apic_routing();
  479. if (!num_processors)
  480. printk(KERN_ERR "MPTABLE: no processors registered!\n");
  481. return num_processors;
  482. }
  483. #ifdef CONFIG_X86_IO_APIC
  484. static int __init ELCR_trigger(unsigned int irq)
  485. {
  486. unsigned int port;
  487. port = 0x4d0 + (irq >> 3);
  488. return (inb(port) >> (irq & 7)) & 1;
  489. }
  490. static void __init construct_default_ioirq_mptable(int mpc_default_type)
  491. {
  492. struct mpc_config_intsrc intsrc;
  493. int i;
  494. int ELCR_fallback = 0;
  495. intsrc.mpc_type = MP_INTSRC;
  496. intsrc.mpc_irqflag = 0; /* conforming */
  497. intsrc.mpc_srcbus = 0;
  498. intsrc.mpc_dstapic = mp_ioapics[0].mp_apicid;
  499. intsrc.mpc_irqtype = mp_INT;
  500. /*
  501. * If true, we have an ISA/PCI system with no IRQ entries
  502. * in the MP table. To prevent the PCI interrupts from being set up
  503. * incorrectly, we try to use the ELCR. The sanity check to see if
  504. * there is good ELCR data is very simple - IRQ0, 1, 2 and 13 can
  505. * never be level sensitive, so we simply see if the ELCR agrees.
  506. * If it does, we assume it's valid.
  507. */
  508. if (mpc_default_type == 5) {
  509. printk(KERN_INFO "ISA/PCI bus type with no IRQ information... "
  510. "falling back to ELCR\n");
  511. if (ELCR_trigger(0) || ELCR_trigger(1) || ELCR_trigger(2) ||
  512. ELCR_trigger(13))
  513. printk(KERN_ERR "ELCR contains invalid data... "
  514. "not using ELCR\n");
  515. else {
  516. printk(KERN_INFO
  517. "Using ELCR to identify PCI interrupts\n");
  518. ELCR_fallback = 1;
  519. }
  520. }
  521. for (i = 0; i < 16; i++) {
  522. switch (mpc_default_type) {
  523. case 2:
  524. if (i == 0 || i == 13)
  525. continue; /* IRQ0 & IRQ13 not connected */
  526. /* fall through */
  527. default:
  528. if (i == 2)
  529. continue; /* IRQ2 is never connected */
  530. }
  531. if (ELCR_fallback) {
  532. /*
  533. * If the ELCR indicates a level-sensitive interrupt, we
  534. * copy that information over to the MP table in the
  535. * irqflag field (level sensitive, active high polarity).
  536. */
  537. if (ELCR_trigger(i))
  538. intsrc.mpc_irqflag = 13;
  539. else
  540. intsrc.mpc_irqflag = 0;
  541. }
  542. intsrc.mpc_srcbusirq = i;
  543. intsrc.mpc_dstirq = i ? i : 2; /* IRQ0 to INTIN2 */
  544. MP_intsrc_info(&intsrc);
  545. }
  546. intsrc.mpc_irqtype = mp_ExtINT;
  547. intsrc.mpc_srcbusirq = 0;
  548. intsrc.mpc_dstirq = 0; /* 8259A to INTIN0 */
  549. MP_intsrc_info(&intsrc);
  550. }
  551. static void construct_ioapic_table(int mpc_default_type)
  552. {
  553. struct mpc_config_ioapic ioapic;
  554. struct mpc_config_bus bus;
  555. bus.mpc_type = MP_BUS;
  556. bus.mpc_busid = 0;
  557. switch (mpc_default_type) {
  558. default:
  559. printk(KERN_ERR "???\nUnknown standard configuration %d\n",
  560. mpc_default_type);
  561. /* fall through */
  562. case 1:
  563. case 5:
  564. memcpy(bus.mpc_bustype, "ISA ", 6);
  565. break;
  566. case 2:
  567. case 6:
  568. case 3:
  569. memcpy(bus.mpc_bustype, "EISA ", 6);
  570. break;
  571. case 4:
  572. case 7:
  573. memcpy(bus.mpc_bustype, "MCA ", 6);
  574. }
  575. MP_bus_info(&bus);
  576. if (mpc_default_type > 4) {
  577. bus.mpc_busid = 1;
  578. memcpy(bus.mpc_bustype, "PCI ", 6);
  579. MP_bus_info(&bus);
  580. }
  581. ioapic.mpc_type = MP_IOAPIC;
  582. ioapic.mpc_apicid = 2;
  583. ioapic.mpc_apicver = mpc_default_type > 4 ? 0x10 : 0x01;
  584. ioapic.mpc_flags = MPC_APIC_USABLE;
  585. ioapic.mpc_apicaddr = 0xFEC00000;
  586. MP_ioapic_info(&ioapic);
  587. /*
  588. * We set up most of the low 16 IO-APIC pins according to MPS rules.
  589. */
  590. construct_default_ioirq_mptable(mpc_default_type);
  591. }
  592. #else
  593. static inline void construct_ioapic_table(int mpc_default_type) { }
  594. #endif
  595. static inline void __init construct_default_ISA_mptable(int mpc_default_type)
  596. {
  597. struct mpc_config_processor processor;
  598. struct mpc_config_lintsrc lintsrc;
  599. int linttypes[2] = { mp_ExtINT, mp_NMI };
  600. int i;
  601. /*
  602. * local APIC has default address
  603. */
  604. mp_lapic_addr = APIC_DEFAULT_PHYS_BASE;
  605. /*
  606. * 2 CPUs, numbered 0 & 1.
  607. */
  608. processor.mpc_type = MP_PROCESSOR;
  609. /* Either an integrated APIC or a discrete 82489DX. */
  610. processor.mpc_apicver = mpc_default_type > 4 ? 0x10 : 0x01;
  611. processor.mpc_cpuflag = CPU_ENABLED;
  612. processor.mpc_cpufeature = (boot_cpu_data.x86 << 8) |
  613. (boot_cpu_data.x86_model << 4) | boot_cpu_data.x86_mask;
  614. processor.mpc_featureflag = boot_cpu_data.x86_capability[0];
  615. processor.mpc_reserved[0] = 0;
  616. processor.mpc_reserved[1] = 0;
  617. for (i = 0; i < 2; i++) {
  618. processor.mpc_apicid = i;
  619. MP_processor_info(&processor);
  620. }
  621. construct_ioapic_table(mpc_default_type);
  622. lintsrc.mpc_type = MP_LINTSRC;
  623. lintsrc.mpc_irqflag = 0; /* conforming */
  624. lintsrc.mpc_srcbusid = 0;
  625. lintsrc.mpc_srcbusirq = 0;
  626. lintsrc.mpc_destapic = MP_APIC_ALL;
  627. for (i = 0; i < 2; i++) {
  628. lintsrc.mpc_irqtype = linttypes[i];
  629. lintsrc.mpc_destapiclint = i;
  630. MP_lintsrc_info(&lintsrc);
  631. }
  632. }
  633. static struct intel_mp_floating *mpf_found;
  634. /*
  635. * Scan the memory blocks for an SMP configuration block.
  636. */
  637. static void __init __get_smp_config(unsigned early)
  638. {
  639. struct intel_mp_floating *mpf = mpf_found;
  640. if (acpi_lapic && early)
  641. return;
  642. /*
  643. * ACPI supports both logical (e.g. Hyper-Threading) and physical
  644. * processors, where MPS only supports physical.
  645. */
  646. if (acpi_lapic && acpi_ioapic) {
  647. printk(KERN_INFO "Using ACPI (MADT) for SMP configuration "
  648. "information\n");
  649. return;
  650. } else if (acpi_lapic)
  651. printk(KERN_INFO "Using ACPI for processor (LAPIC) "
  652. "configuration information\n");
  653. printk(KERN_INFO "Intel MultiProcessor Specification v1.%d\n",
  654. mpf->mpf_specification);
  655. #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86_32)
  656. if (mpf->mpf_feature2 & (1 << 7)) {
  657. printk(KERN_INFO " IMCR and PIC compatibility mode.\n");
  658. pic_mode = 1;
  659. } else {
  660. printk(KERN_INFO " Virtual Wire compatibility mode.\n");
  661. pic_mode = 0;
  662. }
  663. #endif
  664. /*
  665. * Now see if we need to read further.
  666. */
  667. if (mpf->mpf_feature1 != 0) {
  668. if (early) {
  669. /*
  670. * local APIC has default address
  671. */
  672. mp_lapic_addr = APIC_DEFAULT_PHYS_BASE;
  673. return;
  674. }
  675. printk(KERN_INFO "Default MP configuration #%d\n",
  676. mpf->mpf_feature1);
  677. construct_default_ISA_mptable(mpf->mpf_feature1);
  678. } else if (mpf->mpf_physptr) {
  679. /*
  680. * Read the physical hardware table. Anything here will
  681. * override the defaults.
  682. */
  683. if (!smp_read_mpc(phys_to_virt(mpf->mpf_physptr), early)) {
  684. #ifdef CONFIG_X86_LOCAL_APIC
  685. smp_found_config = 0;
  686. #endif
  687. printk(KERN_ERR
  688. "BIOS bug, MP table errors detected!...\n");
  689. printk(KERN_ERR "... disabling SMP support. "
  690. "(tell your hw vendor)\n");
  691. return;
  692. }
  693. if (early)
  694. return;
  695. #ifdef CONFIG_X86_IO_APIC
  696. /*
  697. * If there are no explicit MP IRQ entries, then we are
  698. * broken. We set up most of the low 16 IO-APIC pins to
  699. * ISA defaults and hope it will work.
  700. */
  701. if (!mp_irq_entries) {
  702. struct mpc_config_bus bus;
  703. printk(KERN_ERR "BIOS bug, no explicit IRQ entries, "
  704. "using default mptable. "
  705. "(tell your hw vendor)\n");
  706. bus.mpc_type = MP_BUS;
  707. bus.mpc_busid = 0;
  708. memcpy(bus.mpc_bustype, "ISA ", 6);
  709. MP_bus_info(&bus);
  710. construct_default_ioirq_mptable(0);
  711. }
  712. #endif
  713. } else
  714. BUG();
  715. if (!early)
  716. printk(KERN_INFO "Processors: %d\n", num_processors);
  717. /*
  718. * Only use the first configuration found.
  719. */
  720. }
  721. void __init early_get_smp_config(void)
  722. {
  723. __get_smp_config(1);
  724. }
  725. void __init get_smp_config(void)
  726. {
  727. __get_smp_config(0);
  728. }
  729. static int __init smp_scan_config(unsigned long base, unsigned long length,
  730. unsigned reserve)
  731. {
  732. unsigned int *bp = phys_to_virt(base);
  733. struct intel_mp_floating *mpf;
  734. printk(KERN_DEBUG "Scan SMP from %p for %ld bytes.\n", bp, length);
  735. BUILD_BUG_ON(sizeof(*mpf) != 16);
  736. while (length > 0) {
  737. mpf = (struct intel_mp_floating *)bp;
  738. if ((*bp == SMP_MAGIC_IDENT) &&
  739. (mpf->mpf_length == 1) &&
  740. !mpf_checksum((unsigned char *)bp, 16) &&
  741. ((mpf->mpf_specification == 1)
  742. || (mpf->mpf_specification == 4))) {
  743. #ifdef CONFIG_X86_LOCAL_APIC
  744. smp_found_config = 1;
  745. #endif
  746. mpf_found = mpf;
  747. #ifdef CONFIG_X86_32
  748. printk(KERN_INFO "found SMP MP-table at [%p] %08lx\n",
  749. mpf, virt_to_phys(mpf));
  750. reserve_bootmem(virt_to_phys(mpf), PAGE_SIZE,
  751. BOOTMEM_DEFAULT);
  752. if (mpf->mpf_physptr) {
  753. /*
  754. * We cannot access to MPC table to compute
  755. * table size yet, as only few megabytes from
  756. * the bottom is mapped now.
  757. * PC-9800's MPC table places on the very last
  758. * of physical memory; so that simply reserving
  759. * PAGE_SIZE from mpg->mpf_physptr yields BUG()
  760. * in reserve_bootmem.
  761. */
  762. unsigned long size = PAGE_SIZE;
  763. unsigned long end = max_low_pfn * PAGE_SIZE;
  764. if (mpf->mpf_physptr + size > end)
  765. size = end - mpf->mpf_physptr;
  766. reserve_bootmem(mpf->mpf_physptr, size,
  767. BOOTMEM_DEFAULT);
  768. }
  769. #else
  770. if (!reserve)
  771. return 1;
  772. reserve_bootmem_generic(virt_to_phys(mpf), PAGE_SIZE);
  773. if (mpf->mpf_physptr)
  774. reserve_bootmem_generic(mpf->mpf_physptr,
  775. PAGE_SIZE);
  776. #endif
  777. return 1;
  778. }
  779. bp += 4;
  780. length -= 16;
  781. }
  782. return 0;
  783. }
  784. static void __init __find_smp_config(unsigned reserve)
  785. {
  786. unsigned int address;
  787. /*
  788. * FIXME: Linux assumes you have 640K of base ram..
  789. * this continues the error...
  790. *
  791. * 1) Scan the bottom 1K for a signature
  792. * 2) Scan the top 1K of base RAM
  793. * 3) Scan the 64K of bios
  794. */
  795. if (smp_scan_config(0x0, 0x400, reserve) ||
  796. smp_scan_config(639 * 0x400, 0x400, reserve) ||
  797. smp_scan_config(0xF0000, 0x10000, reserve))
  798. return;
  799. /*
  800. * If it is an SMP machine we should know now, unless the
  801. * configuration is in an EISA/MCA bus machine with an
  802. * extended bios data area.
  803. *
  804. * there is a real-mode segmented pointer pointing to the
  805. * 4K EBDA area at 0x40E, calculate and scan it here.
  806. *
  807. * NOTE! There are Linux loaders that will corrupt the EBDA
  808. * area, and as such this kind of SMP config may be less
  809. * trustworthy, simply because the SMP table may have been
  810. * stomped on during early boot. These loaders are buggy and
  811. * should be fixed.
  812. *
  813. * MP1.4 SPEC states to only scan first 1K of 4K EBDA.
  814. */
  815. address = get_bios_ebda();
  816. if (address)
  817. smp_scan_config(address, 0x400, reserve);
  818. }
  819. void __init early_find_smp_config(void)
  820. {
  821. __find_smp_config(0);
  822. }
  823. void __init find_smp_config(void)
  824. {
  825. __find_smp_config(1);
  826. }
  827. #ifdef CONFIG_X86_IO_APIC
  828. static u8 __initdata irq_used[MAX_IRQ_SOURCES];
  829. static int __init get_MP_intsrc_index(struct mpc_config_intsrc *m)
  830. {
  831. int i;
  832. if (m->mpc_irqtype != mp_INT)
  833. return 0;
  834. if (m->mpc_irqflag != 0x0f)
  835. return 0;
  836. /* not legacy */
  837. for (i = 0; i < mp_irq_entries; i++) {
  838. if (mp_irqs[i].mp_irqtype != mp_INT)
  839. continue;
  840. if (mp_irqs[i].mp_irqflag != 0x0f)
  841. continue;
  842. if (mp_irqs[i].mp_srcbus != m->mpc_srcbus)
  843. continue;
  844. if (mp_irqs[i].mp_srcbusirq != m->mpc_srcbusirq)
  845. continue;
  846. if (irq_used[i]) {
  847. /* already claimed */
  848. return -2;
  849. }
  850. irq_used[i] = 1;
  851. return i;
  852. }
  853. /* not found */
  854. return -1;
  855. }
  856. #define SPARE_SLOT_NUM 20
  857. static struct mpc_config_intsrc __initdata *m_spare[SPARE_SLOT_NUM];
  858. #endif
  859. static int __init replace_intsrc_all(struct mp_config_table *mpc,
  860. unsigned long mpc_new_phys,
  861. unsigned long mpc_new_length)
  862. {
  863. #ifdef CONFIG_X86_IO_APIC
  864. int i;
  865. int nr_m_spare = 0;
  866. #endif
  867. int count = sizeof(*mpc);
  868. unsigned char *mpt = ((unsigned char *)mpc) + count;
  869. printk(KERN_INFO "mpc_length %x\n", mpc->mpc_length);
  870. while (count < mpc->mpc_length) {
  871. switch (*mpt) {
  872. case MP_PROCESSOR:
  873. {
  874. struct mpc_config_processor *m =
  875. (struct mpc_config_processor *)mpt;
  876. mpt += sizeof(*m);
  877. count += sizeof(*m);
  878. break;
  879. }
  880. case MP_BUS:
  881. {
  882. struct mpc_config_bus *m =
  883. (struct mpc_config_bus *)mpt;
  884. mpt += sizeof(*m);
  885. count += sizeof(*m);
  886. break;
  887. }
  888. case MP_IOAPIC:
  889. {
  890. mpt += sizeof(struct mpc_config_ioapic);
  891. count += sizeof(struct mpc_config_ioapic);
  892. break;
  893. }
  894. case MP_INTSRC:
  895. {
  896. #ifdef CONFIG_X86_IO_APIC
  897. struct mpc_config_intsrc *m =
  898. (struct mpc_config_intsrc *)mpt;
  899. printk(KERN_INFO "OLD ");
  900. print_MP_intsrc_info(m);
  901. i = get_MP_intsrc_index(m);
  902. if (i > 0) {
  903. assign_to_mpc_intsrc(&mp_irqs[i], m);
  904. printk(KERN_INFO "NEW ");
  905. print_mp_irq_info(&mp_irqs[i]);
  906. } else if (!i) {
  907. /* legacy, do nothing */
  908. } else if (nr_m_spare < SPARE_SLOT_NUM) {
  909. /*
  910. * not found (-1), or duplicated (-2)
  911. * are invalid entries,
  912. * we need to use the slot later
  913. */
  914. m_spare[nr_m_spare] = m;
  915. nr_m_spare++;
  916. }
  917. #endif
  918. mpt += sizeof(struct mpc_config_intsrc);
  919. count += sizeof(struct mpc_config_intsrc);
  920. break;
  921. }
  922. case MP_LINTSRC:
  923. {
  924. struct mpc_config_lintsrc *m =
  925. (struct mpc_config_lintsrc *)mpt;
  926. mpt += sizeof(*m);
  927. count += sizeof(*m);
  928. break;
  929. }
  930. default:
  931. /* wrong mptable */
  932. printk(KERN_ERR "Your mptable is wrong, contact your HW vendor!\n");
  933. printk(KERN_ERR "type %x\n", *mpt);
  934. print_hex_dump(KERN_ERR, " ", DUMP_PREFIX_ADDRESS, 16,
  935. 1, mpc, mpc->mpc_length, 1);
  936. goto out;
  937. }
  938. }
  939. #ifdef CONFIG_X86_IO_APIC
  940. for (i = 0; i < mp_irq_entries; i++) {
  941. if (irq_used[i])
  942. continue;
  943. if (mp_irqs[i].mp_irqtype != mp_INT)
  944. continue;
  945. if (mp_irqs[i].mp_irqflag != 0x0f)
  946. continue;
  947. if (nr_m_spare > 0) {
  948. printk(KERN_INFO "*NEW* found ");
  949. nr_m_spare--;
  950. assign_to_mpc_intsrc(&mp_irqs[i], m_spare[nr_m_spare]);
  951. m_spare[nr_m_spare] = NULL;
  952. } else {
  953. struct mpc_config_intsrc *m =
  954. (struct mpc_config_intsrc *)mpt;
  955. count += sizeof(struct mpc_config_intsrc);
  956. if (!mpc_new_phys) {
  957. printk(KERN_INFO "No spare slots, try to append...take your risk, new mpc_length %x\n", count);
  958. } else {
  959. if (count <= mpc_new_length)
  960. printk(KERN_INFO "No spare slots, try to append..., new mpc_length %x\n", count);
  961. else {
  962. printk(KERN_ERR "mpc_new_length %lx is too small\n", mpc_new_length);
  963. goto out;
  964. }
  965. }
  966. assign_to_mpc_intsrc(&mp_irqs[i], m);
  967. mpc->mpc_length = count;
  968. mpt += sizeof(struct mpc_config_intsrc);
  969. }
  970. print_mp_irq_info(&mp_irqs[i]);
  971. }
  972. #endif
  973. out:
  974. /* update checksum */
  975. mpc->mpc_checksum = 0;
  976. mpc->mpc_checksum -= mpf_checksum((unsigned char *)mpc,
  977. mpc->mpc_length);
  978. return 0;
  979. }
  980. int __initdata enable_update_mptable;
  981. static int __init update_mptable_setup(char *str)
  982. {
  983. enable_update_mptable = 1;
  984. return 0;
  985. }
  986. early_param("update_mptable", update_mptable_setup);
  987. static unsigned long __initdata mpc_new_phys;
  988. static unsigned long mpc_new_length __initdata = 4096;
  989. /* alloc_mptable or alloc_mptable=4k */
  990. static int __initdata alloc_mptable;
  991. static int __init parse_alloc_mptable_opt(char *p)
  992. {
  993. enable_update_mptable = 1;
  994. alloc_mptable = 1;
  995. if (!p)
  996. return 0;
  997. mpc_new_length = memparse(p, &p);
  998. return 0;
  999. }
  1000. early_param("alloc_mptable", parse_alloc_mptable_opt);
  1001. void __init early_reserve_e820_mpc_new(void)
  1002. {
  1003. if (enable_update_mptable && alloc_mptable) {
  1004. u64 startt = 0;
  1005. #ifdef CONFIG_X86_TRAMPOLINE
  1006. startt = TRAMPOLINE_BASE;
  1007. #endif
  1008. mpc_new_phys = early_reserve_e820(startt, mpc_new_length, 4);
  1009. }
  1010. }
  1011. static int __init update_mp_table(void)
  1012. {
  1013. char str[16];
  1014. char oem[10];
  1015. struct intel_mp_floating *mpf;
  1016. struct mp_config_table *mpc;
  1017. struct mp_config_table *mpc_new;
  1018. if (!enable_update_mptable)
  1019. return 0;
  1020. mpf = mpf_found;
  1021. if (!mpf)
  1022. return 0;
  1023. /*
  1024. * Now see if we need to go further.
  1025. */
  1026. if (mpf->mpf_feature1 != 0)
  1027. return 0;
  1028. if (!mpf->mpf_physptr)
  1029. return 0;
  1030. mpc = phys_to_virt(mpf->mpf_physptr);
  1031. if (!smp_check_mpc(mpc, oem, str))
  1032. return 0;
  1033. printk(KERN_INFO "mpf: %lx\n", virt_to_phys(mpf));
  1034. printk(KERN_INFO "mpf_physptr: %x\n", mpf->mpf_physptr);
  1035. if (mpc_new_phys && mpc->mpc_length > mpc_new_length) {
  1036. mpc_new_phys = 0;
  1037. printk(KERN_INFO "mpc_new_length is %ld, please use alloc_mptable=8k\n",
  1038. mpc_new_length);
  1039. }
  1040. if (!mpc_new_phys) {
  1041. unsigned char old, new;
  1042. /* check if we can change the postion */
  1043. mpc->mpc_checksum = 0;
  1044. old = mpf_checksum((unsigned char *)mpc, mpc->mpc_length);
  1045. mpc->mpc_checksum = 0xff;
  1046. new = mpf_checksum((unsigned char *)mpc, mpc->mpc_length);
  1047. if (old == new) {
  1048. printk(KERN_INFO "mpc is readonly, please try alloc_mptable instead\n");
  1049. return 0;
  1050. }
  1051. printk(KERN_INFO "use in-positon replacing\n");
  1052. } else {
  1053. mpf->mpf_physptr = mpc_new_phys;
  1054. mpc_new = phys_to_virt(mpc_new_phys);
  1055. memcpy(mpc_new, mpc, mpc->mpc_length);
  1056. mpc = mpc_new;
  1057. /* check if we can modify that */
  1058. if (mpc_new_phys - mpf->mpf_physptr) {
  1059. struct intel_mp_floating *mpf_new;
  1060. /* steal 16 bytes from [0, 1k) */
  1061. printk(KERN_INFO "mpf new: %x\n", 0x400 - 16);
  1062. mpf_new = phys_to_virt(0x400 - 16);
  1063. memcpy(mpf_new, mpf, 16);
  1064. mpf = mpf_new;
  1065. mpf->mpf_physptr = mpc_new_phys;
  1066. }
  1067. mpf->mpf_checksum = 0;
  1068. mpf->mpf_checksum -= mpf_checksum((unsigned char *)mpf, 16);
  1069. printk(KERN_INFO "mpf_physptr new: %x\n", mpf->mpf_physptr);
  1070. }
  1071. /*
  1072. * only replace the one with mp_INT and
  1073. * MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW,
  1074. * already in mp_irqs , stored by ... and mp_config_acpi_gsi,
  1075. * may need pci=routeirq for all coverage
  1076. */
  1077. replace_intsrc_all(mpc, mpc_new_phys, mpc_new_length);
  1078. return 0;
  1079. }
  1080. late_initcall(update_mp_table);