[SRU][H][F][PATCH 2/2] s390/uv: fix prot virt host indication compilation

frank.heimes at canonical.com frank.heimes at canonical.com
Wed Aug 4 12:19:39 UTC 2021

From: Janosch Frank <frankja at linux.ibm.com>

BugLink: https://bugs.launchpad.net/bugs/1933173

prot_virt_host is only available if CONFIG_KVM is enabled. So lets use
a variable initialized to zero and overwrite it when that config
option is set with prot_virt_host.

Signed-off-by: Janosch Frank <frankja at linux.ibm.com>
Fixes: 37564ed834ac ("s390/uv: add prot virt guest/host indication files")
Reported-by: kernel test robot <lkp at intel.com>
Signed-off-by: Heiko Carstens <hca at linux.ibm.com>
(cherry picked from commit df2e400e07ad53a582ee934ce8384479d5ddf48b)
Signed-off-by: Frank Heimes <frank.heimes at canonical.com>
 arch/s390/kernel/uv.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/s390/kernel/uv.c b/arch/s390/kernel/uv.c
index 1db237b6a4b7..f9e2b4d024bf 100644
--- a/arch/s390/kernel/uv.c
+++ b/arch/s390/kernel/uv.c
@@ -396,7 +396,13 @@ static ssize_t uv_is_prot_virt_guest(struct kobject *kobj,
 static ssize_t uv_is_prot_virt_host(struct kobject *kobj,
 				    struct kobj_attribute *attr, char *page)
-	return scnprintf(page, PAGE_SIZE, "%d\n", prot_virt_host);
+	int val = 0;
+	val = prot_virt_host;
+	return scnprintf(page, PAGE_SIZE, "%d\n", val);
 static struct kobj_attribute uv_prot_virt_guest =

More information about the kernel-team mailing list