From: Alexander Egorenkov Date: Mon, 5 Jul 2021 17:37:25 +0000 (+0200) Subject: s390/boot: disable Secure Execution in dump mode X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=42c89439b9fa0368fabd4e1564bdb4a05aeed7eb;p=linux.git s390/boot: disable Secure Execution in dump mode A dump kernel is neither required nor able to support Secure Execution. Signed-off-by: Alexander Egorenkov Reviewed-by: Vasily Gorbik Signed-off-by: Heiko Carstens --- diff --git a/arch/s390/boot/startup.c b/arch/s390/boot/startup.c index e4ebebfd1bbb2..8b07a704f2f51 100644 --- a/arch/s390/boot/startup.c +++ b/arch/s390/boot/startup.c @@ -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(); diff --git a/arch/s390/boot/uv.c b/arch/s390/boot/uv.c index 3156f78b136a0..5aea68d6d75de 100644 --- a/arch/s390/boot/uv.c +++ b/arch/s390/boot/uv.c @@ -1,8 +1,10 @@ // SPDX-License-Identifier: GPL-2.0 #include +#include #include #include +#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 diff --git a/arch/s390/boot/uv.h b/arch/s390/boot/uv.h index 2992f960fd570..690ce019af5ae 100644 --- a/arch/s390/boot/uv.h +++ b/arch/s390/boot/uv.h @@ -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)