From patchwork Mon Sep 26 05:21:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 76990 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp992030qgf; Sun, 25 Sep 2016 22:20:35 -0700 (PDT) X-Received: by 10.28.19.134 with SMTP id 128mr13454761wmt.40.1474867235038; Sun, 25 Sep 2016 22:20:35 -0700 (PDT) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id f65si4012780wmi.4.2016.09.25.22.20.34; Sun, 25 Sep 2016 22:20:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 449DFB3833; Mon, 26 Sep 2016 07:20:33 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3XnUwhNdXW6c; Mon, 26 Sep 2016 07:20:33 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BB454B381E; Mon, 26 Sep 2016 07:20:32 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 48FB3B381E for ; Mon, 26 Sep 2016 07:20:28 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id a8Bc-jXYYxJR for ; Mon, 26 Sep 2016 07:20:27 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from conuserg-08.nifty.com (conuserg-08.nifty.com [210.131.2.75]) by theia.denx.de (Postfix) with ESMTPS id 4C4BCA76C0 for ; Mon, 26 Sep 2016 07:20:23 +0200 (CEST) Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id u8Q5JWxP005538; Mon, 26 Sep 2016 14:19:33 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com u8Q5JWxP005538 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1474867173; bh=9sluip0UOaUm7eWtUeywdM1k6v/O3Iwg6hj3PohXmqQ=; h=From:To:Cc:Subject:Date:From; b=ottPLuwA0Lx+FZ4L8/zwF5TalFj8v7KEz6ZbVi9TiyPpUZJAIYwXZPGKl6ckBvxkA kLjUFv77juBKMbkHxxUjmfUmtSOQVzwDt72D551OikKpqWc07IxW1X1Ypf2n+cTkuF ggzyrCvrlWNSdPKWAZFuYvgteh6/6chUAIqD90QyrXjypOStN25ZrR8LvnqkgZR3l9 81plmtvNYz2Izyy7WyPtqLM1gd1EilAwrT7x7wkXtywLOmGp+3hf3LZzlotaKVzY8T +5GG6zK5NlkmTkN9QOobTERlf7rnsVgNs+qR+/KviGKIxN+NtwXbOc1rbhNpLlWeY6 uKyOQT55ntc3Q== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Mon, 26 Sep 2016 14:21:30 +0900 Message-Id: <1474867290-17726-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 Cc: Tom Rini , Wang Dongsheng , Jon Masters Subject: [U-Boot] [RFC PATCH] ARM: create .secure_stack section only for PSCI X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Jon Master reports that QEMU refuses to load a U-Boot image built with CONFIG_ARMV7_NONSEC, but without CONFIG_ARMV7_PSCI since commit 5a3aae68c74e ("ARM: armv7: guard memory reserve for PSCI with #ifdef CONFIG_ARMV7_PSCI"). It looks like only PSCI that needs the Secure stack, so move the #ifdef to guard the whole of .secure_stack allocation in order not to create the empty section. Signed-off-by: Masahiro Yamada Reported-by: Jon Masters Link: http://patchwork.ozlabs.org/patch/664025/ --- With this commit, the SECURE_MAX_SIZE check will go inside the #ifdef CONFIG_ARMV7_PSCI, so this patch is probably wrong. I am CCing Chen-Yu Tsai. He mostly expanded this linker script for PSCI work, so I hope he can suggest the correct way for fixing this problem. arch/arm/cpu/u-boot.lds | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) -- 1.9.1 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds index 0a5fae6..37d4c60 100644 --- a/arch/arm/cpu/u-boot.lds +++ b/arch/arm/cpu/u-boot.lds @@ -74,6 +74,7 @@ SECTIONS *(._secure.data) } +#ifdef CONFIG_ARMV7_PSCI .secure_stack ALIGN(ADDR(.secure_data) + SIZEOF(.secure_data), CONSTANT(COMMONPAGESIZE)) (NOLOAD) : #ifdef __ARMV7_PSCI_STACK_IN_RAM @@ -83,10 +84,10 @@ SECTIONS #endif { KEEP(*(.__secure_stack_start)) -#ifdef CONFIG_ARMV7_PSCI + /* Skip addreses for stack */ . = . + CONFIG_ARMV7_PSCI_NR_CPUS * ARM_PSCI_STACK_SIZE; -#endif + /* Align end of stack section to page boundary */ . = ALIGN(CONSTANT(COMMONPAGESIZE)); @@ -109,6 +110,8 @@ SECTIONS . = LOADADDR(.secure_stack); #endif +#endif + .__secure_end : AT(ADDR(.__secure_end)) { *(.__secure_end) LONG(0x1d1071c); /* Must output something to reset LMA */