diff options
author | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2013-05-08 07:59:01 -0400 |
---|---|---|
committer | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2013-05-13 12:14:25 -0400 |
commit | 3cc8e40e8ff8e232a9dd672da81beabd09f87366 (patch) | |
tree | 821a167f2c7b2f0c3414fddda725b48dcd4a7bcb /arch/arm/xen | |
parent | d7266d7894b111dee9b081c05944533bc8780eca (diff) |
xen/arm: rename xen_secondary_init and run it on every online cpu
Rename xen_secondary_init to xen_percpu_init.
Run xen_percpu_init on the each online cpu, reuse the current on_each_cpu call.
Merge xen_percpu_enable_events into xen_percpu_init.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Diffstat (limited to 'arch/arm/xen')
-rw-r--r-- | arch/arm/xen/enlighten.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c index 3dfa2b5c787d..13609e01f4b7 100644 --- a/arch/arm/xen/enlighten.c +++ b/arch/arm/xen/enlighten.c | |||
@@ -152,11 +152,12 @@ int xen_unmap_domain_mfn_range(struct vm_area_struct *vma, | |||
152 | } | 152 | } |
153 | EXPORT_SYMBOL_GPL(xen_unmap_domain_mfn_range); | 153 | EXPORT_SYMBOL_GPL(xen_unmap_domain_mfn_range); |
154 | 154 | ||
155 | static int __init xen_secondary_init(unsigned int cpu) | 155 | static void __init xen_percpu_init(void *unused) |
156 | { | 156 | { |
157 | struct vcpu_register_vcpu_info info; | 157 | struct vcpu_register_vcpu_info info; |
158 | struct vcpu_info *vcpup; | 158 | struct vcpu_info *vcpup; |
159 | int err; | 159 | int err; |
160 | int cpu = get_cpu(); | ||
160 | 161 | ||
161 | pr_info("Xen: initializing cpu%d\n", cpu); | 162 | pr_info("Xen: initializing cpu%d\n", cpu); |
162 | vcpup = per_cpu_ptr(xen_vcpu_info, cpu); | 163 | vcpup = per_cpu_ptr(xen_vcpu_info, cpu); |
@@ -168,7 +169,7 @@ static int __init xen_secondary_init(unsigned int cpu) | |||
168 | BUG_ON(err); | 169 | BUG_ON(err); |
169 | per_cpu(xen_vcpu, cpu) = vcpup; | 170 | per_cpu(xen_vcpu, cpu) = vcpup; |
170 | 171 | ||
171 | return 0; | 172 | enable_percpu_irq(xen_events_irq, 0); |
172 | } | 173 | } |
173 | 174 | ||
174 | static void xen_restart(char str, const char *cmd) | 175 | static void xen_restart(char str, const char *cmd) |
@@ -204,7 +205,6 @@ static int __init xen_guest_init(void) | |||
204 | const char *version = NULL; | 205 | const char *version = NULL; |
205 | const char *xen_prefix = "xen,xen-"; | 206 | const char *xen_prefix = "xen,xen-"; |
206 | struct resource res; | 207 | struct resource res; |
207 | int i; | ||
208 | 208 | ||
209 | node = of_find_compatible_node(NULL, NULL, "xen,xen"); | 209 | node = of_find_compatible_node(NULL, NULL, "xen,xen"); |
210 | if (!node) { | 210 | if (!node) { |
@@ -261,8 +261,6 @@ static int __init xen_guest_init(void) | |||
261 | sizeof(struct vcpu_info)); | 261 | sizeof(struct vcpu_info)); |
262 | if (xen_vcpu_info == NULL) | 262 | if (xen_vcpu_info == NULL) |
263 | return -ENOMEM; | 263 | return -ENOMEM; |
264 | for_each_online_cpu(i) | ||
265 | xen_secondary_init(i); | ||
266 | 264 | ||
267 | gnttab_init(); | 265 | gnttab_init(); |
268 | if (!xen_initial_domain()) | 266 | if (!xen_initial_domain()) |
@@ -287,11 +285,6 @@ static irqreturn_t xen_arm_callback(int irq, void *arg) | |||
287 | return IRQ_HANDLED; | 285 | return IRQ_HANDLED; |
288 | } | 286 | } |
289 | 287 | ||
290 | static __init void xen_percpu_enable_events(void *unused) | ||
291 | { | ||
292 | enable_percpu_irq(xen_events_irq, 0); | ||
293 | } | ||
294 | |||
295 | static int __init xen_init_events(void) | 288 | static int __init xen_init_events(void) |
296 | { | 289 | { |
297 | if (!xen_domain() || xen_events_irq < 0) | 290 | if (!xen_domain() || xen_events_irq < 0) |
@@ -305,7 +298,7 @@ static int __init xen_init_events(void) | |||
305 | return -EINVAL; | 298 | return -EINVAL; |
306 | } | 299 | } |
307 | 300 | ||
308 | on_each_cpu(xen_percpu_enable_events, NULL, 0); | 301 | on_each_cpu(xen_percpu_init, NULL, 0); |
309 | 302 | ||
310 | return 0; | 303 | return 0; |
311 | } | 304 | } |