forked from Minki/linux
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>
This commit is contained in:
parent
d7266d7894
commit
3cc8e40e8f
@ -152,11 +152,12 @@ int xen_unmap_domain_mfn_range(struct vm_area_struct *vma,
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(xen_unmap_domain_mfn_range);
|
EXPORT_SYMBOL_GPL(xen_unmap_domain_mfn_range);
|
||||||
|
|
||||||
static int __init xen_secondary_init(unsigned int cpu)
|
static void __init xen_percpu_init(void *unused)
|
||||||
{
|
{
|
||||||
struct vcpu_register_vcpu_info info;
|
struct vcpu_register_vcpu_info info;
|
||||||
struct vcpu_info *vcpup;
|
struct vcpu_info *vcpup;
|
||||||
int err;
|
int err;
|
||||||
|
int cpu = get_cpu();
|
||||||
|
|
||||||
pr_info("Xen: initializing cpu%d\n", cpu);
|
pr_info("Xen: initializing cpu%d\n", cpu);
|
||||||
vcpup = per_cpu_ptr(xen_vcpu_info, cpu);
|
vcpup = per_cpu_ptr(xen_vcpu_info, cpu);
|
||||||
@ -168,7 +169,7 @@ static int __init xen_secondary_init(unsigned int cpu)
|
|||||||
BUG_ON(err);
|
BUG_ON(err);
|
||||||
per_cpu(xen_vcpu, cpu) = vcpup;
|
per_cpu(xen_vcpu, cpu) = vcpup;
|
||||||
|
|
||||||
return 0;
|
enable_percpu_irq(xen_events_irq, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void xen_restart(char str, const char *cmd)
|
static void xen_restart(char str, const char *cmd)
|
||||||
@ -204,7 +205,6 @@ static int __init xen_guest_init(void)
|
|||||||
const char *version = NULL;
|
const char *version = NULL;
|
||||||
const char *xen_prefix = "xen,xen-";
|
const char *xen_prefix = "xen,xen-";
|
||||||
struct resource res;
|
struct resource res;
|
||||||
int i;
|
|
||||||
|
|
||||||
node = of_find_compatible_node(NULL, NULL, "xen,xen");
|
node = of_find_compatible_node(NULL, NULL, "xen,xen");
|
||||||
if (!node) {
|
if (!node) {
|
||||||
@ -261,8 +261,6 @@ static int __init xen_guest_init(void)
|
|||||||
sizeof(struct vcpu_info));
|
sizeof(struct vcpu_info));
|
||||||
if (xen_vcpu_info == NULL)
|
if (xen_vcpu_info == NULL)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
for_each_online_cpu(i)
|
|
||||||
xen_secondary_init(i);
|
|
||||||
|
|
||||||
gnttab_init();
|
gnttab_init();
|
||||||
if (!xen_initial_domain())
|
if (!xen_initial_domain())
|
||||||
@ -287,11 +285,6 @@ static irqreturn_t xen_arm_callback(int irq, void *arg)
|
|||||||
return IRQ_HANDLED;
|
return IRQ_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static __init void xen_percpu_enable_events(void *unused)
|
|
||||||
{
|
|
||||||
enable_percpu_irq(xen_events_irq, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int __init xen_init_events(void)
|
static int __init xen_init_events(void)
|
||||||
{
|
{
|
||||||
if (!xen_domain() || xen_events_irq < 0)
|
if (!xen_domain() || xen_events_irq < 0)
|
||||||
@ -305,7 +298,7 @@ static int __init xen_init_events(void)
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
on_each_cpu(xen_percpu_enable_events, NULL, 0);
|
on_each_cpu(xen_percpu_init, NULL, 0);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user