@@ -69,6 +69,10 @@ void __dummy__(void)
OFFSET(PROCINFO_cpu_val, struct proc_info_list, cpu_val);
OFFSET(PROCINFO_cpu_mask, struct proc_info_list, cpu_mask);
OFFSET(PROCINFO_cpu_init, struct proc_info_list, cpu_init);
+
+ BLANK();
+ OFFSET(INITINFO_stack, struct init_info, stack);
+
}
/*
@@ -366,7 +366,8 @@ paging:
bne 1b
launch:
- ldr r0, =init_stack /* Find the boot-time stack */
+ ldr r0, =init_data
+ add r0, #INITINFO_stack /* Find the boot-time stack */
ldr sp, [r0]
add sp, #STACK_SIZE /* (which grows down from the top). */
sub sp, #CPUINFO_sizeof /* Make room for CPU save record */
@@ -46,6 +46,9 @@ void __dummy__(void)
DEFINE(CPUINFO_sizeof, sizeof(struct cpu_info));
OFFSET(VCPU_arch_saved_context, struct vcpu, arch.saved_context);
+
+ BLANK();
+ OFFSET(INITINFO_stack, struct init_info, stack);
}
/*
@@ -313,7 +313,8 @@ paging:
b.ne 1b
launch:
- ldr x0, =init_stack /* Find the boot-time stack */
+ ldr x0, =init_data
+ add x0, x0, #INITINFO_stack /* Find the boot-time stack */
ldr x0, [x0]
add x0, x0, #STACK_SIZE /* (which grows down from the top). */
sub x0, x0, #CPUINFO_sizeof /* Make room for CPU save record */
@@ -46,8 +46,11 @@ nodemask_t __read_mostly node_online_map = { { [0] = 1UL } };
static unsigned char __initdata cpu0_boot_stack[STACK_SIZE]
__attribute__((__aligned__(STACK_SIZE)));
-/* Pointer to the stack, used by head.S when entering C */
-unsigned char *init_stack = cpu0_boot_stack;
+/* Initial boot cpu data */
+struct init_info __initdata init_data =
+{
+ .stack = cpu0_boot_stack,
+};
/* Shared state for coordinating CPU bringup */
unsigned long smp_up_cpu = 0;
@@ -224,7 +227,7 @@ int __cpu_up(unsigned int cpu)
return rc;
/* Tell the remote CPU which stack to boot on. */
- init_stack = idle_vcpu[cpu]->arch.stack;
+ init_data.stack = idle_vcpu[cpu]->arch.stack;
/* Unblock the CPU. It should be waiting in the loop in head.S
* for an event to arrive when smp_up_cpu matches its cpuid. */
@@ -1,6 +1,12 @@
#ifndef _XEN_ASM_INIT_H
#define _XEN_ASM_INIT_H
+struct init_info
+{
+ /* Pointer to the stack, used by head.S when entering in C */
+ unsigned char *stack;
+};
+
#endif /* _XEN_ASM_INIT_H */
/*
* Local variables:
This structure will gather all information to boot a secondary cpus. For now it just contains the initial stack. Signed-off-by: Julien Grall <julien.grall@linaro.org> --- xen/arch/arm/arm32/asm-offsets.c | 4 ++++ xen/arch/arm/arm32/head.S | 3 ++- xen/arch/arm/arm64/asm-offsets.c | 3 +++ xen/arch/arm/arm64/head.S | 3 ++- xen/arch/arm/smpboot.c | 9 ++++++--- xen/include/asm-arm/init.h | 6 ++++++ 6 files changed, 23 insertions(+), 5 deletions(-)