]> git.dujemihanovic.xyz Git - linux.git/commitdiff
s390/sclp: reserve memory occupied by sclp early buffer
authorAlexander Egorenkov <egorenar@linux.ibm.com>
Tue, 10 Aug 2021 13:20:00 +0000 (15:20 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Wed, 18 Aug 2021 08:01:29 +0000 (10:01 +0200)
The memory block occupied by the SCLP early buffer that is allocated
by the decompressor and then handed over to the decompressed kernel,
must be reserved to prevent it from being reused for other purposes.
This is necessary because the SCLP early buffer is still in use
during kernel initialization.

Fixes: f1d3c5323772 ("s390/boot: move sclp early buffer from fixed address in asm to C")
Signed-off-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Reported-by: Alexander Gordeev <agordeev@linux.ibm.com>
Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/include/asm/sclp.h
arch/s390/kernel/setup.c
drivers/s390/char/sclp.h

index 835adb85b01651b3b60e9ad9f6cd4750e676bce1..e3ae937bef1c6e6bd6fcaeada43e652bdf774a5f 100644 (file)
@@ -115,6 +115,8 @@ struct zpci_report_error_header {
        u8 data[0];     /* Subsequent Data passed verbatim to SCLP ET 24 */
 } __packed;
 
+extern char *sclp_early_sccb;
+
 void sclp_early_set_buffer(void *sccb);
 int sclp_early_read_info(void);
 int sclp_early_read_storage_info(void);
index 3364ebfae21568e9fb48c21e03c44cabb35e0214..f46f12aebceb1adce854b76d962f90cb5dacc689 100644 (file)
@@ -793,6 +793,7 @@ static void __init reserve_kernel(void)
        unsigned long start_pfn = PFN_UP(__pa(_end));
 
        memblock_reserve(0, STARTUP_NORMAL_OFFSET);
+       memblock_reserve((unsigned long)sclp_early_sccb, EXT_SCCB_READ_SCP);
        memblock_reserve((unsigned long)_stext, PFN_PHYS(start_pfn)
                         - (unsigned long)_stext);
 }
index 8dd8ad83b78b20722a81b4949886a011fd51f812..5e434108aae6aa3d74e2ab2becf2830875e8ad29 100644 (file)
@@ -310,8 +310,6 @@ extern int sclp_console_drop;
 extern unsigned long sclp_console_full;
 extern bool sclp_mask_compat_mode;
 
-extern char *sclp_early_sccb;
-
 void sclp_early_wait_irq(void);
 int sclp_early_cmd(sclp_cmdw_t cmd, void *sccb);
 unsigned int sclp_early_con_check_linemode(struct init_sccb *sccb);