From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 04/13] arm64: use fixmap region for permanent FDT mapping
Date: Fri, 17 Apr 2015 16:13:15 +0100 [thread overview]
Message-ID: <20150417151315.GH21904@leverpostej> (raw)
In-Reply-To: <1429112064-19952-5-git-send-email-ard.biesheuvel@linaro.org>
On Wed, Apr 15, 2015 at 04:34:15PM +0100, Ard Biesheuvel wrote:
> Currently, the FDT blob needs to be in the same 512 MB region as
> the kernel, so that it can be mapped into the kernel virtual memory
> space very early on using a minimal set of statically allocated
> translation tables.
>
> Now that we have early fixmap support, we can relax this restriction,
> by moving the permanent FDT mapping to the fixmap region instead.
> This way, the FDT blob may be anywhere in memory.
>
> This also moves the vetting of the FDT to mmu.c, since the early
> init code in head.S does not handle mapping of the FDT anymore.
> At the same time, fix up some comments in head.S that have gone stale.
>
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
> Documentation/arm64/booting.txt | 13 +++++----
> arch/arm64/include/asm/boot.h | 14 +++++++++
> arch/arm64/include/asm/fixmap.h | 15 ++++++++++
> arch/arm64/include/asm/mmu.h | 1 +
> arch/arm64/kernel/head.S | 39 +------------------------
> arch/arm64/kernel/setup.c | 32 +++++++-------------
> arch/arm64/mm/Makefile | 2 ++
> arch/arm64/mm/init.c | 1 -
> arch/arm64/mm/mmu.c | 65 +++++++++++++++++++++++++++++++++++++++++
> 9 files changed, 117 insertions(+), 65 deletions(-)
> create mode 100644 arch/arm64/include/asm/boot.h
>
> diff --git a/Documentation/arm64/booting.txt b/Documentation/arm64/booting.txt
> index f3c05b5f9f08..53f18e13d51c 100644
> --- a/Documentation/arm64/booting.txt
> +++ b/Documentation/arm64/booting.txt
> @@ -45,11 +45,14 @@ sees fit.)
>
> Requirement: MANDATORY
>
> -The device tree blob (dtb) must be placed on an 8-byte boundary within
> -the first 512 megabytes from the start of the kernel image and must not
> -cross a 2-megabyte boundary. This is to allow the kernel to map the
> -blob using a single section mapping in the initial page tables.
> -
> +The device tree blob (dtb) must be placed on an 8-byte boundary and must
> +not exceed 2 megabytes in size. Since the dtb will be mapped cacheable using
> +blocks of up to 2 megabytes in size, it should not be placed within 2 megabytes
> +of memreserves or other special carveouts that may be mapped with non-matching
> +attributes.
Nit: memreserves are always permitted to be mapped cacheable (following
the ePAPR definition and the de-facto Linux implementation on everything
other than PPC), so those should be fine.
How about:
The device tree blob (dtb) must be placed on an 8-byte boundary and must
not exceed 2 megabytes in size. Since the dtb will be mapped cacheable
using blocks of up to 2 megabytes in size, it must not be placed within
any 2M region which must be mapped with any specific attributes.
As an aside, we perhaps need a more formal definition of /memreserve/
semantics.
The code itself looks good to me. I'll try to give that a go with some
padded DTBs at some point next week.
Mark.
next prev parent reply other threads:[~2015-04-17 15:13 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-15 15:34 [PATCH v4 00/13] arm64: update/clarify/relax Image and FDT placement rules Ard Biesheuvel
2015-04-15 15:34 ` [PATCH v4 01/13] arm64: reduce ID map to a single page Ard Biesheuvel
2015-04-15 15:34 ` [PATCH v4 02/13] arm64: drop sleep_idmap_phys and clean up cpu_resume() Ard Biesheuvel
2015-04-15 15:34 ` [PATCH v4 03/13] of/fdt: split off FDT self reservation from memreserve processing Ard Biesheuvel
2015-04-15 15:34 ` [PATCH v4 04/13] arm64: use fixmap region for permanent FDT mapping Ard Biesheuvel
2015-04-17 15:13 ` Mark Rutland [this message]
2015-04-15 15:34 ` [PATCH v4 05/13] arm64/efi: adapt to relaxed FDT placement requirements Ard Biesheuvel
2015-04-15 15:34 ` [PATCH v4 06/13] arm64: implement our own early_init_dt_add_memory_arch() Ard Biesheuvel
2015-04-15 15:34 ` [PATCH v4 07/13] arm64: use more granular reservations for static page table allocations Ard Biesheuvel
2015-04-15 15:34 ` [PATCH v4 08/13] arm64: split off early mapping code from early_fixmap_init() Ard Biesheuvel
2015-04-15 15:34 ` [PATCH v4 09/13] arm64: mm: explicitly bootstrap the linear mapping Ard Biesheuvel
2015-05-07 16:54 ` Catalin Marinas
2015-05-07 19:21 ` Ard Biesheuvel
2015-05-08 14:44 ` Catalin Marinas
2015-05-08 15:03 ` Ard Biesheuvel
2015-05-08 16:43 ` Catalin Marinas
2015-05-08 16:59 ` Ard Biesheuvel
2015-04-15 15:34 ` [PATCH v4 10/13] arm64: move kernel mapping out of linear region Ard Biesheuvel
2015-05-08 17:16 ` Catalin Marinas
2015-05-08 17:26 ` Ard Biesheuvel
2015-05-08 17:27 ` Ard Biesheuvel
2015-04-15 15:34 ` [PATCH v4 11/13] arm64: map linear region as non-executable Ard Biesheuvel
2015-04-15 15:34 ` [PATCH v4 12/13] arm64: allow kernel Image to be loaded anywhere in physical memory Ard Biesheuvel
2015-04-15 15:34 ` [PATCH v4 13/13] arm64/efi: adapt to relaxed kernel Image placement requirements 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=20150417151315.GH21904@leverpostej \
--to=mark.rutland@arm.com \
--cc=linux-arm-kernel@lists.infradead.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