aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/clk/ssh:/git@git.zx2c4.com
diff options
context:
space:
mode:
authorWANG Rui <wangrui@loongson.cn>2026-05-21 20:58:36 +0800
committerHuacai Chen <chenhuacai@loongson.cn>2026-05-21 20:58:36 +0800
commit03d8273542146f228c0019f08b57545fdee79704 (patch)
tree27d660e418bcbe564e273e31f0c0c3bd0690840e /include/linux/clk/ssh:/git@git.zx2c4.com
parentLinux 7.1-rc4 (diff)
efi/loongarch: Randomize kernel preferred address for KASLR
Introduce efi_get_kimg_kaslr_address() helper to compute the preferred kernel image load address dynamically when CONFIG_RANDOMIZE_BASE is enabled. The function derives a random offset by using the EFI-provided randomness combined with the timer tick value, and constrains it within CONFIG_RANDOMIZE_BASE_MAX_OFFSET. Update EFI_KIMG_PREFERRED_ADDRESS to call this helper so that the EFI stub can select a randomized load address when KASLR is active, while preserving the original base address behavior when KASLR is disabled or "nokaslr" is specified. Note: LoongArch can't KASLR for hibernation, so set efi_nokaslr to true if "resume=<devname>" is explicitly specified in cmdline. Acked-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: WANG Rui <wangrui@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'include/linux/clk/ssh:/git@git.zx2c4.com')
0 files changed, 0 insertions, 0 deletions