From patchwork Thu Sep 26 11:09:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 20585 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f69.google.com (mail-qa0-f69.google.com [209.85.216.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E736B24687 for ; Thu, 26 Sep 2013 11:10:20 +0000 (UTC) Received: by mail-qa0-f69.google.com with SMTP id cm18sf984772qab.4 for ; Thu, 26 Sep 2013 04:10:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=6rGrlWkSULtrL0C1V6JDlgw094qK4GhkvwUjiIdtdfs=; b=KQ/27qQPZR1uVm+JwVe5KBWVQW2JAI3ewr3neBjy6XMKR5wbl8gottY1FCXjdlVvyP kz4VTQ45UR9FehHOKPIwGmaDeiCtkA3U15fti83sJSPK89NE5BVwj4TURH5EkTqo1qU9 yVzDqd/zHDd5TcSiH+FEkzUJry8D1HNojW65Hoy4sfV/FMvndzvypJy8VUemf9bU145Z pt8AIGi7N/ubYydV8Z9IBPyHx15nhczwemDjvvnjWh5amaXRL+hLKyVG0taCO7vDjsyc OAuEKSGMNlOMxZiDco23SaoU7KkCVIiTSJI1iDGfea/BjxYE3djswqOmIptovbVHwHsQ Xx6g== X-Gm-Message-State: ALoCoQn4BnJlvs6JDtRX7vYEfofaeYotT8B3pd9xIi6qTA7dU85JM6cuJyO45IufWm+xTStVvhYA X-Received: by 10.236.115.198 with SMTP id e46mr53875yhh.33.1380193820552; Thu, 26 Sep 2013 04:10:20 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.0.12 with SMTP id 12ls921581qea.25.gmail; Thu, 26 Sep 2013 04:10:20 -0700 (PDT) X-Received: by 10.52.172.68 with SMTP id ba4mr127552vdc.66.1380193820439; Thu, 26 Sep 2013 04:10:20 -0700 (PDT) Received: from mail-vb0-f42.google.com (mail-vb0-f42.google.com [209.85.212.42]) by mx.google.com with ESMTPS id bp7si249969vcb.82.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 26 Sep 2013 04:10:20 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.42 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.42; Received: by mail-vb0-f42.google.com with SMTP id e12so729919vbg.1 for ; Thu, 26 Sep 2013 04:09:50 -0700 (PDT) X-Received: by 10.52.34.109 with SMTP id y13mr148465vdi.8.1380193790308; Thu, 26 Sep 2013 04:09:50 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp359563vcz; Thu, 26 Sep 2013 04:09:49 -0700 (PDT) X-Received: by 10.180.149.179 with SMTP id ub19mr235104wib.43.1380193789062; Thu, 26 Sep 2013 04:09:49 -0700 (PDT) Received: from mail-we0-f180.google.com (mail-we0-f180.google.com [74.125.82.180]) by mx.google.com with ESMTPS id ib3si410534wjb.48.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 26 Sep 2013 04:09:49 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.180 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=74.125.82.180; Received: by mail-we0-f180.google.com with SMTP id u57so948373wes.39 for ; Thu, 26 Sep 2013 04:09:48 -0700 (PDT) X-Received: by 10.180.12.4 with SMTP id u4mr27152985wib.29.1380193788522; Thu, 26 Sep 2013 04:09:48 -0700 (PDT) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id q5sm2409641wiz.3.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 26 Sep 2013 04:09:48 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Cc: stefano.stabellini@eu.citrix.com, ian.campbell@citrix.com, patches@linaro.org, Julien Grall Subject: [PATCH v5 1/7] xen/arm: Introduce init_info structure Date: Thu, 26 Sep 2013 12:09:35 +0100 Message-Id: <1380193781-17474-2-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1380193781-17474-1-git-send-email-julien.grall@linaro.org> References: <1380193781-17474-1-git-send-email-julien.grall@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.42 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This structure will gather all information to boot a secondary cpus. For now it just contains the initial stack. Signed-off-by: Julien Grall --- 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: