summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2019-10-29 05:34:19 -0400
committerThomas Gleixner <tglx@linutronix.de>2019-11-04 18:11:00 -0500
commitfe6f85ca121e9c74e7490fe66b0c5aae38e332c3 (patch)
treecedf43e69f3ae3ae5af7c4ff5682998533dfd103
parent26467b0f8407cbd628fa5b7bcfd156e772004155 (diff)
x86/apic/32: Avoid bogus LDR warnings
The removal of the LDR initialization in the bigsmp_32 APIC code unearthed a problem in setup_local_APIC(). The code checks unconditionally for a mismatch of the logical APIC id by comparing the early APIC id which was initialized in get_smp_config() with the actual LDR value in the APIC. Due to the removal of the bogus LDR initialization the check now can trigger on bigsmp_32 APIC systems emitting a warning for every booting CPU. This is of course a false positive because the APIC is not using logical destination mode. Restrict the check and the possibly resulting fixup to systems which are actually using the APIC in logical destination mode. [ tglx: Massaged changelog and added Cc stable ] Fixes: bae3a8d3308 ("x86/apic: Do not initialize LDR and DFR for bigsmp") Signed-off-by: Jan Beulich <jbeulich@suse.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/666d8f91-b5a8-1afd-7add-821e72a35f03@suse.com
-rw-r--r--arch/x86/kernel/apic/apic.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 9e2dd2b296cd..2b0faf86da1b 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1586,9 +1586,6 @@ static void setup_local_APIC(void)
1586{ 1586{
1587 int cpu = smp_processor_id(); 1587 int cpu = smp_processor_id();
1588 unsigned int value; 1588 unsigned int value;
1589#ifdef CONFIG_X86_32
1590 int logical_apicid, ldr_apicid;
1591#endif
1592 1589
1593 if (disable_apic) { 1590 if (disable_apic) {
1594 disable_ioapic_support(); 1591 disable_ioapic_support();
@@ -1626,16 +1623,21 @@ static void setup_local_APIC(void)
1626 apic->init_apic_ldr(); 1623 apic->init_apic_ldr();
1627 1624
1628#ifdef CONFIG_X86_32 1625#ifdef CONFIG_X86_32
1629 /* 1626 if (apic->dest_logical) {
1630 * APIC LDR is initialized. If logical_apicid mapping was 1627 int logical_apicid, ldr_apicid;
1631 * initialized during get_smp_config(), make sure it matches the 1628
1632 * actual value. 1629 /*
1633 */ 1630 * APIC LDR is initialized. If logical_apicid mapping was
1634 logical_apicid = early_per_cpu(x86_cpu_to_logical_apicid, cpu); 1631 * initialized during get_smp_config(), make sure it matches
1635 ldr_apicid = GET_APIC_LOGICAL_ID(apic_read(APIC_LDR)); 1632 * the actual value.
1636 WARN_ON(logical_apicid != BAD_APICID && logical_apicid != ldr_apicid); 1633 */
1637 /* always use the value from LDR */ 1634 logical_apicid = early_per_cpu(x86_cpu_to_logical_apicid, cpu);
1638 early_per_cpu(x86_cpu_to_logical_apicid, cpu) = ldr_apicid; 1635 ldr_apicid = GET_APIC_LOGICAL_ID(apic_read(APIC_LDR));
1636 if (logical_apicid != BAD_APICID)
1637 WARN_ON(logical_apicid != ldr_apicid);
1638 /* Always use the value from LDR. */
1639 early_per_cpu(x86_cpu_to_logical_apicid, cpu) = ldr_apicid;
1640 }
1639#endif 1641#endif
1640 1642
1641 /* 1643 /*