mpparse.c 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246
  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 __init 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 __init 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. static void __init 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. * Machine specific quirk for finding the SMP config before other setup
  636. * activities destroy the table:
  637. */
  638. int (*mach_get_smp_config_quirk)(unsigned int early);
  639. /*
  640. * Scan the memory blocks for an SMP configuration block.
  641. */
  642. static void __init __get_smp_config(unsigned int early)
  643. {
  644. struct intel_mp_floating *mpf = mpf_found;
  645. if (mach_get_smp_config_quirk) {
  646. if (mach_get_smp_config_quirk(early))
  647. return;
  648. }
  649. if (acpi_lapic && early)
  650. return;
  651. /*
  652. * ACPI supports both logical (e.g. Hyper-Threading) and physical
  653. * processors, where MPS only supports physical.
  654. */
  655. if (acpi_lapic && acpi_ioapic) {
  656. printk(KERN_INFO "Using ACPI (MADT) for SMP configuration "
  657. "information\n");
  658. return;
  659. } else if (acpi_lapic)
  660. printk(KERN_INFO "Using ACPI for processor (LAPIC) "
  661. "configuration information\n");
  662. printk(KERN_INFO "Intel MultiProcessor Specification v1.%d\n",
  663. mpf->mpf_specification);
  664. #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86_32)
  665. if (mpf->mpf_feature2 & (1 << 7)) {
  666. printk(KERN_INFO " IMCR and PIC compatibility mode.\n");
  667. pic_mode = 1;
  668. } else {
  669. printk(KERN_INFO " Virtual Wire compatibility mode.\n");
  670. pic_mode = 0;
  671. }
  672. #endif
  673. /*
  674. * Now see if we need to read further.
  675. */
  676. if (mpf->mpf_feature1 != 0) {
  677. if (early) {
  678. /*
  679. * local APIC has default address
  680. */
  681. mp_lapic_addr = APIC_DEFAULT_PHYS_BASE;
  682. return;
  683. }
  684. printk(KERN_INFO "Default MP configuration #%d\n",
  685. mpf->mpf_feature1);
  686. construct_default_ISA_mptable(mpf->mpf_feature1);
  687. } else if (mpf->mpf_physptr) {
  688. /*
  689. * Read the physical hardware table. Anything here will
  690. * override the defaults.
  691. */
  692. if (!smp_read_mpc(phys_to_virt(mpf->mpf_physptr), early)) {
  693. #ifdef CONFIG_X86_LOCAL_APIC
  694. smp_found_config = 0;
  695. #endif
  696. printk(KERN_ERR
  697. "BIOS bug, MP table errors detected!...\n");
  698. printk(KERN_ERR "... disabling SMP support. "
  699. "(tell your hw vendor)\n");
  700. return;
  701. }
  702. if (early)
  703. return;
  704. #ifdef CONFIG_X86_IO_APIC
  705. /*
  706. * If there are no explicit MP IRQ entries, then we are
  707. * broken. We set up most of the low 16 IO-APIC pins to
  708. * ISA defaults and hope it will work.
  709. */
  710. if (!mp_irq_entries) {
  711. struct mpc_config_bus bus;
  712. printk(KERN_ERR "BIOS bug, no explicit IRQ entries, "
  713. "using default mptable. "
  714. "(tell your hw vendor)\n");
  715. bus.mpc_type = MP_BUS;
  716. bus.mpc_busid = 0;
  717. memcpy(bus.mpc_bustype, "ISA ", 6);
  718. MP_bus_info(&bus);
  719. construct_default_ioirq_mptable(0);
  720. }
  721. #endif
  722. } else
  723. BUG();
  724. if (!early)
  725. printk(KERN_INFO "Processors: %d\n", num_processors);
  726. /*
  727. * Only use the first configuration found.
  728. */
  729. }
  730. void __init early_get_smp_config(void)
  731. {
  732. __get_smp_config(1);
  733. }
  734. void __init get_smp_config(void)
  735. {
  736. __get_smp_config(0);
  737. }
  738. static int __init smp_scan_config(unsigned long base, unsigned long length,
  739. unsigned reserve)
  740. {
  741. unsigned int *bp = phys_to_virt(base);
  742. struct intel_mp_floating *mpf;
  743. printk(KERN_DEBUG "Scan SMP from %p for %ld bytes.\n", bp, length);
  744. BUILD_BUG_ON(sizeof(*mpf) != 16);
  745. while (length > 0) {
  746. mpf = (struct intel_mp_floating *)bp;
  747. if ((*bp == SMP_MAGIC_IDENT) &&
  748. (mpf->mpf_length == 1) &&
  749. !mpf_checksum((unsigned char *)bp, 16) &&
  750. ((mpf->mpf_specification == 1)
  751. || (mpf->mpf_specification == 4))) {
  752. #ifdef CONFIG_X86_LOCAL_APIC
  753. smp_found_config = 1;
  754. #endif
  755. mpf_found = mpf;
  756. printk(KERN_INFO "found SMP MP-table at [%p] %08lx\n",
  757. mpf, virt_to_phys(mpf));
  758. if (!reserve)
  759. return 1;
  760. reserve_bootmem_generic(virt_to_phys(mpf), PAGE_SIZE,
  761. BOOTMEM_DEFAULT);
  762. if (mpf->mpf_physptr) {
  763. unsigned long size = PAGE_SIZE;
  764. #ifdef CONFIG_X86_32
  765. /*
  766. * We cannot access to MPC table to compute
  767. * table size yet, as only few megabytes from
  768. * the bottom is mapped now.
  769. * PC-9800's MPC table places on the very last
  770. * of physical memory; so that simply reserving
  771. * PAGE_SIZE from mpg->mpf_physptr yields BUG()
  772. * in reserve_bootmem.
  773. */
  774. unsigned long end = max_low_pfn * PAGE_SIZE;
  775. if (mpf->mpf_physptr + size > end)
  776. size = end - mpf->mpf_physptr;
  777. #endif
  778. reserve_bootmem_generic(mpf->mpf_physptr, size,
  779. BOOTMEM_DEFAULT);
  780. }
  781. return 1;
  782. }
  783. bp += 4;
  784. length -= 16;
  785. }
  786. return 0;
  787. }
  788. int (*mach_find_smp_config_quirk)(unsigned int reserve);
  789. static void __init __find_smp_config(unsigned int reserve)
  790. {
  791. unsigned int address;
  792. if (mach_find_smp_config_quirk) {
  793. if (mach_find_smp_config_quirk(reserve))
  794. return;
  795. }
  796. /*
  797. * FIXME: Linux assumes you have 640K of base ram..
  798. * this continues the error...
  799. *
  800. * 1) Scan the bottom 1K for a signature
  801. * 2) Scan the top 1K of base RAM
  802. * 3) Scan the 64K of bios
  803. */
  804. if (smp_scan_config(0x0, 0x400, reserve) ||
  805. smp_scan_config(639 * 0x400, 0x400, reserve) ||
  806. smp_scan_config(0xF0000, 0x10000, reserve))
  807. return;
  808. /*
  809. * If it is an SMP machine we should know now, unless the
  810. * configuration is in an EISA/MCA bus machine with an
  811. * extended bios data area.
  812. *
  813. * there is a real-mode segmented pointer pointing to the
  814. * 4K EBDA area at 0x40E, calculate and scan it here.
  815. *
  816. * NOTE! There are Linux loaders that will corrupt the EBDA
  817. * area, and as such this kind of SMP config may be less
  818. * trustworthy, simply because the SMP table may have been
  819. * stomped on during early boot. These loaders are buggy and
  820. * should be fixed.
  821. *
  822. * MP1.4 SPEC states to only scan first 1K of 4K EBDA.
  823. */
  824. address = get_bios_ebda();
  825. if (address)
  826. smp_scan_config(address, 0x400, reserve);
  827. }
  828. void __init early_find_smp_config(void)
  829. {
  830. __find_smp_config(0);
  831. }
  832. void __init find_smp_config(void)
  833. {
  834. __find_smp_config(1);
  835. }
  836. #ifdef CONFIG_X86_IO_APIC
  837. static u8 __initdata irq_used[MAX_IRQ_SOURCES];
  838. static int __init get_MP_intsrc_index(struct mpc_config_intsrc *m)
  839. {
  840. int i;
  841. if (m->mpc_irqtype != mp_INT)
  842. return 0;
  843. if (m->mpc_irqflag != 0x0f)
  844. return 0;
  845. /* not legacy */
  846. for (i = 0; i < mp_irq_entries; i++) {
  847. if (mp_irqs[i].mp_irqtype != mp_INT)
  848. continue;
  849. if (mp_irqs[i].mp_irqflag != 0x0f)
  850. continue;
  851. if (mp_irqs[i].mp_srcbus != m->mpc_srcbus)
  852. continue;
  853. if (mp_irqs[i].mp_srcbusirq != m->mpc_srcbusirq)
  854. continue;
  855. if (irq_used[i]) {
  856. /* already claimed */
  857. return -2;
  858. }
  859. irq_used[i] = 1;
  860. return i;
  861. }
  862. /* not found */
  863. return -1;
  864. }
  865. #define SPARE_SLOT_NUM 20
  866. static struct mpc_config_intsrc __initdata *m_spare[SPARE_SLOT_NUM];
  867. #endif
  868. static int __init replace_intsrc_all(struct mp_config_table *mpc,
  869. unsigned long mpc_new_phys,
  870. unsigned long mpc_new_length)
  871. {
  872. #ifdef CONFIG_X86_IO_APIC
  873. int i;
  874. int nr_m_spare = 0;
  875. #endif
  876. int count = sizeof(*mpc);
  877. unsigned char *mpt = ((unsigned char *)mpc) + count;
  878. printk(KERN_INFO "mpc_length %x\n", mpc->mpc_length);
  879. while (count < mpc->mpc_length) {
  880. switch (*mpt) {
  881. case MP_PROCESSOR:
  882. {
  883. struct mpc_config_processor *m =
  884. (struct mpc_config_processor *)mpt;
  885. mpt += sizeof(*m);
  886. count += sizeof(*m);
  887. break;
  888. }
  889. case MP_BUS:
  890. {
  891. struct mpc_config_bus *m =
  892. (struct mpc_config_bus *)mpt;
  893. mpt += sizeof(*m);
  894. count += sizeof(*m);
  895. break;
  896. }
  897. case MP_IOAPIC:
  898. {
  899. mpt += sizeof(struct mpc_config_ioapic);
  900. count += sizeof(struct mpc_config_ioapic);
  901. break;
  902. }
  903. case MP_INTSRC:
  904. {
  905. #ifdef CONFIG_X86_IO_APIC
  906. struct mpc_config_intsrc *m =
  907. (struct mpc_config_intsrc *)mpt;
  908. printk(KERN_INFO "OLD ");
  909. print_MP_intsrc_info(m);
  910. i = get_MP_intsrc_index(m);
  911. if (i > 0) {
  912. assign_to_mpc_intsrc(&mp_irqs[i], m);
  913. printk(KERN_INFO "NEW ");
  914. print_mp_irq_info(&mp_irqs[i]);
  915. } else if (!i) {
  916. /* legacy, do nothing */
  917. } else if (nr_m_spare < SPARE_SLOT_NUM) {
  918. /*
  919. * not found (-1), or duplicated (-2)
  920. * are invalid entries,
  921. * we need to use the slot later
  922. */
  923. m_spare[nr_m_spare] = m;
  924. nr_m_spare++;
  925. }
  926. #endif
  927. mpt += sizeof(struct mpc_config_intsrc);
  928. count += sizeof(struct mpc_config_intsrc);
  929. break;
  930. }
  931. case MP_LINTSRC:
  932. {
  933. struct mpc_config_lintsrc *m =
  934. (struct mpc_config_lintsrc *)mpt;
  935. mpt += sizeof(*m);
  936. count += sizeof(*m);
  937. break;
  938. }
  939. default:
  940. /* wrong mptable */
  941. printk(KERN_ERR "Your mptable is wrong, contact your HW vendor!\n");
  942. printk(KERN_ERR "type %x\n", *mpt);
  943. print_hex_dump(KERN_ERR, " ", DUMP_PREFIX_ADDRESS, 16,
  944. 1, mpc, mpc->mpc_length, 1);
  945. goto out;
  946. }
  947. }
  948. #ifdef CONFIG_X86_IO_APIC
  949. for (i = 0; i < mp_irq_entries; i++) {
  950. if (irq_used[i])
  951. continue;
  952. if (mp_irqs[i].mp_irqtype != mp_INT)
  953. continue;
  954. if (mp_irqs[i].mp_irqflag != 0x0f)
  955. continue;
  956. if (nr_m_spare > 0) {
  957. printk(KERN_INFO "*NEW* found ");
  958. nr_m_spare--;
  959. assign_to_mpc_intsrc(&mp_irqs[i], m_spare[nr_m_spare]);
  960. m_spare[nr_m_spare] = NULL;
  961. } else {
  962. struct mpc_config_intsrc *m =
  963. (struct mpc_config_intsrc *)mpt;
  964. count += sizeof(struct mpc_config_intsrc);
  965. if (!mpc_new_phys) {
  966. printk(KERN_INFO "No spare slots, try to append...take your risk, new mpc_length %x\n", count);
  967. } else {
  968. if (count <= mpc_new_length)
  969. printk(KERN_INFO "No spare slots, try to append..., new mpc_length %x\n", count);
  970. else {
  971. printk(KERN_ERR "mpc_new_length %lx is too small\n", mpc_new_length);
  972. goto out;
  973. }
  974. }
  975. assign_to_mpc_intsrc(&mp_irqs[i], m);
  976. mpc->mpc_length = count;
  977. mpt += sizeof(struct mpc_config_intsrc);
  978. }
  979. print_mp_irq_info(&mp_irqs[i]);
  980. }
  981. #endif
  982. out:
  983. /* update checksum */
  984. mpc->mpc_checksum = 0;
  985. mpc->mpc_checksum -= mpf_checksum((unsigned char *)mpc,
  986. mpc->mpc_length);
  987. return 0;
  988. }
  989. static int __initdata enable_update_mptable;
  990. static int __init update_mptable_setup(char *str)
  991. {
  992. enable_update_mptable = 1;
  993. return 0;
  994. }
  995. early_param("update_mptable", update_mptable_setup);
  996. static unsigned long __initdata mpc_new_phys;
  997. static unsigned long mpc_new_length __initdata = 4096;
  998. /* alloc_mptable or alloc_mptable=4k */
  999. static int __initdata alloc_mptable;
  1000. static int __init parse_alloc_mptable_opt(char *p)
  1001. {
  1002. enable_update_mptable = 1;
  1003. alloc_mptable = 1;
  1004. if (!p)
  1005. return 0;
  1006. mpc_new_length = memparse(p, &p);
  1007. return 0;
  1008. }
  1009. early_param("alloc_mptable", parse_alloc_mptable_opt);
  1010. void __init early_reserve_e820_mpc_new(void)
  1011. {
  1012. if (enable_update_mptable && alloc_mptable) {
  1013. u64 startt = 0;
  1014. #ifdef CONFIG_X86_TRAMPOLINE
  1015. startt = TRAMPOLINE_BASE;
  1016. #endif
  1017. mpc_new_phys = early_reserve_e820(startt, mpc_new_length, 4);
  1018. }
  1019. }
  1020. static int __init update_mp_table(void)
  1021. {
  1022. char str[16];
  1023. char oem[10];
  1024. struct intel_mp_floating *mpf;
  1025. struct mp_config_table *mpc;
  1026. struct mp_config_table *mpc_new;
  1027. if (!enable_update_mptable)
  1028. return 0;
  1029. mpf = mpf_found;
  1030. if (!mpf)
  1031. return 0;
  1032. /*
  1033. * Now see if we need to go further.
  1034. */
  1035. if (mpf->mpf_feature1 != 0)
  1036. return 0;
  1037. if (!mpf->mpf_physptr)
  1038. return 0;
  1039. mpc = phys_to_virt(mpf->mpf_physptr);
  1040. if (!smp_check_mpc(mpc, oem, str))
  1041. return 0;
  1042. printk(KERN_INFO "mpf: %lx\n", virt_to_phys(mpf));
  1043. printk(KERN_INFO "mpf_physptr: %x\n", mpf->mpf_physptr);
  1044. if (mpc_new_phys && mpc->mpc_length > mpc_new_length) {
  1045. mpc_new_phys = 0;
  1046. printk(KERN_INFO "mpc_new_length is %ld, please use alloc_mptable=8k\n",
  1047. mpc_new_length);
  1048. }
  1049. if (!mpc_new_phys) {
  1050. unsigned char old, new;
  1051. /* check if we can change the postion */
  1052. mpc->mpc_checksum = 0;
  1053. old = mpf_checksum((unsigned char *)mpc, mpc->mpc_length);
  1054. mpc->mpc_checksum = 0xff;
  1055. new = mpf_checksum((unsigned char *)mpc, mpc->mpc_length);
  1056. if (old == new) {
  1057. printk(KERN_INFO "mpc is readonly, please try alloc_mptable instead\n");
  1058. return 0;
  1059. }
  1060. printk(KERN_INFO "use in-positon replacing\n");
  1061. } else {
  1062. mpf->mpf_physptr = mpc_new_phys;
  1063. mpc_new = phys_to_virt(mpc_new_phys);
  1064. memcpy(mpc_new, mpc, mpc->mpc_length);
  1065. mpc = mpc_new;
  1066. /* check if we can modify that */
  1067. if (mpc_new_phys - mpf->mpf_physptr) {
  1068. struct intel_mp_floating *mpf_new;
  1069. /* steal 16 bytes from [0, 1k) */
  1070. printk(KERN_INFO "mpf new: %x\n", 0x400 - 16);
  1071. mpf_new = phys_to_virt(0x400 - 16);
  1072. memcpy(mpf_new, mpf, 16);
  1073. mpf = mpf_new;
  1074. mpf->mpf_physptr = mpc_new_phys;
  1075. }
  1076. mpf->mpf_checksum = 0;
  1077. mpf->mpf_checksum -= mpf_checksum((unsigned char *)mpf, 16);
  1078. printk(KERN_INFO "mpf_physptr new: %x\n", mpf->mpf_physptr);
  1079. }
  1080. /*
  1081. * only replace the one with mp_INT and
  1082. * MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW,
  1083. * already in mp_irqs , stored by ... and mp_config_acpi_gsi,
  1084. * may need pci=routeirq for all coverage
  1085. */
  1086. replace_intsrc_all(mpc, mpc_new_phys, mpc_new_length);
  1087. return 0;
  1088. }
  1089. late_initcall(update_mp_table);