xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: xen-devel@lists.xen.org
Cc: patches@linaro.org, ian.campbell@citrix.com,
	Julien Grall <julien.grall@linaro.org>,
	stefano.stabellini@eu.citrix.com
Subject: [PATCH v5 1/7] xen/arm: Introduce init_info structure
Date: Thu, 26 Sep 2013 12:09:35 +0100	[thread overview]
Message-ID: <1380193781-17474-2-git-send-email-julien.grall@linaro.org> (raw)
In-Reply-To: <1380193781-17474-1-git-send-email-julien.grall@linaro.org>

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(-)

diff --git a/xen/arch/arm/arm32/asm-offsets.c b/xen/arch/arm/arm32/asm-offsets.c
index 263fff3..ac628c0 100644
--- a/xen/arch/arm/arm32/asm-offsets.c
+++ b/xen/arch/arm/arm32/asm-offsets.c
@@ -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);
+
 }
 
 /*
diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
index 79e95b6..fce18a2 100644
--- a/xen/arch/arm/arm32/head.S
+++ b/xen/arch/arm/arm32/head.S
@@ -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 */
diff --git a/xen/arch/arm/arm64/asm-offsets.c b/xen/arch/arm/arm64/asm-offsets.c
index 2a225b6..d7572fa 100644
--- a/xen/arch/arm/arm64/asm-offsets.c
+++ b/xen/arch/arm/arm64/asm-offsets.c
@@ -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);
 }
 
 /*
diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
index 21b7e4d..e0831b6 100644
--- a/xen/arch/arm/arm64/head.S
+++ b/xen/arch/arm/arm64/head.S
@@ -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 */
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index b6aea63..945f473 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -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. */
diff --git a/xen/include/asm-arm/init.h b/xen/include/asm-arm/init.h
index 237ec25..7a07136 100644
--- a/xen/include/asm-arm/init.h
+++ b/xen/include/asm-arm/init.h
@@ -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:
-- 
1.7.10.4

  reply	other threads:[~2013-09-26 11:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-26 11:09 [PATCH v5 0/7] Dissociate logical and gic/hardware CPU ID Julien Grall
2013-09-26 11:09 ` Julien Grall [this message]
2013-09-26 11:09 ` [PATCH v5 2/7] xen/arm: use cpumask_t to describe cpu mask in gic_route_dt_irq Julien Grall
2013-09-26 11:09 ` [PATCH v5 3/7] xen/arm: Initialize correctly IRQ routing Julien Grall
2013-09-26 11:09 ` [PATCH v5 4/7] xen/arm: gic: Use the correct CPU ID Julien Grall
2013-09-26 11:09 ` [PATCH v5 5/7] xen/arm: Fix assert in send_SGI_one Julien Grall
2013-09-26 11:09 ` [PATCH v5 6/7] xen/arm: Dissociate logical and hardware CPU ID Julien Grall
2013-09-26 11:09 ` [PATCH v5 7/7] xen/arm: Use the hardware ID to boot correctly secondary cpus Julien Grall
2013-09-26 15:09 ` [PATCH v5 0/7] Dissociate logical and gic/hardware CPU ID Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1380193781-17474-2-git-send-email-julien.grall@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=ian.campbell@citrix.com \
    --cc=patches@linaro.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).