diff mbox series

[U-Boot] ARM: Specify aligned address for secure section instead of using attributes

Message ID 20180906035628.9813-1-wens@csie.org
State Accepted
Commit 792b204798453d96b00e0817e8472c19455e92a2
Delegated to: Tom Rini
Headers show
Series [U-Boot] ARM: Specify aligned address for secure section instead of using attributes | expand

Commit Message

Chen-Yu Tsai Sept. 6, 2018, 3:56 a.m. UTC
In commit a1274cc94a20 ("ARM: Page align secure section only when it is
executed in situ"), we used output section attributes (the "ALIGN"
keyword after the colon) to specify the alignment requirements. Using
the constant "COMMONPAGE" there was recently broken in binutils 2.31 [1].

Binutils maintainer Alan Modra suggested the former method would still
work. Since both methods achieve the same result, this patch does just
that. This fixes the "reboot after bootm" issue we've been seeing on
sunxi when booting non-secure.

  [1] https://sourceware.org/bugzilla/show_bug.cgi?id=23571

Suggested-by: Alan Modra <amodra@gmail.com>
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/cpu/u-boot.lds | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Tom Rini Sept. 6, 2018, 1:45 p.m. UTC | #1
On Thu, Sep 06, 2018 at 11:56:28AM +0800, Chen-Yu Tsai wrote:

> In commit a1274cc94a20 ("ARM: Page align secure section only when it is
> executed in situ"), we used output section attributes (the "ALIGN"
> keyword after the colon) to specify the alignment requirements. Using
> the constant "COMMONPAGE" there was recently broken in binutils 2.31 [1].
> 
> Binutils maintainer Alan Modra suggested the former method would still
> work. Since both methods achieve the same result, this patch does just
> that. This fixes the "reboot after bootm" issue we've been seeing on
> sunxi when booting non-secure.
> 
>   [1] https://sourceware.org/bugzilla/show_bug.cgi?id=23571
> 
> Suggested-by: Alan Modra <amodra@gmail.com>
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>

Reviewed-by: Tom Rini <trini@konsulko.com>

After a little more time for review, should I take this directly or a PR
from the sunxi team?  Thanks!
Jagan Teki Sept. 7, 2018, 4:32 a.m. UTC | #2
On Thu, Sep 6, 2018 at 7:15 PM, Tom Rini <trini@konsulko.com> wrote:
> On Thu, Sep 06, 2018 at 11:56:28AM +0800, Chen-Yu Tsai wrote:
>
>> In commit a1274cc94a20 ("ARM: Page align secure section only when it is
>> executed in situ"), we used output section attributes (the "ALIGN"
>> keyword after the colon) to specify the alignment requirements. Using
>> the constant "COMMONPAGE" there was recently broken in binutils 2.31 [1].
>>
>> Binutils maintainer Alan Modra suggested the former method would still
>> work. Since both methods achieve the same result, this patch does just
>> that. This fixes the "reboot after bootm" issue we've been seeing on
>> sunxi when booting non-secure.
>>
>>   [1] https://sourceware.org/bugzilla/show_bug.cgi?id=23571
>>
>> Suggested-by: Alan Modra <amodra@gmail.com>
>> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
>
> Reviewed-by: Tom Rini <trini@konsulko.com>

Acked-by: Jagan Teki <jagan@openedev.com>

>
> After a little more time for review, should I take this directly or a PR
> from the sunxi team?  Thanks!

As of now, I don't have any patches for the release please take it directly.
Tom Rini Sept. 7, 2018, 3:57 p.m. UTC | #3
On Thu, Sep 06, 2018 at 11:56:28AM +0800, Chen-Yu Tsai wrote:

> In commit a1274cc94a20 ("ARM: Page align secure section only when it is
> executed in situ"), we used output section attributes (the "ALIGN"
> keyword after the colon) to specify the alignment requirements. Using
> the constant "COMMONPAGE" there was recently broken in binutils 2.31 [1].
> 
> Binutils maintainer Alan Modra suggested the former method would still
> work. Since both methods achieve the same result, this patch does just
> that. This fixes the "reboot after bootm" issue we've been seeing on
> sunxi when booting non-secure.
> 
>   [1] https://sourceware.org/bugzilla/show_bug.cgi?id=23571
> 
> Suggested-by: Alan Modra <amodra@gmail.com>
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> Reviewed-by: Tom Rini <trini@konsulko.com>
> Acked-by: Jagan Teki <jagan@openedev.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds
index 834dc99554c9..0eb164d2e694 100644
--- a/arch/arm/cpu/u-boot.lds
+++ b/arch/arm/cpu/u-boot.lds
@@ -68,11 +68,11 @@  SECTIONS
 #ifdef CONFIG_ARMV7_NONSEC
 
 	/* Align the secure section only if we're going to use it in situ */
-	.__secure_start :
+	.__secure_start
 #ifndef CONFIG_ARMV7_SECURE_BASE
 		ALIGN(CONSTANT(COMMONPAGESIZE))
 #endif
-	{
+	: {
 		KEEP(*(.__secure_start))
 	}