]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.1.1/apic-i386-bigsmp-fix-false-warnings-regarding-logical-apic-id-mismatches.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.1.1 / apic-i386-bigsmp-fix-false-warnings-regarding-logical-apic-id-mismatches.patch
1 From 838312be46f3abfbdc175f81c3e54a857994476d Mon Sep 17 00:00:00 2001
2 From: Jan Beulich <JBeulich@suse.com>
3 Date: Wed, 28 Sep 2011 16:44:54 +0100
4 Subject: apic, i386/bigsmp: Fix false warnings regarding logical APIC ID mismatches
5
6 From: Jan Beulich <JBeulich@suse.com>
7
8 commit 838312be46f3abfbdc175f81c3e54a857994476d upstream.
9
10 These warnings (generally one per CPU) are a result of
11 initializing x86_cpu_to_logical_apicid while apic_default is
12 still in use, but the check in setup_local_APIC() being done
13 when apic_bigsmp was already used as an override in
14 default_setup_apic_routing():
15
16 Overriding APIC driver with bigsmp
17 Enabling APIC mode: Physflat. Using 5 I/O APICs
18 ------------[ cut here ]------------
19 WARNING: at .../arch/x86/kernel/apic/apic.c:1239
20 ...
21 CPU 1 irqstacks, hard=f1c9a000 soft=f1c9c000
22 Booting Node 0, Processors #1
23 smpboot cpu 1: start_ip = 9e000
24 Initializing CPU#1
25 ------------[ cut here ]------------
26 WARNING: at .../arch/x86/kernel/apic/apic.c:1239
27 setup_local_APIC+0x137/0x46b() Hardware name: ...
28 CPU1 logical APIC ID: 2 != 8
29 ...
30
31 Fix this (for the time being, i.e. until
32 x86_32_early_logical_apicid() will get removed again, as Tejun
33 says ought to be possible) by overriding the previously stored
34 values at the point where the APIC driver gets overridden.
35
36 v2: Move this and the pre-existing override logic into
37 arch/x86/kernel/apic/bigsmp_32.c.
38
39 Signed-off-by: Jan Beulich <jbeulich@suse.com>
40 Acked-by: Tejun Heo <tj@kernel.org>
41 Link: http://lkml.kernel.org/r/4E835D16020000780005844C@nat28.tlf.novell.com
42 Signed-off-by: Ingo Molnar <mingo@elte.hu>
43 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
44
45 ---
46 arch/x86/include/asm/apic.h | 2 +-
47 arch/x86/kernel/apic/bigsmp_32.c | 20 ++++++++++++++++----
48 arch/x86/kernel/apic/probe_32.c | 10 ++--------
49 3 files changed, 19 insertions(+), 13 deletions(-)
50
51 --- a/arch/x86/include/asm/apic.h
52 +++ b/arch/x86/include/asm/apic.h
53 @@ -495,7 +495,7 @@ static inline void default_wait_for_init
54 return;
55 }
56
57 -extern struct apic *generic_bigsmp_probe(void);
58 +extern void generic_bigsmp_probe(void);
59
60
61 #ifdef CONFIG_X86_LOCAL_APIC
62 --- a/arch/x86/kernel/apic/bigsmp_32.c
63 +++ b/arch/x86/kernel/apic/bigsmp_32.c
64 @@ -255,12 +255,24 @@ static struct apic apic_bigsmp = {
65 .x86_32_early_logical_apicid = bigsmp_early_logical_apicid,
66 };
67
68 -struct apic * __init generic_bigsmp_probe(void)
69 +void __init generic_bigsmp_probe(void)
70 {
71 - if (probe_bigsmp())
72 - return &apic_bigsmp;
73 + unsigned int cpu;
74
75 - return NULL;
76 + if (!probe_bigsmp())
77 + return;
78 +
79 + apic = &apic_bigsmp;
80 +
81 + for_each_possible_cpu(cpu) {
82 + if (early_per_cpu(x86_cpu_to_logical_apicid,
83 + cpu) == BAD_APICID)
84 + continue;
85 + early_per_cpu(x86_cpu_to_logical_apicid, cpu) =
86 + bigsmp_early_logical_apicid(cpu);
87 + }
88 +
89 + pr_info("Overriding APIC driver with %s\n", apic_bigsmp.name);
90 }
91
92 apic_driver(apic_bigsmp);
93 --- a/arch/x86/kernel/apic/probe_32.c
94 +++ b/arch/x86/kernel/apic/probe_32.c
95 @@ -200,14 +200,8 @@ void __init default_setup_apic_routing(v
96 * - we find more than 8 CPUs in acpi LAPIC listing with xAPIC support
97 */
98
99 - if (!cmdline_apic && apic == &apic_default) {
100 - struct apic *bigsmp = generic_bigsmp_probe();
101 - if (bigsmp) {
102 - apic = bigsmp;
103 - printk(KERN_INFO "Overriding APIC driver with %s\n",
104 - apic->name);
105 - }
106 - }
107 + if (!cmdline_apic && apic == &apic_default)
108 + generic_bigsmp_probe();
109 #endif
110
111 if (apic->setup_apic_routing)