]>
Commit | Line | Data |
---|---|---|
00e5a55c BS |
1 | From: Suresh Siddha <suresh.b.siddha@intel.com> |
2 | Subject: x2apic: xen64 paravirt basic apic ops | |
3 | References: fate #303948 and fate #303984 | |
4 | Patch-Mainline: queued for .28 | |
5 | Commit-ID: ad66dd340f561bdde2285992314d9e4fd9b6191e | |
6 | ||
7 | Signed-off-by: Thomas Renninger <trenn@suse.de> | |
8 | ||
9 | Define the Xen specific basic apic ops, in additon to paravirt apic ops, | |
10 | with some misc warning fixes. | |
11 | ||
12 | Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> | |
13 | Cc: Jeremy Fitzhardinge <jeremy@goop.org> | |
14 | Cc: akpm@linux-foundation.org | |
15 | Signed-off-by: Ingo Molnar <mingo@elte.hu> | |
16 | ||
17 | --- | |
18 | arch/x86/lguest/boot.c | 4 ++-- | |
19 | arch/x86/xen/enlighten.c | 41 +++++++++++++++++++++++++++++++++++++++-- | |
20 | include/asm-x86/paravirt.h | 11 ++++++----- | |
21 | 3 files changed, 47 insertions(+), 9 deletions(-) | |
22 | ||
23 | Index: linux-2.6.26/arch/x86/lguest/boot.c | |
24 | =================================================================== | |
25 | --- linux-2.6.26.orig/arch/x86/lguest/boot.c | |
26 | +++ linux-2.6.26/arch/x86/lguest/boot.c | |
27 | @@ -783,11 +783,11 @@ static void lguest_wbinvd(void) | |
28 | * code qualifies for Advanced. It will also never interrupt anything. It | |
29 | * does, however, allow us to get through the Linux boot code. */ | |
30 | #ifdef CONFIG_X86_LOCAL_APIC | |
31 | -static void lguest_apic_write(unsigned long reg, u32 v) | |
32 | +static void lguest_apic_write(u32 reg, u32 v) | |
33 | { | |
34 | } | |
35 | ||
36 | -static u32 lguest_apic_read(unsigned long reg) | |
37 | +static u32 lguest_apic_read(u32 reg) | |
38 | { | |
39 | return 0; | |
40 | } | |
41 | Index: linux-2.6.26/arch/x86/xen/enlighten.c | |
42 | =================================================================== | |
43 | --- linux-2.6.26.orig/arch/x86/xen/enlighten.c | |
44 | +++ linux-2.6.26/arch/x86/xen/enlighten.c | |
45 | @@ -580,16 +580,45 @@ static void xen_io_delay(void) | |
46 | } | |
47 | ||
48 | #ifdef CONFIG_X86_LOCAL_APIC | |
49 | -static u32 xen_apic_read(unsigned long reg) | |
50 | +static u32 xen_apic_read(u32 reg) | |
51 | { | |
52 | return 0; | |
53 | } | |
54 | ||
55 | -static void xen_apic_write(unsigned long reg, u32 val) | |
56 | +static void xen_apic_write(u32 reg, u32 val) | |
57 | { | |
58 | /* Warn to see if there's any stray references */ | |
59 | WARN_ON(1); | |
60 | } | |
61 | + | |
62 | +#ifdef CONFIG_X86_64 | |
63 | +static u64 xen_apic_icr_read(void) | |
64 | +{ | |
65 | + return 0; | |
66 | +} | |
67 | + | |
68 | +static void xen_apic_icr_write(u32 low, u32 id) | |
69 | +{ | |
70 | + /* Warn to see if there's any stray references */ | |
71 | + WARN_ON(1); | |
72 | +} | |
73 | + | |
74 | +static void xen_apic_wait_icr_idle(void) | |
75 | +{ | |
76 | + return; | |
77 | +} | |
78 | + | |
79 | +static struct apic_ops xen_basic_apic_ops = { | |
80 | + .read = xen_apic_read, | |
81 | + .write = xen_apic_write, | |
82 | + .write_atomic = xen_apic_write, | |
83 | + .icr_read = xen_apic_icr_read, | |
84 | + .icr_write = xen_apic_icr_write, | |
85 | + .wait_icr_idle = xen_apic_wait_icr_idle, | |
86 | + .safe_wait_icr_idle = xen_apic_wait_icr_idle, | |
87 | +}; | |
88 | +#endif | |
89 | + | |
90 | #endif | |
91 | ||
92 | static void xen_flush_tlb(void) | |
93 | @@ -1273,8 +1302,10 @@ static const struct pv_irq_ops xen_irq_o | |
94 | ||
95 | static const struct pv_apic_ops xen_apic_ops __initdata = { | |
96 | #ifdef CONFIG_X86_LOCAL_APIC | |
97 | +#ifndef CONFIG_X86_64 | |
98 | .apic_write = xen_apic_write, | |
99 | .apic_read = xen_apic_read, | |
100 | +#endif | |
101 | .setup_boot_clock = paravirt_nop, | |
102 | .setup_secondary_clock = paravirt_nop, | |
103 | .startup_ipi_hook = paravirt_nop, | |
104 | @@ -1676,6 +1707,12 @@ asmlinkage void __init xen_start_kernel( | |
105 | pv_irq_ops = xen_irq_ops; | |
106 | pv_apic_ops = xen_apic_ops; | |
107 | pv_mmu_ops = xen_mmu_ops; | |
108 | +#ifdef CONFIG_X86_64 | |
109 | + /* | |
110 | + * for 64bit, set up the basic apic ops aswell. | |
111 | + */ | |
112 | + apic_ops = &xen_basic_apic_ops; | |
113 | +#endif | |
114 | ||
115 | if (xen_feature(XENFEAT_mmu_pt_update_preserve_ad)) { | |
116 | pv_mmu_ops.ptep_modify_prot_start = xen_ptep_modify_prot_start; | |
117 | Index: linux-2.6.26/include/asm-x86/paravirt.h | |
118 | =================================================================== | |
119 | --- linux-2.6.26.orig/include/asm-x86/paravirt.h | |
120 | +++ linux-2.6.26/include/asm-x86/paravirt.h | |
121 | @@ -200,15 +200,16 @@ struct pv_irq_ops { | |
122 | ||
123 | struct pv_apic_ops { | |
124 | #ifdef CONFIG_X86_LOCAL_APIC | |
125 | +#ifndef CONFIG_X86_64 | |
126 | /* | |
127 | * Direct APIC operations, principally for VMI. Ideally | |
128 | * these shouldn't be in this interface. | |
129 | */ | |
130 | - void (*apic_write)(unsigned long reg, u32 v); | |
131 | - u32 (*apic_read)(unsigned long reg); | |
132 | + void (*apic_write)(u32 reg, u32 v); | |
133 | + u32 (*apic_read)(u32 reg); | |
134 | +#endif | |
135 | void (*setup_boot_clock)(void); | |
136 | void (*setup_secondary_clock)(void); | |
137 | - | |
138 | void (*startup_ipi_hook)(int phys_apicid, | |
139 | unsigned long start_eip, | |
140 | unsigned long start_esp); | |
141 | @@ -902,12 +903,12 @@ static inline void slow_down_io(void) | |
142 | * Basic functions accessing APICs. | |
143 | */ | |
144 | #ifndef CONFIG_X86_64 | |
145 | -static inline void apic_write(unsigned long reg, u32 v) | |
146 | +static inline void apic_write(u32 reg, u32 v) | |
147 | { | |
148 | PVOP_VCALL2(pv_apic_ops.apic_write, reg, v); | |
149 | } | |
150 | ||
151 | -static inline u32 apic_read(unsigned long reg) | |
152 | +static inline u32 apic_read(u32 reg) | |
153 | { | |
154 | return PVOP_CALL1(unsigned long, pv_apic_ops.apic_read, reg); | |
155 | } |