* [PATCH 4.4] x86/apic/32: Avoid bogus LDR warnings
@ 2019-12-06 13:40 Richard Narron
2019-12-06 14:05 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Richard Narron @ 2019-12-06 13:40 UTC (permalink / raw)
To: jbeulich, tglx; +Cc: stable
This patch fixes my bug in 4.4.206:
https://bugzilla.kernel.org/show_bug.cgi?id=205729
It could use testing by someone who exercises the code in a virtual
machine environment...
-----------------------------------------------------------------------------------
From: Jan Beulich <jbeulich@suse.com>
[ Upstream commit fe6f85ca121e9c74e7490fe66b0c5aae38e332c3 ]
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
[ comet.berkeley: Backported to 4.4: adjust context ]
Signed-off-by: Richard Narron <comet.berkeley@gmail.com>
--- a/arch/x86/kernel/apic/apic.c.orig 2019-11-29 00:30:25.000000000 -0800
+++ b/arch/x86/kernel/apic/apic.c 2019-12-04 07:47:16.913136344 -0800
@@ -1298,16 +1298,21 @@ void setup_local_APIC(void)
apic->init_apic_ldr();
#ifdef CONFIG_X86_32
- /*
- * APIC LDR is initialized. If logical_apicid mapping was
- * initialized during get_smp_config(), make sure it matches the
- * actual value.
- */
- i = early_per_cpu(x86_cpu_to_logical_apicid, cpu);
- WARN_ON(i != BAD_APICID && i != logical_smp_processor_id());
- /* always use the value from LDR */
- early_per_cpu(x86_cpu_to_logical_apicid, cpu) =
- logical_smp_processor_id();
+ if (apic->dest_logical) {
+ int logical_apicid, ldr_apicid;
+
+ /*
+ * APIC LDR is initialized. If logical_apicid mapping was
+ * initialized during get_smp_config(), make sure it matches
+ * the actual value.
+ */
+ logical_apicid = early_per_cpu(x86_cpu_to_logical_apicid, cpu);
+ ldr_apicid = GET_APIC_LOGICAL_ID(apic_read(APIC_LDR));
+ if (logical_apicid != BAD_APICID)
+ WARN_ON(logical_apicid != ldr_apicid);
+ /* Always use the value from LDR. */
+ early_per_cpu(x86_cpu_to_logical_apicid, cpu) = ldr_apicid;
+ }
#endif
/*
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 4.4] x86/apic/32: Avoid bogus LDR warnings
2019-12-06 13:40 [PATCH 4.4] x86/apic/32: Avoid bogus LDR warnings Richard Narron
@ 2019-12-06 14:05 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2019-12-06 14:05 UTC (permalink / raw)
To: Richard Narron; +Cc: jbeulich, tglx, stable
On Fri, Dec 06, 2019 at 05:40:10AM -0800, Richard Narron wrote:
> This patch fixes my bug in 4.4.206:
>
> https://bugzilla.kernel.org/show_bug.cgi?id=205729
>
> It could use testing by someone who exercises the code in a virtual
> machine environment...
Now queued up, thanks.
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-12-06 14:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-06 13:40 [PATCH 4.4] x86/apic/32: Avoid bogus LDR warnings Richard Narron
2019-12-06 14:05 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).