ddf19c
From 38ba55dd27a3b8308f0ce2e82a4c3eba3f197d20 Mon Sep 17 00:00:00 2001
ddf19c
From: Thomas Huth <thuth@redhat.com>
ddf19c
Date: Fri, 29 May 2020 05:53:53 -0400
ddf19c
Subject: [PATCH 11/42] pc-bios/s390x: Fix reset psw mask
ddf19c
ddf19c
RH-Author: Thomas Huth <thuth@redhat.com>
ddf19c
Message-id: <20200529055420.16855-12-thuth@redhat.com>
ddf19c
Patchwork-id: 97034
ddf19c
O-Subject: [RHEL-8.3.0 qemu-kvm PATCH v2 11/38] pc-bios/s390x: Fix reset psw mask
ddf19c
Bugzilla: 1828317
ddf19c
RH-Acked-by: Claudio Imbrenda <cimbrend@redhat.com>
ddf19c
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
ddf19c
RH-Acked-by: David Hildenbrand <david@redhat.com>
ddf19c
ddf19c
From: Janosch Frank <frankja@linux.ibm.com>
ddf19c
ddf19c
We need to set the short psw indication bit in the reset psw, as it is
ddf19c
a short psw.
ddf19c
ddf19c
Exposed by "s390x: Properly fetch and test the short psw on diag308
ddf19c
subc 0/1".
ddf19c
ddf19c
Fixes: 962982329029 ("pc-bios/s390-ccw: do a subsystem reset before running the guest")
ddf19c
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
ddf19c
Message-Id: <20191203132813.2734-5-frankja@linux.ibm.com>
ddf19c
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
ddf19c
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
ddf19c
(cherry picked from commit 5c6f0d5f46a77d77460dfb518cf1e1e4145c276e)
ddf19c
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
ddf19c
---
ddf19c
 pc-bios/s390-ccw/jump2ipl.c | 12 +++++++-----
ddf19c
 1 file changed, 7 insertions(+), 5 deletions(-)
ddf19c
ddf19c
diff --git a/pc-bios/s390-ccw/jump2ipl.c b/pc-bios/s390-ccw/jump2ipl.c
ddf19c
index 266f1502b9..da13c43cc0 100644
ddf19c
--- a/pc-bios/s390-ccw/jump2ipl.c
ddf19c
+++ b/pc-bios/s390-ccw/jump2ipl.c
ddf19c
@@ -12,11 +12,11 @@
ddf19c
 #define KERN_IMAGE_START 0x010000UL
ddf19c
 #define PSW_MASK_64 0x0000000100000000ULL
ddf19c
 #define PSW_MASK_32 0x0000000080000000ULL
ddf19c
-#define IPL_PSW_MASK (PSW_MASK_32 | PSW_MASK_64)
ddf19c
+#define PSW_MASK_SHORTPSW 0x0008000000000000ULL
ddf19c
+#define RESET_PSW_MASK (PSW_MASK_SHORTPSW | PSW_MASK_32 | PSW_MASK_64)
ddf19c
 
ddf19c
 typedef struct ResetInfo {
ddf19c
-    uint32_t ipl_mask;
ddf19c
-    uint32_t ipl_addr;
ddf19c
+    uint64_t ipl_psw;
ddf19c
     uint32_t ipl_continue;
ddf19c
 } ResetInfo;
ddf19c
 
ddf19c
@@ -50,7 +50,9 @@ void jump_to_IPL_code(uint64_t address)
ddf19c
     ResetInfo *current = 0;
ddf19c
 
ddf19c
     save = *current;
ddf19c
-    current->ipl_addr = (uint32_t) (uint64_t) &jump_to_IPL_2;
ddf19c
+
ddf19c
+    current->ipl_psw = (uint64_t) &jump_to_IPL_2;
ddf19c
+    current->ipl_psw |= RESET_PSW_MASK;
ddf19c
     current->ipl_continue = address & 0x7fffffff;
ddf19c
 
ddf19c
     debug_print_int("set IPL addr to", current->ipl_continue);
ddf19c
@@ -82,7 +84,7 @@ void jump_to_low_kernel(void)
ddf19c
     }
ddf19c
 
ddf19c
     /* Trying to get PSW at zero address */
ddf19c
-    if (*((uint64_t *)0) & IPL_PSW_MASK) {
ddf19c
+    if (*((uint64_t *)0) & RESET_PSW_MASK) {
ddf19c
         jump_to_IPL_code((*((uint64_t *)0)) & 0x7fffffff);
ddf19c
     }
ddf19c
 
ddf19c
-- 
ddf19c
2.27.0
ddf19c