From: Felix Fu fuzhen5@huawei.com
Offering: HULK hulk inclusion category: feature bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAI881
-----------------------------------------
This reverts commit d29736d398ca69516e102766c691edb356faffb5.
Signed-off-by: Felix Fu fuzhen5@huawei.com --- arch/arm/include/asm/memory.h | 14 -------------- arch/arm/kernel/head.S | 6 +++--- arch/arm/kernel/setup.c | 31 ------------------------------- 3 files changed, 3 insertions(+), 48 deletions(-)
diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h index 11bf7814fb93..ef2aa79ece5a 100644 --- a/arch/arm/include/asm/memory.h +++ b/arch/arm/include/asm/memory.h @@ -171,20 +171,6 @@ extern unsigned long vectors_base; extern u64 kernel_sec_start; extern u64 kernel_sec_end;
-#ifdef CONFIG_RANDOMIZE_BASE -extern unsigned long __kaslr_offset; - -static inline unsigned long kaslr_offset(void) -{ - return __kaslr_offset; -} -#else -static inline unsigned long kaslr_offset(void) -{ - return 0; -} -#endif - /* * Physical vs virtual RAM address space conversion. These are * private definitions which should NOT be used outside memory.h diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index 9da384ff7c8a..13a84864d771 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S @@ -119,11 +119,11 @@ ENTRY(stext) #ifdef CONFIG_RANDOMIZE_BASE str_l r3, __kaslr_offset, r9 @ offset in r3 if entered via kaslr ep
- .pushsection .data @ data in bss will be cleared + .section ".bss", "aw", %nobits .align 2 -ENTRY(__kaslr_offset) +__kaslr_offset: .long 0 @ will be wiped before entering C code - .popsection + .previous #endif
#ifdef CONFIG_ARM_VIRT_EXT diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 5cfc9c5056a7..c66b560562b3 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -60,7 +60,6 @@ #include <asm/memblock.h> #include <asm/virt.h> #include <asm/kasan.h> -#include <linux/panic_notifier.h>
#include "atags.h"
@@ -1360,33 +1359,3 @@ const struct seq_operations cpuinfo_op = { .stop = c_stop, .show = c_show }; - -/* - * Dump out kernel offset information on panic. - */ -static int dump_kernel_offset(struct notifier_block *self, unsigned long v, - void *p) -{ - const unsigned long offset = kaslr_offset(); - - if (IS_ENABLED(CONFIG_RANDOMIZE_BASE) && offset > 0) { - pr_emerg("Kernel Offset: 0x%lx from 0x%lx\n", - offset, PAGE_OFFSET); - - } else { - pr_emerg("Kernel Offset: disabled\n"); - } - return 0; -} - -static struct notifier_block kernel_offset_notifier = { - .notifier_call = dump_kernel_offset -}; - -static int __init register_kernel_offset_dumper(void) -{ - atomic_notifier_chain_register(&panic_notifier_list, - &kernel_offset_notifier); - return 0; -} -__initcall(register_kernel_offset_dumper);