Skip to content

Commit

Permalink
arm64: adjust KASLR relocation after ARCH_RANDOM removal
Browse files Browse the repository at this point in the history
Commit aacd149 ("arm64: head: avoid relocating the kernel twice for
KASLR") adds the new file arch/arm64/kernel/pi/kaslr_early.c with a small
code part guarded by '#ifdef CONFIG_ARCH_RANDOM'.

Concurrently, commit 9592eef ("random: remove CONFIG_ARCH_RANDOM")
removes the config CONFIG_ARCH_RANDOM and turns all '#ifdef
CONFIG_ARCH_RANDOM' code parts into unconditional code parts, which is
generally safe to do.

Remove a needless ifdef guard after the ARCH_RANDOM removal.

Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20220721100433.18286-1-lukas.bulwahn@gmail.com
Signed-off-by: Will Deacon <will@kernel.org>
  • Loading branch information
Lukas Bulwahn authored and Will Deacon committed Aug 17, 2022
1 parent 5e1e087 commit ff59000
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions arch/arm64/kernel/pi/kaslr_early.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,9 @@ asmlinkage u64 kaslr_early_init(void *fdt)

seed = get_kaslr_seed(fdt);
if (!seed) {
#ifdef CONFIG_ARCH_RANDOM
if (!__early_cpu_has_rndr() ||
!__arm64_rndr((unsigned long *)&seed))
#endif
return 0;
if (!__early_cpu_has_rndr() ||
!__arm64_rndr((unsigned long *)&seed))
return 0;
}

/*
Expand Down

0 comments on commit ff59000

Please sign in to comment.