linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] arm64: avoid early __va translations
@ 2016-02-11 16:47 Ard Biesheuvel
  2016-02-11 16:48 ` [PATCH v2 1/3] of/fdt: factor out assignment of initrd_start/initrd_end Ard Biesheuvel
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Ard Biesheuvel @ 2016-02-11 16:47 UTC (permalink / raw)
  To: linux-arm-kernel

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 of memstart_addr until 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.

Patch #1 refactors the early FDT code so that the actual assignment of
initrd_start and initrd_end (which is where the __va() translations are
performed) is moved into a __weak function which can be overridden.

Patch #2 overrides the __weak function to only record the physical addresses
as they are found in the /chosen node, or on the command line, and defers
the __va() translation until after memstart_addr has been assigned.

Patch #3 is some test code I used to verify that all __va() translations
are gone. Note that the open coded BUG_ON() implementation is required to
avoid .h dependency hell.

Ard Biesheuvel (3):
  of/fdt: factor out assignment of initrd_start/initrd_end
  arm64: defer __va translation of initrd_start and initrd_end
  arm64: prevent __va() translations before memstart_addr is assigned

 arch/arm64/include/asm/memory.h | 10 +++++++++-
 arch/arm64/mm/init.c            | 21 +++++++++++++++-----
 drivers/of/fdt.c                | 12 ++++++++---
 3 files changed, 34 insertions(+), 9 deletions(-)

-- 
2.5.0

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-02-12 12:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-11 16:47 [PATCH v2 0/3] arm64: avoid early __va translations Ard Biesheuvel
2016-02-11 16:48 ` [PATCH v2 1/3] of/fdt: factor out assignment of initrd_start/initrd_end Ard Biesheuvel
2016-02-11 22:12   ` Arnd Bergmann
2016-02-12  8:08     ` Ard Biesheuvel
2016-02-11 16:48 ` [PATCH v2 2/3] arm64: defer __va translation of initrd_start and initrd_end Ard Biesheuvel
2016-02-11 16:48 ` [PATCH v2 3/3] arm64: prevent __va() translations before memstart_addr is assigned Ard Biesheuvel
2016-02-12 11:49   ` Will Deacon
2016-02-12 11:51     ` Ard Biesheuvel
2016-02-12 12:09       ` Arnd Bergmann

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).