mpparse.c 30 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235
  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. BOOTMEM_DEFAULT);
  774. if (mpf->mpf_physptr)
  775. reserve_bootmem_generic(mpf->mpf_physptr,
  776. PAGE_SIZE, BOOTMEM_DEFAULT);
  777. #endif
  778. return 1;
  779. }
  780. bp += 4;
  781. length -= 16;
  782. }
  783. return 0;
  784. }
  785. static void __init __find_smp_config(unsigned reserve)
  786. {
  787. unsigned int address;
  788. /*
  789. * FIXME: Linux assumes you have 640K of base ram..
  790. * this continues the error...
  791. *
  792. * 1) Scan the bottom 1K for a signature
  793. * 2) Scan the top 1K of base RAM
  794. * 3) Scan the 64K of bios
  795. */
  796. if (smp_scan_config(0x0, 0x400, reserve) ||
  797. smp_scan_config(639 * 0x400, 0x400, reserve) ||
  798. smp_scan_config(0xF0000, 0x10000, reserve))
  799. return;
  800. /*
  801. * If it is an SMP machine we should know now, unless the
  802. * configuration is in an EISA/MCA bus machine with an
  803. * extended bios data area.
  804. *
  805. * there is a real-mode segmented pointer pointing to the
  806. * 4K EBDA area at 0x40E, calculate and scan it here.
  807. *
  808. * NOTE! There are Linux loaders that will corrupt the EBDA
  809. * area, and as such this kind of SMP config may be less
  810. * trustworthy, simply because the SMP table may have been
  811. * stomped on during early boot. These loaders are buggy and
  812. * should be fixed.
  813. *
  814. * MP1.4 SPEC states to only scan first 1K of 4K EBDA.
  815. */
  816. address = get_bios_ebda();
  817. if (address)
  818. smp_scan_config(address, 0x400, reserve);
  819. }
  820. void __init early_find_smp_config(void)
  821. {
  822. __find_smp_config(0);
  823. }
  824. void __init find_smp_config(void)
  825. {
  826. __find_smp_config(1);
  827. }
  828. #ifdef CONFIG_X86_IO_APIC
  829. static u8 __initdata irq_used[MAX_IRQ_SOURCES];
  830. static int __init get_MP_intsrc_index(struct mpc_config_intsrc *m)
  831. {
  832. int i;
  833. if (m->mpc_irqtype != mp_INT)
  834. return 0;
  835. if (m->mpc_irqflag != 0x0f)
  836. return 0;
  837. /* not legacy */
  838. for (i = 0; i < mp_irq_entries; i++) {
  839. if (mp_irqs[i].mp_irqtype != mp_INT)
  840. continue;
  841. if (mp_irqs[i].mp_irqflag != 0x0f)
  842. continue;
  843. if (mp_irqs[i].mp_srcbus != m->mpc_srcbus)
  844. continue;
  845. if (mp_irqs[i].mp_srcbusirq != m->mpc_srcbusirq)
  846. continue;
  847. if (irq_used[i]) {
  848. /* already claimed */
  849. return -2;
  850. }
  851. irq_used[i] = 1;
  852. return i;
  853. }
  854. /* not found */
  855. return -1;
  856. }
  857. #define SPARE_SLOT_NUM 20
  858. static struct mpc_config_intsrc __initdata *m_spare[SPARE_SLOT_NUM];
  859. #endif
  860. static int __init replace_intsrc_all(struct mp_config_table *mpc,
  861. unsigned long mpc_new_phys,
  862. unsigned long mpc_new_length)
  863. {
  864. #ifdef CONFIG_X86_IO_APIC
  865. int i;
  866. int nr_m_spare = 0;
  867. #endif
  868. int count = sizeof(*mpc);
  869. unsigned char *mpt = ((unsigned char *)mpc) + count;
  870. printk(KERN_INFO "mpc_length %x\n", mpc->mpc_length);
  871. while (count < mpc->mpc_length) {
  872. switch (*mpt) {
  873. case MP_PROCESSOR:
  874. {
  875. struct mpc_config_processor *m =
  876. (struct mpc_config_processor *)mpt;
  877. mpt += sizeof(*m);
  878. count += sizeof(*m);
  879. break;
  880. }
  881. case MP_BUS:
  882. {
  883. struct mpc_config_bus *m =
  884. (struct mpc_config_bus *)mpt;
  885. mpt += sizeof(*m);
  886. count += sizeof(*m);
  887. break;
  888. }
  889. case MP_IOAPIC:
  890. {
  891. mpt += sizeof(struct mpc_config_ioapic);
  892. count += sizeof(struct mpc_config_ioapic);
  893. break;
  894. }
  895. case MP_INTSRC:
  896. {
  897. #ifdef CONFIG_X86_IO_APIC
  898. struct mpc_config_intsrc *m =
  899. (struct mpc_config_intsrc *)mpt;
  900. printk(KERN_INFO "OLD ");
  901. print_MP_intsrc_info(m);
  902. i = get_MP_intsrc_index(m);
  903. if (i > 0) {
  904. assign_to_mpc_intsrc(&mp_irqs[i], m);
  905. printk(KERN_INFO "NEW ");
  906. print_mp_irq_info(&mp_irqs[i]);
  907. } else if (!i) {
  908. /* legacy, do nothing */
  909. } else if (nr_m_spare < SPARE_SLOT_NUM) {
  910. /*
  911. * not found (-1), or duplicated (-2)
  912. * are invalid entries,
  913. * we need to use the slot later
  914. */
  915. m_spare[nr_m_spare] = m;
  916. nr_m_spare++;
  917. }
  918. #endif
  919. mpt += sizeof(struct mpc_config_intsrc);
  920. count += sizeof(struct mpc_config_intsrc);
  921. break;
  922. }
  923. case MP_LINTSRC:
  924. {
  925. struct mpc_config_lintsrc *m =
  926. (struct mpc_config_lintsrc *)mpt;
  927. mpt += sizeof(*m);
  928. count += sizeof(*m);
  929. break;
  930. }
  931. default:
  932. /* wrong mptable */
  933. printk(KERN_ERR "Your mptable is wrong, contact your HW vendor!\n");
  934. printk(KERN_ERR "type %x\n", *mpt);
  935. print_hex_dump(KERN_ERR, " ", DUMP_PREFIX_ADDRESS, 16,
  936. 1, mpc, mpc->mpc_length, 1);
  937. goto out;
  938. }
  939. }
  940. #ifdef CONFIG_X86_IO_APIC
  941. for (i = 0; i < mp_irq_entries; i++) {
  942. if (irq_used[i])
  943. continue;
  944. if (mp_irqs[i].mp_irqtype != mp_INT)
  945. continue;
  946. if (mp_irqs[i].mp_irqflag != 0x0f)
  947. continue;
  948. if (nr_m_spare > 0) {
  949. printk(KERN_INFO "*NEW* found ");
  950. nr_m_spare--;
  951. assign_to_mpc_intsrc(&mp_irqs[i], m_spare[nr_m_spare]);
  952. m_spare[nr_m_spare] = NULL;
  953. } else {
  954. struct mpc_config_intsrc *m =
  955. (struct mpc_config_intsrc *)mpt;
  956. count += sizeof(struct mpc_config_intsrc);
  957. if (!mpc_new_phys) {
  958. printk(KERN_INFO "No spare slots, try to append...take your risk, new mpc_length %x\n", count);
  959. } else {
  960. if (count <= mpc_new_length)
  961. printk(KERN_INFO "No spare slots, try to append..., new mpc_length %x\n", count);
  962. else {
  963. printk(KERN_ERR "mpc_new_length %lx is too small\n", mpc_new_length);
  964. goto out;
  965. }
  966. }
  967. assign_to_mpc_intsrc(&mp_irqs[i], m);
  968. mpc->mpc_length = count;
  969. mpt += sizeof(struct mpc_config_intsrc);
  970. }
  971. print_mp_irq_info(&mp_irqs[i]);
  972. }
  973. #endif
  974. out:
  975. /* update checksum */
  976. mpc->mpc_checksum = 0;
  977. mpc->mpc_checksum -= mpf_checksum((unsigned char *)mpc,
  978. mpc->mpc_length);
  979. return 0;
  980. }
  981. int __initdata enable_update_mptable;
  982. static int __init update_mptable_setup(char *str)
  983. {
  984. enable_update_mptable = 1;
  985. return 0;
  986. }
  987. early_param("update_mptable", update_mptable_setup);
  988. static unsigned long __initdata mpc_new_phys;
  989. static unsigned long mpc_new_length __initdata = 4096;
  990. /* alloc_mptable or alloc_mptable=4k */
  991. static int __initdata alloc_mptable;
  992. static int __init parse_alloc_mptable_opt(char *p)
  993. {
  994. enable_update_mptable = 1;
  995. alloc_mptable = 1;
  996. if (!p)
  997. return 0;
  998. mpc_new_length = memparse(p, &p);
  999. return 0;
  1000. }
  1001. early_param("alloc_mptable", parse_alloc_mptable_opt);
  1002. void __init early_reserve_e820_mpc_new(void)
  1003. {
  1004. if (enable_update_mptable && alloc_mptable) {
  1005. u64 startt = 0;
  1006. #ifdef CONFIG_X86_TRAMPOLINE
  1007. startt = TRAMPOLINE_BASE;
  1008. #endif
  1009. mpc_new_phys = early_reserve_e820(startt, mpc_new_length, 4);
  1010. }
  1011. }
  1012. static int __init update_mp_table(void)
  1013. {
  1014. char str[16];
  1015. char oem[10];
  1016. struct intel_mp_floating *mpf;
  1017. struct mp_config_table *mpc;
  1018. struct mp_config_table *mpc_new;
  1019. if (!enable_update_mptable)
  1020. return 0;
  1021. mpf = mpf_found;
  1022. if (!mpf)
  1023. return 0;
  1024. /*
  1025. * Now see if we need to go further.
  1026. */
  1027. if (mpf->mpf_feature1 != 0)
  1028. return 0;
  1029. if (!mpf->mpf_physptr)
  1030. return 0;
  1031. mpc = phys_to_virt(mpf->mpf_physptr);
  1032. if (!smp_check_mpc(mpc, oem, str))
  1033. return 0;
  1034. printk(KERN_INFO "mpf: %lx\n", virt_to_phys(mpf));
  1035. printk(KERN_INFO "mpf_physptr: %x\n", mpf->mpf_physptr);
  1036. if (mpc_new_phys && mpc->mpc_length > mpc_new_length) {
  1037. mpc_new_phys = 0;
  1038. printk(KERN_INFO "mpc_new_length is %ld, please use alloc_mptable=8k\n",
  1039. mpc_new_length);
  1040. }
  1041. if (!mpc_new_phys) {
  1042. unsigned char old, new;
  1043. /* check if we can change the postion */
  1044. mpc->mpc_checksum = 0;
  1045. old = mpf_checksum((unsigned char *)mpc, mpc->mpc_length);
  1046. mpc->mpc_checksum = 0xff;
  1047. new = mpf_checksum((unsigned char *)mpc, mpc->mpc_length);
  1048. if (old == new) {
  1049. printk(KERN_INFO "mpc is readonly, please try alloc_mptable instead\n");
  1050. return 0;
  1051. }
  1052. printk(KERN_INFO "use in-positon replacing\n");
  1053. } else {
  1054. mpf->mpf_physptr = mpc_new_phys;
  1055. mpc_new = phys_to_virt(mpc_new_phys);
  1056. memcpy(mpc_new, mpc, mpc->mpc_length);
  1057. mpc = mpc_new;
  1058. /* check if we can modify that */
  1059. if (mpc_new_phys - mpf->mpf_physptr) {
  1060. struct intel_mp_floating *mpf_new;
  1061. /* steal 16 bytes from [0, 1k) */
  1062. printk(KERN_INFO "mpf new: %x\n", 0x400 - 16);
  1063. mpf_new = phys_to_virt(0x400 - 16);
  1064. memcpy(mpf_new, mpf, 16);
  1065. mpf = mpf_new;
  1066. mpf->mpf_physptr = mpc_new_phys;
  1067. }
  1068. mpf->mpf_checksum = 0;
  1069. mpf->mpf_checksum -= mpf_checksum((unsigned char *)mpf, 16);
  1070. printk(KERN_INFO "mpf_physptr new: %x\n", mpf->mpf_physptr);
  1071. }
  1072. /*
  1073. * only replace the one with mp_INT and
  1074. * MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW,
  1075. * already in mp_irqs , stored by ... and mp_config_acpi_gsi,
  1076. * may need pci=routeirq for all coverage
  1077. */
  1078. replace_intsrc_all(mpc, mpc_new_phys, mpc_new_length);
  1079. return 0;
  1080. }
  1081. late_initcall(update_mp_table);