From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 4/8] ARMv8: PSCI: Add linker section to hold PSCI code
Date: Sat, 11 Oct 2014 13:27:16 +0200 [thread overview]
Message-ID: <E1XcupR-000069-OS@janus> (raw)
In-Reply-To: <E1XV0fP-0002Fu-Qf@janus>
Hi Albert,
On Fri, 19 Sep 2014 18:04:14 +0200, Albert ARIBAUD
<albert.u.boot@aribaud.net> wrote:
> Hi Marc,
>
> On Thu, 18 Sep 2014 16:28:52 +0100, Marc Zyngier <marc.zyngier@arm.com>
> wrote:
>
> > On Thu, Sep 18 2014 at 10:12:17 AM, Albert ARIBAUD <albert.u.boot@aribaud.net> wrote:
> > > Hi Arnab,
> > >
> > > On Thu, 28 Aug 2014 01:59:57 +0530, Arnab Basu
> > > <arnab.basu@freescale.com> wrote:
> > >
> > >> A separate linker section makes it possible to keep this code either
> > >> in DDR or in some secure memory location provided specifically for the
> > >> purpose.
> > >>
> > >> So far no one is using this section.
> > >>
> > >> Signed-off-by: Arnab Basu <arnab.basu@freescale.com>
> > >> Reviewed-by: Bhupesh Sharma <bhupesh.sharma@freescale.com>
> > >> Cc: Marc Zyngier <marc.zyngier@arm.com>
> > >> ---
> > >> arch/arm/config.mk | 2 +-
> > >> arch/arm/cpu/armv8/u-boot.lds | 30 ++++++++++++++++++++++++++++++
> > >> 2 files changed, 31 insertions(+), 1 deletions(-)
> > >>
> > >> diff --git a/arch/arm/config.mk b/arch/arm/config.mk
> > >> index c339e6d..9272e9c 100644
> > >> --- a/arch/arm/config.mk
> > >> +++ b/arch/arm/config.mk
> > >> @@ -111,7 +111,7 @@ endif
> > >>
> > >> # limit ourselves to the sections we want in the .bin.
> > >> ifdef CONFIG_ARM64
> > >> -OBJCOPYFLAGS += -j .text -j .rodata -j .data -j .u_boot_list -j .rela.dyn
> > >> +OBJCOPYFLAGS += -j .text -j .secure_text -j .rodata -j .data -j .u_boot_list -j .rela.dyn
> > >> else
> > >> OBJCOPYFLAGS += -j .text -j .secure_text -j .rodata -j .hash -j .data -j .got.plt -j .u_boot_list -j .rel.dyn
> > >> endif
> > >> diff --git a/arch/arm/cpu/armv8/u-boot.lds b/arch/arm/cpu/armv8/u-boot.lds
> > >> index 4c12222..bd95fff 100644
> > >> --- a/arch/arm/cpu/armv8/u-boot.lds
> > >> +++ b/arch/arm/cpu/armv8/u-boot.lds
> > >> @@ -8,6 +8,8 @@
> > >> * SPDX-License-Identifier: GPL-2.0+
> > >> */
> > >>
> > >> +#include <config.h>
> > >> +
> > >> OUTPUT_FORMAT("elf64-littleaarch64", "elf64-littleaarch64", "elf64-littleaarch64")
> > >> OUTPUT_ARCH(aarch64)
> > >> ENTRY(_start)
> > >> @@ -23,6 +25,34 @@ SECTIONS
> > >> *(.text*)
> > >> }
> > >>
> > >> +#ifdef CONFIG_ARMV8_PSCI
> > >> +
> > >> +#ifndef CONFIG_ARMV8_SECURE_BASE
> > >> +#define CONFIG_ARMV8_SECURE_BASE
> > >> +#endif
> > >> +
> > >> + .__secure_start : {
> > >> + . = ALIGN(0x1000);
> > >> + *(.__secure_start)
> > >> + }
> > >> +
> > >> + .secure_text CONFIG_ARMV8_SECURE_BASE :
> > >> + AT(ADDR(.__secure_start) + SIZEOF(.__secure_start))
> > >> + {
> > >> + *(._secure.text)
> > >> + }
> > >> +
> > >> + . = LOADADDR(.__secure_start) +
> > >> + SIZEOF(.__secure_start) +
> > >> + SIZEOF(.secure_text);
> > >> +
> > >> + __secure_end_lma = .;
> > >> + .__secure_end : AT(__secure_end_lma) {
> > >> + *(.__secure_end)
> > >> + LONG(0x1d1071c); /* Must output something to reset LMA */
> > >
> > > Can you explain in more detail what issue this fixes?
> >
> > If you use AT to force a new load address (LMA), you must ensure that
> > you actually output something at this address. Here, if *(.__secure_end)
> > ends up being empty, whatever follows would be as if the AT never
> > happened, ending up at the wrong LMA.
> >
> > The workaround is to force the output of a dummy value in all
> > cases, ensuring that the rest of the text is at a sensible LMA. This is
> > an issue that has been in GNU ld for years, and this workaround is a
> > copy/paste of the same one in the ARMv7 ld script.
>
> I see. Does the ld bug have an identifier that we could mention in a
> comment in the linker script as a reference?
Ping.
> > Thanks,
> >
> > M.
>
> Amicalement,
Amicalement,
--
Albert.
next prev parent reply other threads:[~2014-10-11 11:27 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-27 20:29 [U-Boot] [PATCH 0/8] PSCI v0.2 framework for ARMv8 Arnab Basu
2014-08-27 20:29 ` [U-Boot] [PATCH 1/8] ARM: PSCI: Update psci.h for psci v0.2 Arnab Basu
2014-11-08 7:43 ` Albert ARIBAUD
2014-11-08 8:11 ` [U-Boot] [PATCH 1/8] ARM: PSCI: Update psci.h for psci v0.2 -- CORRECTION Albert ARIBAUD
2014-08-27 20:29 ` [U-Boot] [PATCH 2/8] ARM: PSCI: Alow arch specific DT patching Arnab Basu
2014-08-28 10:10 ` Mark Rutland
2014-08-28 10:51 ` Arnab Basu
2014-08-28 12:47 ` Mark Rutland
2014-08-27 20:29 ` [U-Boot] [PATCH 3/8] ARMv8/fsl-lsch3: Refactor spin-table code Arnab Basu
2014-10-26 21:06 ` Albert ARIBAUD
2014-10-27 4:51 ` arnab.basu at freescale.com
2014-08-27 20:29 ` [U-Boot] [PATCH 4/8] ARMv8: PSCI: Add linker section to hold PSCI code Arnab Basu
2014-09-18 9:12 ` Albert ARIBAUD
2014-09-18 15:28 ` Marc Zyngier
2014-09-19 16:04 ` Albert ARIBAUD
2014-10-11 11:27 ` Albert ARIBAUD [this message]
2014-10-11 16:04 ` Marc Zyngier
2014-08-27 20:29 ` [U-Boot] [PATCH 5/8] ARMv8: PCSI: Add generic ARMv8 " Arnab Basu
2014-08-28 11:37 ` Mark Rutland
2014-08-27 20:29 ` [U-Boot] [PATCH 6/8] ARMv8: PSCI: Fixup the device tree for PSCI v0.2 Arnab Basu
2014-08-28 12:44 ` Mark Rutland
2014-08-29 14:03 ` Arnab Basu
2014-09-01 18:43 ` Mark Rutland
2014-09-02 11:17 ` Mark Rutland
2014-09-02 15:21 ` Stuart Yoder
2014-09-03 15:25 ` Mark Rutland
2014-08-27 20:30 ` [U-Boot] [PATCH 7/8] ARMv8: PSCI: Setup ARMv8 PSCI Arnab Basu
2014-08-27 20:30 ` [U-Boot] [PATCH 8/8] ARMv8: PSCI: Enable SMC Arnab Basu
2014-09-18 9:18 ` Albert ARIBAUD
2014-09-18 15:50 ` arnab.basu at freescale.com
2014-08-27 20:43 ` [U-Boot] [PATCH 0/8] PSCI v0.2 framework for ARMv8 Arnab Basu
2014-11-26 12:52 ` Jan Kiszka
2014-12-03 17:25 ` Mark Rutland
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=E1XcupR-000069-OS@janus \
--to=albert.u.boot@aribaud.net \
--cc=u-boot@lists.denx.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.