summaryrefslogtreecommitdiffstats
path: root/arch/s390/boot
diff options
context:
space:
mode:
authorAlexander Gordeev <agordeev@linux.ibm.com>2022-12-19 21:08:27 +0100
committerHeiko Carstens <hca@linux.ibm.com>2023-01-13 14:15:06 +0100
commit2154e0b3282d0029ea7790a8414d61d5dc7d72ff (patch)
tree4dcd6085f7402a5a21d2e007fcbf1ef301b5020f /arch/s390/boot
parents390/mm: allocate Real Memory Copy Area in decompressor (diff)
downloadlinux-2154e0b3282d0029ea7790a8414d61d5dc7d72ff.tar.xz
linux-2154e0b3282d0029ea7790a8414d61d5dc7d72ff.zip
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 <hca@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'arch/s390/boot')
-rw-r--r--arch/s390/boot/boot.h2
-rw-r--r--arch/s390/boot/vmem.c6
2 files changed, 8 insertions, 0 deletions
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 <asm/sections.h>
#include <asm/mem_detect.h>
#include <asm/maccess.h>
+#include <asm/abs_lowcore.h>
#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);