diff options
author | Heiko Carstens <hca@linux.ibm.com> | 2023-03-31 15:03:22 +0200 |
---|---|---|
committer | Vasily Gorbik <gor@linux.ibm.com> | 2023-04-13 17:36:25 +0200 |
commit | bb87190c9d46c4285696e071d5972a534bb107cc (patch) | |
tree | 0e260e3dbbc87443854a8eadd665db921db8f516 /arch/s390/include/asm | |
parent | 11018ef90ce73d9de8ac6e565c00cc8631b46328 (diff) | |
download | linux-bb87190c9d46c4285696e071d5972a534bb107cc.tar.gz |
s390/kaslr: provide kaslr_enabled() function
Just like other architectures provide a kaslr_enabled() function, instead
of directly accessing a global variable.
Also pass the renamed __kaslr_enabled variable from the decompressor to the
kernel, so that kalsr_enabled() is available there too. This will be used
by a subsequent patch which randomizes the module base load address.
Reviewed-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch/s390/include/asm')
-rw-r--r-- | arch/s390/include/asm/setup.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/s390/include/asm/setup.h b/arch/s390/include/asm/setup.h index b28d250efbaa..f191255c60db 100644 --- a/arch/s390/include/asm/setup.h +++ b/arch/s390/include/asm/setup.h @@ -146,6 +146,13 @@ static inline unsigned long kaslr_offset(void) return __kaslr_offset; } +extern int __kaslr_enabled; +static inline int kaslr_enabled(void) +{ + if (IS_ENABLED(CONFIG_RANDOMIZE_BASE)) + return __kaslr_enabled; + return 0; +} struct oldmem_data { unsigned long start; |