summaryrefslogtreecommitdiff
path: root/arch/s390/kernel/early.c
diff options
context:
space:
mode:
authorVasily Gorbik <gor@linux.ibm.com>2023-02-09 22:05:11 +0100
committerHeiko Carstens <hca@linux.ibm.com>2023-03-20 11:02:51 +0100
commit557b19709da97bc93ea5cf61926ca05800c15a13 (patch)
treef1213e5c5ba017bf3a3f490875cccb5614704793 /arch/s390/kernel/early.c
parente4c31004d3348202d4bc0bcdf662bf9d9d3e11cb (diff)
s390/kasan: move shadow mapping to decompressor
Since regular paging structs are initialized in decompressor already move KASAN shadow mapping to decompressor as well. This helps to avoid allocating KASAN required memory in 1 large chunk, de-duplicate paging structs creation code and start the uncompressed kernel with KASAN instrumentation right away. This also allows to avoid all pitfalls accidentally calling KASAN instrumented code during KASAN initialization. Acked-by: Heiko Carstens <hca@linux.ibm.com> Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'arch/s390/kernel/early.c')
-rw-r--r--arch/s390/kernel/early.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c
index 8225a4c1f2e2..2dd5976a55ac 100644
--- a/arch/s390/kernel/early.c
+++ b/arch/s390/kernel/early.c
@@ -51,6 +51,14 @@ decompressor_handled_param(nokaslr);
decompressor_handled_param(prot_virt);
#endif
+static void __init kasan_early_init(void)
+{
+#ifdef CONFIG_KASAN
+ init_task.kasan_depth = 0;
+ sclp_early_printk("KernelAddressSanitizer initialized\n");
+#endif
+}
+
static void __init reset_tod_clock(void)
{
union tod_clock clk;
@@ -293,6 +301,7 @@ static void __init sort_amode31_extable(void)
void __init startup_init(void)
{
+ kasan_early_init();
reset_tod_clock();
time_early_init();
init_kernel_storage_key();