diff options
author | Jinyang He <hejinyang@loongson.cn> | 2021-02-05 18:11:21 +0800 |
---|---|---|
committer | Thomas Bogendoerfer <tsbogend@alpha.franken.de> | 2021-02-09 10:54:29 +0100 |
commit | d4d3ef8b347b73aa60f60f4be06acf1643e79f34 (patch) | |
tree | 942b434f91b73a89a870d0df4d4116bcb5965cf9 /arch/mips/include/asm/page.h | |
parent | 1ddc96bd42daeeb58f66c9515e506f245ccb00c6 (diff) | |
download | linux-d4d3ef8b347b73aa60f60f4be06acf1643e79f34.tar.bz2 |
MIPS: relocatable: Provide kaslr_offset() to get the kernel offset
Provide kaslr_offset() to get the kernel offset when KASLR is enabled.
Error may occur before update_kaslr_offset(), so put it at the end of
the offset branch.
Fixes: a307a4ce9ecd ("MIPS: Loongson64: Add KASLR support")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Jinyang He <hejinyang@loongson.cn>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Diffstat (limited to 'arch/mips/include/asm/page.h')
-rw-r--r-- | arch/mips/include/asm/page.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h index 6a77bc4a6eec..74082e35d57c 100644 --- a/arch/mips/include/asm/page.h +++ b/arch/mips/include/asm/page.h @@ -255,6 +255,12 @@ extern bool __virt_addr_valid(const volatile void *kaddr); #define VM_DATA_DEFAULT_FLAGS VM_DATA_FLAGS_TSK_EXEC +extern unsigned long __kaslr_offset; +static inline unsigned long kaslr_offset(void) +{ + return __kaslr_offset; +} + #include <asm-generic/memory_model.h> #include <asm-generic/getorder.h> |