From: Mark Rutland <mark.rutland@arm.com>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: catalin.marinas@arm.com, will@kernel.org, maz@kernel.org,
anshuman.khandual@arm.com, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] arm64: booting: Require placement within 48-bit addressable memory
Date: Mon, 14 Nov 2022 12:10:23 +0000 [thread overview]
Message-ID: <Y3IwL0Xa+OjtMt0s@FVFF77S0Q05N> (raw)
In-Reply-To: <20221114115810.1369005-1-ardb@kernel.org>
On Mon, Nov 14, 2022 at 12:58:10PM +0100, Ard Biesheuvel wrote:
> Some configurations (i.e., 64k + LVA/LPA) can tolerate a physical
> placement of the kernel image outside of the 48-bit addressable region,
> but given that the loader has no way of knowing whether or not the image
> in question supports LVA/LPA, it currently has no choice but to place it
> below the 48-bit mark.
>
> Once we add support for LPA2, which allows 52-bit physical and virtual
> addressing when using 4k or 16k pages, but in way that relies on
> increasing the number of paging levels, there will be more variety in
> the configurations that may or may not support this.
>
> So repaint bit #3 in the Image header as 'must be placed within 48-bit
> addressable memory', as this is the current de facto meaning, and add
> bits that we may set later to allow placement outside of that.
Could we just clean up the definition of bit 3 for now, then add the other bits
when we actually set them?
>
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
> ---
> Documentation/arm64/booting.rst | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/arm64/booting.rst b/Documentation/arm64/booting.rst
> index 8c324ad638de2b27..9919e1a107add655 100644
> --- a/Documentation/arm64/booting.rst
> +++ b/Documentation/arm64/booting.rst
> @@ -114,16 +114,21 @@ Header notes:
> * 1 - 4K
> * 2 - 16K
> * 3 - 64K
> - Bit 3 Kernel physical placement
> + Bit 3-4 Kernel physical placement
>
> 0
> 2MB aligned base should be as close as possible
> to the base of DRAM, since memory below it is not
> accessible via the linear mapping
> 1
> + 2MB aligned base such that base plus image_size is
> + entirely within the 48-bit addressable range
This seems to assume text_offset is zero (which is the case today, but this is
the first part of booting.txt that assumes that); as a matter of policy are we
sure that we'll never use a non-zero offset again? If so, we probably want to
mention that in the "header notes" section, or come up with some wording to
include it here.
Otherwise, this looks good; I'm certainly in favour of explicitly mentioning
the 48-bit restriction.
Thanks,
Mark.
> + 2
> + Reserved
> + 3
> 2MB aligned base may be anywhere in physical
> memory
> - Bits 4-63 Reserved.
> + Bits 5-63 Reserved.
> ============= ===============================================================
>
> - When image_size is zero, a bootloader should attempt to keep as much
> --
> 2.35.1
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-11-14 12:11 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-14 11:58 [PATCH] arm64: booting: Require placement within 48-bit addressable memory Ard Biesheuvel
2022-11-14 12:10 ` Mark Rutland [this message]
2022-11-14 13:33 ` Ard Biesheuvel
2022-11-14 13:37 ` Mark Rutland
-- strict thread matches above, loose matches on Subject: below --
2022-11-22 17:02 Ard Biesheuvel
2022-11-22 17:03 ` Ard Biesheuvel
2022-11-23 6:29 ` Anshuman Khandual
2022-11-23 8:28 ` Ard Biesheuvel
2022-11-22 17:05 ` Mark Rutland
2022-11-23 13:26 ` Anshuman Khandual
2022-11-25 13:24 ` Will Deacon
2022-11-30 12:32 ` Ard Biesheuvel
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=Y3IwL0Xa+OjtMt0s@FVFF77S0Q05N \
--to=mark.rutland@arm.com \
--cc=anshuman.khandual@arm.com \
--cc=ardb@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=maz@kernel.org \
--cc=will@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox