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.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 4261b3282ad9..aee7deddabd0 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1610,24 +1610,15 @@ static inline void try_to_enable_x2apic(int remap_mode) { }
1610static inline void __x2apic_enable(void) { } 1610static inline void __x2apic_enable(void) { }
1611#endif /* !CONFIG_X86_X2APIC */ 1611#endif /* !CONFIG_X86_X2APIC */
1612 1612
1613static int __init try_to_enable_IR(void)
1614{
1615#ifdef CONFIG_X86_IO_APIC
1616 if (!x2apic_enabled() && skip_ioapic_setup) {
1617 pr_info("Not enabling interrupt remapping due to skipped IO-APIC setup\n");
1618 return -1;
1619 }
1620#endif
1621 return irq_remapping_enable();
1622}
1623
1624void __init enable_IR_x2apic(void) 1613void __init enable_IR_x2apic(void)
1625{ 1614{
1626 unsigned long flags; 1615 unsigned long flags;
1627 int ret, ir_stat; 1616 int ret, ir_stat;
1628 1617
1629 if (skip_ioapic_setup) 1618 if (skip_ioapic_setup) {
1619 pr_info("Not enabling interrupt remapping due to skipped IO-APIC setup\n");
1630 return; 1620 return;
1621 }
1631 1622
1632 ir_stat = irq_remapping_prepare(); 1623 ir_stat = irq_remapping_prepare();
1633 if (ir_stat < 0 && !x2apic_supported()) 1624 if (ir_stat < 0 && !x2apic_supported())
@@ -1645,7 +1636,7 @@ void __init enable_IR_x2apic(void)
1645 1636
1646 /* If irq_remapping_prepare() succeeded, try to enable it */ 1637 /* If irq_remapping_prepare() succeeded, try to enable it */
1647 if (ir_stat >= 0) 1638 if (ir_stat >= 0)
1648 ir_stat = try_to_enable_IR(); 1639 ir_stat = irq_remapping_enable();
1649 /* ir_stat contains the remap mode or an error code */ 1640 /* ir_stat contains the remap mode or an error code */
1650 try_to_enable_x2apic(ir_stat); 1641 try_to_enable_x2apic(ir_stat);
1651 1642
@@ -2062,10 +2053,10 @@ static int allocate_logical_cpuid(int apicid)
2062 2053
2063 /* Allocate a new cpuid. */ 2054 /* Allocate a new cpuid. */
2064 if (nr_logical_cpuids >= nr_cpu_ids) { 2055 if (nr_logical_cpuids >= nr_cpu_ids) {
2065 WARN_ONCE(1, "Only %d processors supported." 2056 WARN_ONCE(1, "APIC: NR_CPUS/possible_cpus limit of %i reached. "
2066 "Processor %d/0x%x and the rest are ignored.\n", 2057 "Processor %d/0x%x and the rest are ignored.\n",
2067 nr_cpu_ids - 1, nr_logical_cpuids, apicid); 2058 nr_cpu_ids, nr_logical_cpuids, apicid);
2068 return -1; 2059 return -EINVAL;
2069 } 2060 }
2070 2061
2071 cpuid_to_apicid[nr_logical_cpuids] = apicid; 2062 cpuid_to_apicid[nr_logical_cpuids] = apicid;