All of lore.kernel.org
 help / color / mirror / Atom feed
From: "André Przywara" <andre.przywara@arm.com>
To: u-boot@lists.denx.de
Subject: [PATCH v2 1/3] arm64: Mention 4K aligned load addresses in the PIE Kconfig help
Date: Sun, 6 Sep 2020 23:16:17 +0100	[thread overview]
Message-ID: <bfeac455-a673-df80-fa0c-4cc3e1f28a0a@arm.com> (raw)
In-Reply-To: <04b3f313-6bf9-a6b0-0c1f-74c110b18000@wwwdotorg.org>

On 04/09/2020 19:42, Stephen Warren wrote:
> On 9/4/20 3:07 AM, Edgar E. Iglesias wrote:
>> From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
>>
>> Mention the requirement of 4K aligned load addresses in the
>> help section for the POSITION_INDEPENDENT option.
>>
>> Suggested-by: Michal Simek <michal.simek@xilinx.com>
>> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
>> ---
>>  arch/arm/Kconfig | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
>> index f30c2639ec..c144c08612 100644
>> --- a/arch/arm/Kconfig
>> +++ b/arch/arm/Kconfig
>> @@ -21,6 +21,9 @@ config POSITION_INDEPENDENT
>>  	  information that is embedded in the binary to support U-Boot
>>  	  relocating itself to the top-of-RAM later during execution.
>>  
>> +	  When this option is enabled, U-Boot needs to be loaded at a
>> +	  4K aligned address.
> 
> I don't believe this restriction should be documented as part of
> POSITION_INDEPENDENT; the restriction always exists at least for 64-bit
> ARM, since arch/arm/lib/relocate_64.S relocate_code uses the same
> assembly sequence that imposes this restriction, and IIUC that code is
> unconditionally used.

While this is true, the difference is that without POSITION_INDEPENDENT
the alignment is easily determined by the hardcoded load address. So we
should actually have a build time check on this.

With POSITION_INDEPENDENT, however, the load address is only known at
runtime (somewhat under the user's control, if you like). So a warning
or hint here might be useful. But maybe it should be noted as a general
restriction in the paragraph above:
" ... from almost any address" => "from almost any 4K aligned address"

Cheers,
Andre.

  reply	other threads:[~2020-09-06 22:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-04  9:07 [PATCH v2 0/3] arm64: Large PIE fixes Edgar E. Iglesias
2020-09-04  9:07 ` [PATCH v2 1/3] arm64: Mention 4K aligned load addresses in the PIE Kconfig help Edgar E. Iglesias
2020-09-04 18:42   ` Stephen Warren
2020-09-06 22:16     ` André Przywara [this message]
2020-09-07  9:58       ` Edgar E. Iglesias
2020-09-04  9:07 ` [PATCH v2 2/3] arm64: Bail out PIE builds early if load address is not 4K aligned Edgar E. Iglesias
2020-09-04 18:43   ` Stephen Warren
2020-09-07  9:52     ` Edgar E. Iglesias
2020-09-07 12:57       ` Tom Rini
2020-09-07 13:40         ` Edgar E. Iglesias
2020-09-08 19:02       ` Stephen Warren
2020-09-04  9:07 ` [PATCH v2 3/3] arm64: Add support for larger PIE U-boot Edgar E. Iglesias
2020-09-04 13:04   ` Michal Simek
2020-09-04 13:11     ` Edgar E. Iglesias
2020-09-04 18:45   ` Stephen Warren

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=bfeac455-a673-df80-fa0c-4cc3e1f28a0a@arm.com \
    --to=andre.przywara@arm.com \
    --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.