linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] arm64: stable UEFI mappings for kexec
@ 2014-10-24 12:39 Ard Biesheuvel
  2014-10-24 12:39 ` [PATCH 1/6] arm64/mm: add explicit struct_mm argument to __create_mapping() Ard Biesheuvel
                   ` (5 more replies)
  0 siblings, 6 replies; 18+ messages in thread
From: Ard Biesheuvel @ 2014-10-24 12:39 UTC (permalink / raw)
  To: linux-arm-kernel

This series, that can be applied on top of the 'efi for 3.19' series I posted a
couple of days ago, reworks the UEFI virtual remapping logic so that we can
support kexec cleanly.

The main premise of these patches is that, in order to support kexec, we need
to add code to the kernel that is able to deal with the state of the firmware
after SetVirtualAddressMap() [SVAM] has been called. However, if we are going to
deal with that anyway, why not make that the default state, and have only a
single code path for both cases.

This means SVAM() needs to move to the stub, and hence the code that invents
the virtual layout needs to move with it. The result is that the kernel proper
is entered with the virt_addr members of all EFI_MEMORY_RUNTIME regions
assigned, and the mapping installed into the firmware. The kernel proper needs
to set up the page tables, and switch to them while performing the runtime
services calls. Note that there is also an efi_to_phys() to translate the values
of the fw_vendor and tables fields of the EFI system table. Again, this is
something we need to do anyway under kexec, or we end up handing over state
between one kernel and the next, which implies different code paths between
non-kexec and kexec.

The layout is chosen such that it used the userland half of the virtual address
space (TTBR0), which means no additional alignment or reservation is required
to ensure that it will always be available.

One thing that may stand out is the reordering of the memory map. The reason
for doing this is that we can use the same memory map as input to SVAM(). The
alternative is allocating memory for it using boot services, but that clutters
up the existing logic a bit between getting the memory map, populating the fdt,
and loop again if it didn't fit. The current code works perfectly fine, but
I am aware that it is an acquired taste :-)

Ard Biesheuvel (6):
  arm64/mm: add explicit struct_mm argument to __create_mapping()
  arm64/mm: add create_pgd_mapping() to create private page tables
  efi: split off remapping code from efi_config_init()
  arm64/efi: move SetVirtualAddressMap() to UEFI stub
  arm64/efi: remove free_boot_services() and friends
  arm64/efi: remove idmap manipulations from UEFI code

 arch/arm64/include/asm/efi.h       |  23 ++-
 arch/arm64/include/asm/mmu.h       |   5 +-
 arch/arm64/kernel/efi.c            | 336 +++++++++++--------------------------
 arch/arm64/kernel/setup.c          |   2 +-
 arch/arm64/mm/mmu.c                |  47 +++---
 drivers/firmware/efi/efi.c         |  49 ++++--
 drivers/firmware/efi/libstub/fdt.c | 104 +++++++++++-
 include/linux/efi.h                |   2 +
 8 files changed, 281 insertions(+), 287 deletions(-)

-- 
1.8.3.2

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

end of thread, other threads:[~2014-10-28  8:16 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-24 12:39 [PATCH 0/6] arm64: stable UEFI mappings for kexec Ard Biesheuvel
2014-10-24 12:39 ` [PATCH 1/6] arm64/mm: add explicit struct_mm argument to __create_mapping() Ard Biesheuvel
2014-10-24 15:23   ` Steve Capper
2014-10-24 12:39 ` [PATCH 2/6] arm64/mm: add create_pgd_mapping() to create private page tables Ard Biesheuvel
2014-10-24 15:17   ` Steve Capper
2014-10-24 15:42     ` Ard Biesheuvel
2014-10-24 12:39 ` [PATCH 3/6] efi: split off remapping code from efi_config_init() Ard Biesheuvel
2014-10-24 12:39 ` [PATCH 4/6] arm64/efi: move SetVirtualAddressMap() to UEFI stub Ard Biesheuvel
2014-10-24 13:39   ` Grant Likely
2014-10-24 13:47     ` Ard Biesheuvel
2014-10-28  7:47   ` Dave Young
2014-10-28  7:57     ` Ard Biesheuvel
2014-10-28  8:16       ` Dave Young
2014-10-24 12:39 ` [PATCH 5/6] arm64/efi: remove free_boot_services() and friends Ard Biesheuvel
2014-10-24 12:39 ` [PATCH 6/6] arm64/efi: remove idmap manipulations from UEFI code Ard Biesheuvel
2014-10-24 13:41   ` Grant Likely
2014-10-24 13:53     ` Ard Biesheuvel
2014-10-24 13:55       ` Grant Likely

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