From: ard.biesheuvel@linaro.org (Ard Biesheuvel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 0/7] arm64: relax Image placement rules
Date: Mon, 16 Nov 2015 12:23:11 +0100 [thread overview]
Message-ID: <1447672998-20981-1-git-send-email-ard.biesheuvel@linaro.org> (raw)
This series updates the mapping of the kernel Image and the linear mapping of
system memory to allow more freedom in the choice of Image placement without
affecting the accessibility of system RAM below the kernel Image, and the
mapping efficiency (i.e., memory can always be mapped in 512 MB or 1 GB blocks).
An added benefit of having the freedom to put the Image anywhere in physical
memory is that it decomplicates the logic that needs to be applied when using
kexec to boot another kernel. Furthermore, moving the kernel out of the linear
mapping is a preparatory step towards implementing kASLR. This will be addressed
in a followup series.
Changes since v2 (http://marc.info/?l=linux-arm-kernel&m=144309211310754):
- rebased onto v4.4-rc1, which adds support for 16k pages, resulting in minor
changes requried to various parts of the code
- fix behavior under CONFIG_DEBUG_RODATA
Changes since v1:
- dropped somewhat unrelated patch #1 and patches #2 and #3 that have been
merged separately
- rebased onto v4.2-rc3
- tweak the generic early_init_dt_add_memory_arch for our purposes rather than
clone the implementation completely
Known issues:
- the mem= command line parameter works correctly now, but removes memory from
the bottom first before clipping from the top, which may be undesirable since
it may discard precious memory below the 4 GB boundary.
Patch #1 refactors the generic early_init_dt_add_memory_arch implementation to
allow to minimum memblock address to be overridden by the architecture.
Patch #2 changes the memblock_reserve logic so that unused page table
reservations are left unreserved in memblock.
Patch #3 refactors early_fixmap_init() so that we can reuse its core for
bootstrapping other memory mappings.
Patch #4 bootstraps the linear mapping explicitly. Up until now, this was done
implicitly due to the fact that the linear mapping starts at the base of the
kernel Image.
Patch #5 moves the mapping of the kernel Image outside of the linear mapping.
Patch #6 changes the attributes of the linear mapping to non-executable since
we don't execute code from it anymore.
Patch #7 allows the kernel to be loaded at any 2 MB aligned offset in physical
memory, by assigning PHYS_OFFSET based on the available memory and not based on
the physical address of the base of the kernel Image.
Ard Biesheuvel (7):
of/fdt: make memblock minimum physical address arch configurable
arm64: use more granular reservations for static page table
allocations
arm64: split off early mapping code from early_fixmap_init()
arm64: mm: explicitly bootstrap the linear mapping
arm64: move kernel mapping out of linear region
arm64: map linear region as non-executable
arm64: allow kernel Image to be loaded anywhere in physical memory
Documentation/arm64/booting.txt | 12 +-
arch/arm64/include/asm/boot.h | 7 +
arch/arm64/include/asm/compiler.h | 2 +
arch/arm64/include/asm/kernel-pgtable.h | 5 +-
arch/arm64/include/asm/memory.h | 27 ++-
arch/arm64/kernel/head.S | 18 +-
arch/arm64/kernel/vmlinux.lds.S | 39 +++-
arch/arm64/mm/dump.c | 3 +-
arch/arm64/mm/init.c | 54 ++++-
arch/arm64/mm/mmu.c | 224 +++++++++++++-------
drivers/of/fdt.c | 5 +-
11 files changed, 284 insertions(+), 112 deletions(-)
--
1.9.1
next reply other threads:[~2015-11-16 11:23 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-16 11:23 Ard Biesheuvel [this message]
2015-11-16 11:23 ` [PATCH v3 1/7] of/fdt: make memblock minimum physical address arch configurable Ard Biesheuvel
2015-11-16 11:23 ` [PATCH v3 2/7] arm64: use more granular reservations for static page table allocations Ard Biesheuvel
2015-11-16 11:23 ` [PATCH v3 3/7] arm64: split off early mapping code from early_fixmap_init() Ard Biesheuvel
2015-12-03 12:18 ` Mark Rutland
2015-12-03 13:31 ` Ard Biesheuvel
2015-12-03 13:59 ` Mark Rutland
2015-12-03 14:05 ` Ard Biesheuvel
2015-12-07 16:08 ` Catalin Marinas
2015-12-07 16:13 ` Ard Biesheuvel
2015-12-08 12:40 ` Will Deacon
2015-12-08 13:29 ` Ard Biesheuvel
2015-12-08 13:51 ` Will Deacon
2015-12-15 19:19 ` Ard Biesheuvel
2015-11-16 11:23 ` [PATCH v3 4/7] arm64: mm: explicitly bootstrap the linear mapping Ard Biesheuvel
2015-11-16 11:23 ` [PATCH v3 5/7] arm64: move kernel mapping out of linear region Ard Biesheuvel
2015-12-07 12:26 ` Catalin Marinas
2015-12-07 12:33 ` Ard Biesheuvel
2015-12-07 12:34 ` Ard Biesheuvel
2015-12-07 15:37 ` Catalin Marinas
2015-11-16 11:23 ` [PATCH v3 6/7] arm64: map linear region as non-executable Ard Biesheuvel
2015-12-07 16:19 ` Catalin Marinas
2015-12-07 16:22 ` Ard Biesheuvel
2015-12-07 16:27 ` Catalin Marinas
2015-11-16 11:23 ` [PATCH v3 7/7] arm64: allow kernel Image to be loaded anywhere in physical memory Ard Biesheuvel
2015-12-07 15:30 ` Catalin Marinas
2015-12-07 15:40 ` Ard Biesheuvel
2015-12-07 16:43 ` Catalin Marinas
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=1447672998-20981-1-git-send-email-ard.biesheuvel@linaro.org \
--to=ard.biesheuvel@linaro.org \
--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;
as well as URLs for NNTP newsgroup(s).