1 From: Yinghai Lu <yhlu.kernel@gmail.com>
2 Subject: x86: let 32bit use apic_ops too - fix
3 References: fate #303948 and fate #303984
4 Patch-Mainline: queued for .28
5 Commit-ID: 94a8c3c2437c8946f1b6c8e0b2c560a7db8ed3c6
7 Signed-off-by: Thomas Renninger <trenn@suse.de>
9 fix for pv - clean up the namespace there too.
11 Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
12 Cc: Suresh Siddha <suresh.b.siddha@intel.com>
13 Signed-off-by: Ingo Molnar <mingo@elte.hu>
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(-)
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 = {
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,
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
41 +#ifdef CONFIG_X86_LOCAL_APIC
42 +static u32 vmi_apic_read(u32 reg)
47 +static void vmi_apic_write(u32 reg, u32 val)
49 + /* Warn to see if there's any stray references */
53 +static u64 vmi_apic_icr_read(void)
58 +static void vmi_apic_icr_write(u32 low, u32 id)
60 + /* Warn to see if there's any stray references */
64 +static void vmi_apic_wait_icr_idle(void)
69 +static u32 vmi_safe_apic_wait_icr_idle(void)
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,
85 * VMI setup common to all processors
87 @@ -916,8 +959,8 @@ static inline int __init activate_vmi(vo
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);
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
104 -#ifdef CONFIG_X86_64
105 static u64 xen_apic_icr_read(void)
108 @@ -609,6 +608,11 @@ static void xen_apic_wait_icr_idle(void)
112 +static u32 xen_safe_apic_wait_icr_idle(void)
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,
131 @@ -1303,10 +1306,6 @@ static const struct pv_irq_ops xen_irq_o
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,
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
148 +#ifdef CONFIG_X86_LOCAL_APIC
150 - * for 64bit, set up the basic apic ops aswell.
151 + * set up the basic apic ops.
153 apic_ops = &xen_basic_apic_ops;
155 --- a/include/asm-x86/paravirt.h
156 +++ b/include/asm-x86/paravirt.h
157 @@ -200,14 +200,6 @@ struct pv_irq_ops {
160 #ifdef CONFIG_X86_LOCAL_APIC
161 -#ifndef CONFIG_X86_64
163 - * Direct APIC operations, principally for VMI. Ideally
164 - * these shouldn't be in this interface.
166 - void (*apic_write)(u32 reg, u32 v);
167 - u32 (*apic_read)(u32 reg);
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)
175 #ifdef CONFIG_X86_LOCAL_APIC
177 - * Basic functions accessing APICs.
179 -#ifndef CONFIG_X86_64
180 -static inline void apic_write(u32 reg, u32 v)
182 - PVOP_VCALL2(pv_apic_ops.apic_write, reg, v);
185 -static inline u32 apic_read(u32 reg)
187 - return PVOP_CALL1(unsigned long, pv_apic_ops.apic_read, reg);
191 static inline void setup_boot_clock(void)
193 PVOP_VCALL0(pv_apic_ops.setup_boot_clock);