aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/apic/apic.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/apic/apic.c')
-rw-r--r--arch/x86/kernel/apic/apic.c36
1 files changed, 24 insertions, 12 deletions
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 28f747d61d7..07cffc1214c 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -395,7 +395,7 @@ static void __setup_APIC_LVTT(unsigned int clocks, int oneshot, int irqen)
395 395
396static void setup_APIC_eilvt(u8 lvt_off, u8 vector, u8 msg_type, u8 mask) 396static void setup_APIC_eilvt(u8 lvt_off, u8 vector, u8 msg_type, u8 mask)
397{ 397{
398 unsigned long reg = (lvt_off << 4) + APIC_EILVT0; 398 unsigned long reg = (lvt_off << 4) + APIC_EILVTn(0);
399 unsigned int v = (mask << 16) | (msg_type << 8) | vector; 399 unsigned int v = (mask << 16) | (msg_type << 8) | vector;
400 400
401 apic_write(reg, v); 401 apic_write(reg, v);
@@ -1456,7 +1456,6 @@ static int __init detect_init_APIC(void)
1456 } 1456 }
1457 1457
1458 mp_lapic_addr = APIC_DEFAULT_PHYS_BASE; 1458 mp_lapic_addr = APIC_DEFAULT_PHYS_BASE;
1459 boot_cpu_physical_apicid = 0;
1460 return 0; 1459 return 0;
1461} 1460}
1462#else 1461#else
@@ -1570,6 +1569,8 @@ void __init early_init_lapic_mapping(void)
1570 */ 1569 */
1571void __init init_apic_mappings(void) 1570void __init init_apic_mappings(void)
1572{ 1571{
1572 unsigned int new_apicid;
1573
1573 if (x2apic_mode) { 1574 if (x2apic_mode) {
1574 boot_cpu_physical_apicid = read_apic_id(); 1575 boot_cpu_physical_apicid = read_apic_id();
1575 return; 1576 return;
@@ -1586,21 +1587,32 @@ void __init init_apic_mappings(void)
1586 } else 1587 } else
1587 apic_phys = mp_lapic_addr; 1588 apic_phys = mp_lapic_addr;
1588 1589
1589 set_fixmap_nocache(FIX_APIC_BASE, apic_phys);
1590 apic_printk(APIC_VERBOSE, "mapped APIC to %08lx (%08lx)\n",
1591 APIC_BASE, apic_phys);
1592
1593 /* 1590 /*
1594 * Fetch the APIC ID of the BSP in case we have a 1591 * acpi lapic path already maps that address in
1595 * default configuration (or the MP table is broken). 1592 * acpi_register_lapic_address()
1596 */ 1593 */
1597 if (boot_cpu_physical_apicid == -1U) 1594 if (!acpi_lapic)
1598 boot_cpu_physical_apicid = read_apic_id(); 1595 set_fixmap_nocache(FIX_APIC_BASE, apic_phys);
1596
1597 apic_printk(APIC_VERBOSE, "mapped APIC to %08lx (%08lx)\n",
1598 APIC_BASE, apic_phys);
1599 1599
1600 /* lets check if we may to NOP'ify apic operations */ 1600 /* lets check if we may NOP'ify apic operations */
1601 if (!cpu_has_apic) { 1601 if (!cpu_has_apic) {
1602 pr_info("APIC: disable apic facility\n"); 1602 pr_info("APIC: disable apic facility\n");
1603 apic_disable(); 1603 apic_disable();
1604 return;
1605 }
1606
1607 /*
1608 * Fetch the APIC ID of the BSP in case we have a
1609 * default configuration (or the MP table is broken).
1610 */
1611 new_apicid = read_apic_id();
1612 if (boot_cpu_physical_apicid != new_apicid) {
1613 boot_cpu_physical_apicid = new_apicid;
1614 apic_version[new_apicid] =
1615 GET_APIC_VERSION(apic_read(APIC_LVR));
1604 } 1616 }
1605} 1617}
1606 1618
@@ -2191,7 +2203,7 @@ static int __cpuinit set_multi(const struct dmi_system_id *d)
2191{ 2203{
2192 if (multi) 2204 if (multi)
2193 return 0; 2205 return 0;
2194 printk(KERN_INFO "APIC: %s detected, Multi Chassis\n", d->ident); 2206 pr_info("APIC: %s detected, Multi Chassis\n", d->ident);
2195 multi = 1; 2207 multi = 1;
2196 return 0; 2208 return 0;
2197} 2209}