arm64: avoid early __va translations
Get series with b4
b4 am [email protected]Versions newest first
- v3 Latest0 of 4 patches 0 repliesNew
Patches in v3 No applies recorded yet
None of the 4 patches the cover letter announces are in this archive.
Reviews trailers per patch
| Patch | Laurentiu Tudor |
|---|---|
| Series | T-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v3 0/4] arm64: avoid early __va translations
Hi Ard,
Quoted 33 lines · Ard Biesheuvel
This is a somewhat cleaner approach for dealing with the issue that the early FDT performs
__va()translations before the linear mapping has been set up. Being able to defer the assignment ofmemstart_addruntil after we have discovered all of memory is an important piece of functionality, not only for KASLR but also for mapping the linear region as efficiently as possible.Changes since v2:
- replace__weakfunction in patches #1 and #2 with a preprocessor macro
- add patch to address the circular header dependency when includingasm/bug.hinasm/memory.h
- turned the hack that adds theBUG_ON()into a proper patchPatch #1 refactors the early FDT code so that the actual assignment of
initrd_startandinitrd_end(which is where the__va()translations are performed) can be overridden in architecture specific code.Patch #2 performs the override, and only records the physical addresses as they are found in the /chosen node, or on the command line, and defers the
__va()translation until aftermemstart_addrhas been assigned.Patch #3 reshuffles some #includes and #defines so that
asm/bug.hcan be included (and used) inasm/memory.hPatch #4 implements a
BUG_ON()check to ensure that no references tomemstart_addrare made before it has been assigned.Ard Biesheuvel (4):
of/fdt: factor out assignment of initrd_start/initrd_end
arm64: defer__vatranslation ofinitrd_startandinitrd_end
arm64: prevent potential circular header dependencies inasm/bug.h
arm64: prevent__va()translations beforememstart_addris assigned
Quoted 7 lines
arch/arm64/include/asm/bug.h | 2 +- arch/arm64/include/asm/debug-monitors.h | 2 +- arch/arm64/include/asm/memory.h | 12 ++++++++++- arch/arm64/kvm/hyp/debug-sr.c | 1 + arch/arm64/mm/init.c | 21 +++++++++++++++----- drivers/of/fdt.c | 14 ++++++++++--- 6 files changed, 41 insertions(+), 11 deletions(-)
Tried these on one of our LS2 boards so here's a:
---
Best Regards, Laurentiu