From 2154e0b3282d0029ea7790a8414d61d5dc7d72ff Mon Sep 17 00:00:00 2001 From: Alexander Gordeev Date: Mon, 19 Dec 2022 21:08:27 +0100 Subject: s390/mm: allocate Absolute Lowcore Area in decompressor Move Absolute Lowcore Area allocation to the decompressor. As result, get_abs_lowcore() and put_abs_lowcore() access brackets become really straight and do not require complex execution context analysis and LAP and interrupts tackling. Reviewed-by: Heiko Carstens Signed-off-by: Alexander Gordeev Signed-off-by: Heiko Carstens --- arch/s390/boot/boot.h | 2 ++ arch/s390/boot/vmem.c | 6 ++++++ 2 files changed, 8 insertions(+) (limited to 'arch/s390/boot') diff --git a/arch/s390/boot/boot.h b/arch/s390/boot/boot.h index 547614496e7e..8abedae76e53 100644 --- a/arch/s390/boot/boot.h +++ b/arch/s390/boot/boot.h @@ -66,5 +66,7 @@ extern unsigned char _compressed_end[]; extern struct vmlinux_info _vmlinux_info; #define vmlinux _vmlinux_info +#define __abs_lowcore_pa(x) (((unsigned long)(x) - __abs_lowcore) % sizeof(struct lowcore)) + #endif /* __ASSEMBLY__ */ #endif /* BOOT_BOOT_H */ diff --git a/arch/s390/boot/vmem.c b/arch/s390/boot/vmem.c index 41ff38a0e2dd..3bcef4fcea80 100644 --- a/arch/s390/boot/vmem.c +++ b/arch/s390/boot/vmem.c @@ -6,6 +6,7 @@ #include #include #include +#include #include "decompressor.h" #include "boot.h" @@ -29,6 +30,7 @@ unsigned long __bootdata(pgalloc_low); enum populate_mode { POPULATE_NONE, POPULATE_ONE2ONE, + POPULATE_ABS_LOWCORE, }; static void boot_check_oom(void) @@ -102,6 +104,8 @@ static unsigned long _pa(unsigned long addr, enum populate_mode mode) return -1; case POPULATE_ONE2ONE: return addr; + case POPULATE_ABS_LOWCORE: + return __abs_lowcore_pa(addr); default: return -1; } @@ -271,6 +275,8 @@ void setup_vmem(unsigned long online_end, unsigned long asce_limit) pgtable_populate_begin(online_end); pgtable_populate(0, sizeof(struct lowcore), POPULATE_ONE2ONE); pgtable_populate(0, online_end, POPULATE_ONE2ONE); + pgtable_populate(__abs_lowcore, __abs_lowcore + sizeof(struct lowcore), + POPULATE_ABS_LOWCORE); pgtable_populate(__memcpy_real_area, __memcpy_real_area + PAGE_SIZE, POPULATE_NONE); memcpy_real_ptep = __virt_to_kpte(__memcpy_real_area); -- cgit v1.2.3