diff options
author | Alexandre Ghiti <alexghiti@rivosinc.com> | 2023-07-22 14:38:50 +0200 |
---|---|---|
committer | Palmer Dabbelt <palmer@rivosinc.com> | 2023-09-05 19:49:31 -0700 |
commit | b7ac4b8ee73d4fec0998664c9dd61f089d481044 (patch) | |
tree | 2cac0600d5be537d83ded5db31188abdf46f0f2e /arch | |
parent | 3c35d1a03c8b864f08088d51e121aa7c0067b146 (diff) | |
download | linux-stable-b7ac4b8ee73d4fec0998664c9dd61f089d481044.tar.gz linux-stable-b7ac4b8ee73d4fec0998664c9dd61f089d481044.tar.bz2 linux-stable-b7ac4b8ee73d4fec0998664c9dd61f089d481044.zip |
riscv: libstub: Implement KASLR by using generic functions
We can now use arm64 functions to handle the move of the kernel physical
mapping: if KASLR is enabled, we will try to get a random seed from the
firmware, if not possible, the kernel will be moved to a location that
suits its alignment constraints.
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Tested-by: Conor Dooley <conor.dooley@microchip.com>
Tested-by: Song Shuai <songshuaishuai@tinylab.org>
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Tested-by: Sami Tolvanen <samitolvanen@google.com>
Link: https://lore.kernel.org/r/20230722123850.634544-6-alexghiti@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/riscv/include/asm/efi.h | 2 | ||||
-rw-r--r-- | arch/riscv/kernel/image-vars.h | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/arch/riscv/include/asm/efi.h b/arch/riscv/include/asm/efi.h index 29e9a0d84b16..00b24ba55035 100644 --- a/arch/riscv/include/asm/efi.h +++ b/arch/riscv/include/asm/efi.h @@ -51,4 +51,6 @@ void efi_virtmap_unload(void); unsigned long stext_offset(void); +void efi_icache_sync(unsigned long start, unsigned long end); + #endif /* _ASM_EFI_H */ diff --git a/arch/riscv/kernel/image-vars.h b/arch/riscv/kernel/image-vars.h index 15616155008c..ea1a10355ce9 100644 --- a/arch/riscv/kernel/image-vars.h +++ b/arch/riscv/kernel/image-vars.h @@ -27,6 +27,7 @@ __efistub__start = _start; __efistub__start_kernel = _start_kernel; __efistub__end = _end; __efistub__edata = _edata; +__efistub___init_text_end = __init_text_end; __efistub_screen_info = screen_info; #endif |