]> git.dujemihanovic.xyz Git - linux.git/commitdiff
s390/boot: disable Secure Execution in dump mode
authorAlexander Egorenkov <egorenar@linux.ibm.com>
Mon, 5 Jul 2021 17:37:25 +0000 (19:37 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Tue, 27 Jul 2021 07:39:14 +0000 (09:39 +0200)
A dump kernel is neither required nor able to support Secure Execution.

Signed-off-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Reviewed-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/boot/startup.c
arch/s390/boot/uv.c
arch/s390/boot/uv.h

index e4ebebfd1bbb2ce2379427fa015f77cf67286597..8b07a704f2f51c86665837a1242ea1b01212a140 100644 (file)
@@ -292,6 +292,7 @@ void startup_kernel(void)
        sclp_early_read_info();
        setup_boot_command_line();
        parse_boot_command_line();
+       sanitize_prot_virt_host();
        setup_ident_map_size(detect_memory());
        setup_vmalloc_size();
        setup_kernel_memory_layout();
index 3156f78b136a0b398ffa767a0fed9cdeb58a1289..5aea68d6d75de07688907a8d3f1c21af64f6d02d 100644 (file)
@@ -1,8 +1,10 @@
 // SPDX-License-Identifier: GPL-2.0
 #include <asm/uv.h>
+#include <asm/boot_data.h>
 #include <asm/facility.h>
 #include <asm/sections.h>
 
+#include "boot.h"
 #include "uv.h"
 
 /* will be used in arch/s390/kernel/uv.c */
@@ -71,4 +73,10 @@ void adjust_to_uv_max(unsigned long *vmax)
        if (has_uv_sec_stor_limit())
                *vmax = min_t(unsigned long, *vmax, uv_info.max_sec_stor_addr);
 }
+
+void sanitize_prot_virt_host(void)
+{
+       if (OLDMEM_BASE || (ipl_block_valid && is_ipl_block_dump()))
+               prot_virt_host = 0;
+}
 #endif
index 2992f960fd570146921f9600b9abf66180b8e000..690ce019af5ae12026e82fd7438b15903c01ceb1 100644 (file)
@@ -4,8 +4,10 @@
 
 #if IS_ENABLED(CONFIG_KVM)
 void adjust_to_uv_max(unsigned long *vmax);
+void sanitize_prot_virt_host(void);
 #else
 static inline void adjust_to_uv_max(unsigned long *vmax) {}
+static inline void sanitize_prot_virt_host(void) {}
 #endif
 
 #if defined(CONFIG_PROTECTED_VIRTUALIZATION_GUEST) || IS_ENABLED(CONFIG_KVM)