Merge patch series "riscv: Introduce KASLR"
authorPalmer Dabbelt <palmer@rivosinc.com>
Fri, 8 Sep 2023 18:25:13 +0000 (11:25 -0700)
committerPalmer Dabbelt <palmer@rivosinc.com>
Fri, 8 Sep 2023 18:25:13 +0000 (11:25 -0700)
commitf57805555834494e8cad729d01d86ba326d64959
treebe3a984a98b86c4e62edf8224f18e2618578401c
parentf0936363547948e0c2b757aff52f6ee29396651d
parentb7ac4b8ee73d4fec0998664c9dd61f089d481044
Merge patch series "riscv: Introduce KASLR"

Alexandre Ghiti <alexghiti@rivosinc.com> says:

The following KASLR implementation allows to randomize the kernel mapping:

- virtually: we expect the bootloader to provide a seed in the device-tree
- physically: only implemented in the EFI stub, it relies on the firmware to
  provide a seed using EFI_RNG_PROTOCOL. arm64 has a similar implementation
  hence the patch 3 factorizes KASLR related functions for riscv to take
  advantage.

The new virtual kernel location is limited by the early page table that only
has one PUD and with the PMD alignment constraint, the kernel can only take
< 512 positions.

* b4-shazam-merge:
  riscv: libstub: Implement KASLR by using generic functions
  libstub: Fix compilation warning for rv32
  arm64: libstub: Move KASLR handling functions to kaslr.c
  riscv: Dump out kernel offset information on panic
  riscv: Introduce virtual kernel mapping KASLR

Link: https://lore.kernel.org/r/20230722123850.634544-1-alexghiti@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/arm64/include/asm/efi.h
arch/riscv/Kconfig
arch/riscv/include/asm/efi.h
arch/riscv/kernel/setup.c
arch/riscv/mm/init.c
drivers/firmware/efi/libstub/Makefile
drivers/firmware/efi/libstub/efistub.h
drivers/firmware/efi/libstub/kaslr.c