]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.arch/x2APIC_PATCH_09_94a8c3c2437c8946f1b6c8e0b2c560a7db8ed3c6
Fix oinkmaster patch.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.arch / x2APIC_PATCH_09_94a8c3c2437c8946f1b6c8e0b2c560a7db8ed3c6
CommitLineData
2cb7cef9
BS
1From: Yinghai Lu <yhlu.kernel@gmail.com>
2Subject: x86: let 32bit use apic_ops too - fix
3References: fate #303948 and fate #303984
4Patch-Mainline: queued for .28
5Commit-ID: 94a8c3c2437c8946f1b6c8e0b2c560a7db8ed3c6
6
7Signed-off-by: Thomas Renninger <trenn@suse.de>
8
9fix for pv - clean up the namespace there too.
10
11Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
12Cc: Suresh Siddha <suresh.b.siddha@intel.com>
13Signed-off-by: Ingo Molnar <mingo@elte.hu>
14
15---
16 arch/x86/kernel/paravirt.c | 4 ---
17 arch/x86/kernel/vmi_32.c | 47 +++++++++++++++++++++++++++++++++++++++++++--
18 arch/x86/xen/enlighten.c | 18 ++++++++---------
19 include/asm-x86/paravirt.h | 23 ----------------------
20 4 files changed, 54 insertions(+), 38 deletions(-)
21
22--- a/arch/x86/kernel/paravirt.c
23+++ b/arch/x86/kernel/paravirt.c
24@@ -373,10 +373,6 @@ struct pv_cpu_ops pv_cpu_ops = {
25
26 struct pv_apic_ops pv_apic_ops = {
27 #ifdef CONFIG_X86_LOCAL_APIC
28-#ifndef CONFIG_X86_64
29- .apic_write = native_apic_mem_write,
30- .apic_read = native_apic_mem_read,
31-#endif
32 .setup_boot_clock = setup_boot_APIC_clock,
33 .setup_secondary_clock = setup_secondary_APIC_clock,
34 .startup_ipi_hook = paravirt_nop,
35--- a/arch/x86/kernel/vmi_32.c
36+++ b/arch/x86/kernel/vmi_32.c
37@@ -687,6 +687,49 @@ static inline int __init probe_vmi_rom(v
38 return 0;
39 }
40
41+#ifdef CONFIG_X86_LOCAL_APIC
42+static u32 vmi_apic_read(u32 reg)
43+{
44+ return 0;
45+}
46+
47+static void vmi_apic_write(u32 reg, u32 val)
48+{
49+ /* Warn to see if there's any stray references */
50+ WARN_ON(1);
51+}
52+
53+static u64 vmi_apic_icr_read(void)
54+{
55+ return 0;
56+}
57+
58+static void vmi_apic_icr_write(u32 low, u32 id)
59+{
60+ /* Warn to see if there's any stray references */
61+ WARN_ON(1);
62+}
63+
64+static void vmi_apic_wait_icr_idle(void)
65+{
66+ return;
67+}
68+
69+static u32 vmi_safe_apic_wait_icr_idle(void)
70+{
71+ return 0;
72+}
73+
74+static struct apic_ops vmi_basic_apic_ops = {
75+ .read = vmi_apic_read,
76+ .write = vmi_apic_write,
77+ .icr_read = vmi_apic_icr_read,
78+ .icr_write = vmi_apic_icr_write,
79+ .wait_icr_idle = vmi_apic_wait_icr_idle,
80+ .safe_wait_icr_idle = vmi_safe_apic_wait_icr_idle,
81+};
82+#endif
83+
84 /*
85 * VMI setup common to all processors
86 */
87@@ -916,8 +959,8 @@ static inline int __init activate_vmi(vo
88 #endif
89
90 #ifdef CONFIG_X86_LOCAL_APIC
91- para_fill(pv_apic_ops.apic_read, APICRead);
92- para_fill(pv_apic_ops.apic_write, APICWrite);
93+ para_fill(vmi_basic_apic_ops.read, APICRead);
94+ para_fill(vmi_basic_apic_ops.write, APICWrite);
95 #endif
96
97 /*
98--- a/arch/x86/xen/enlighten.c
99+++ b/arch/x86/xen/enlighten.c
100@@ -592,7 +592,6 @@ static void xen_apic_write(u32 reg, u32
101 WARN_ON(1);
102 }
103
104-#ifdef CONFIG_X86_64
105 static u64 xen_apic_icr_read(void)
106 {
107 return 0;
108@@ -609,6 +608,11 @@ static void xen_apic_wait_icr_idle(void)
109 return;
110 }
111
112+static u32 xen_safe_apic_wait_icr_idle(void)
113+{
114+ return 0;
115+}
116+
117 static struct apic_ops xen_basic_apic_ops = {
118 .read = xen_apic_read,
119 .write = xen_apic_write,
120@@ -616,9 +620,8 @@ static struct apic_ops xen_basic_apic_op
121 .icr_read = xen_apic_icr_read,
122 .icr_write = xen_apic_icr_write,
123 .wait_icr_idle = xen_apic_wait_icr_idle,
124- .safe_wait_icr_idle = xen_apic_wait_icr_idle,
125+ .safe_wait_icr_idle = xen_safe_apic_wait_icr_idle,
126 };
127-#endif
128
129 #endif
130
131@@ -1303,10 +1306,6 @@ static const struct pv_irq_ops xen_irq_o
132
133 static const struct pv_apic_ops xen_apic_ops __initdata = {
134 #ifdef CONFIG_X86_LOCAL_APIC
135-#ifndef CONFIG_X86_64
136- .apic_write = xen_apic_write,
137- .apic_read = xen_apic_read,
138-#endif
139 .setup_boot_clock = paravirt_nop,
140 .setup_secondary_clock = paravirt_nop,
141 .startup_ipi_hook = paravirt_nop,
142@@ -1708,9 +1707,10 @@ asmlinkage void __init xen_start_kernel(
143 pv_irq_ops = xen_irq_ops;
144 pv_apic_ops = xen_apic_ops;
145 pv_mmu_ops = xen_mmu_ops;
146-#ifdef CONFIG_X86_64
147+
148+#ifdef CONFIG_X86_LOCAL_APIC
149 /*
150- * for 64bit, set up the basic apic ops aswell.
151+ * set up the basic apic ops.
152 */
153 apic_ops = &xen_basic_apic_ops;
154 #endif
155--- a/include/asm-x86/paravirt.h
156+++ b/include/asm-x86/paravirt.h
157@@ -200,14 +200,6 @@ struct pv_irq_ops {
158
159 struct pv_apic_ops {
160 #ifdef CONFIG_X86_LOCAL_APIC
161-#ifndef CONFIG_X86_64
162- /*
163- * Direct APIC operations, principally for VMI. Ideally
164- * these shouldn't be in this interface.
165- */
166- void (*apic_write)(u32 reg, u32 v);
167- u32 (*apic_read)(u32 reg);
168-#endif
169 void (*setup_boot_clock)(void);
170 void (*setup_secondary_clock)(void);
171 void (*startup_ipi_hook)(int phys_apicid,
172@@ -899,21 +891,6 @@ static inline void slow_down_io(void)
173 }
174
175 #ifdef CONFIG_X86_LOCAL_APIC
176-/*
177- * Basic functions accessing APICs.
178- */
179-#ifndef CONFIG_X86_64
180-static inline void apic_write(u32 reg, u32 v)
181-{
182- PVOP_VCALL2(pv_apic_ops.apic_write, reg, v);
183-}
184-
185-static inline u32 apic_read(u32 reg)
186-{
187- return PVOP_CALL1(unsigned long, pv_apic_ops.apic_read, reg);
188-}
189-#endif
190-
191 static inline void setup_boot_clock(void)
192 {
193 PVOP_VCALL0(pv_apic_ops.setup_boot_clock);