mpparse.c 30 KB

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