Blame SOURCES/kvm-pc-bios-s390x-Use-PSW-masks-where-possible-and-intro.patch

a19a21
From 35891c9334058c02f3ee83eee1a986802387c18b Mon Sep 17 00:00:00 2001
a19a21
From: Thomas Huth <thuth@redhat.com>
a19a21
Date: Thu, 10 Dec 2020 08:32:39 -0500
a19a21
Subject: [PATCH 3/5] pc-bios: s390x: Use PSW masks where possible and
a19a21
 introduce PSW_MASK_SHORT_ADDR
a19a21
a19a21
RH-Author: Thomas Huth <thuth@redhat.com>
a19a21
Message-id: <20201210083241.173509-3-thuth@redhat.com>
a19a21
Patchwork-id: 100371
a19a21
O-Subject: [RHEL-8.4.0 qemu-kvm PATCH 2/4] pc-bios: s390x: Use PSW masks where possible and introduce PSW_MASK_SHORT_ADDR
a19a21
Bugzilla: 1903135
a19a21
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
a19a21
RH-Acked-by: Jens Freimann <jfreimann@redhat.com>
a19a21
RH-Acked-by: David Hildenbrand <david@redhat.com>
a19a21
a19a21
From: Janosch Frank <frankja@linux.ibm.com>
a19a21
a19a21
Let's move some of the PSW mask defines into s390-arch.h and use them
a19a21
in jump2ipl.c. Also let's introduce a new constant for the address
a19a21
mask of 8 byte (short) PSWs.
a19a21
a19a21
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
a19a21
Reviewed-by: David Hildenbrand <david@redhat.com>
a19a21
Reviewed-by: Thomas Huth <thuth@redhat.com>
a19a21
Message-Id: <20200624075226.92728-8-frankja@linux.ibm.com>
a19a21
Signed-off-by: Thomas Huth <thuth@redhat.com>
a19a21
(cherry picked from commit fe75c657b8ee962da79f5d3518b139e26dc69c24)
a19a21
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
a19a21
---
a19a21
 pc-bios/s390-ccw/jump2ipl.c  | 10 ++++------
a19a21
 pc-bios/s390-ccw/s390-arch.h |  2 ++
a19a21
 2 files changed, 6 insertions(+), 6 deletions(-)
a19a21
a19a21
diff --git a/pc-bios/s390-ccw/jump2ipl.c b/pc-bios/s390-ccw/jump2ipl.c
a19a21
index 4eba2510b04..767012bf0c9 100644
a19a21
--- a/pc-bios/s390-ccw/jump2ipl.c
a19a21
+++ b/pc-bios/s390-ccw/jump2ipl.c
a19a21
@@ -8,12 +8,10 @@
a19a21
 
a19a21
 #include "libc.h"
a19a21
 #include "s390-ccw.h"
a19a21
+#include "s390-arch.h"
a19a21
 
a19a21
 #define KERN_IMAGE_START 0x010000UL
a19a21
-#define PSW_MASK_64 0x0000000100000000ULL
a19a21
-#define PSW_MASK_32 0x0000000080000000ULL
a19a21
-#define PSW_MASK_SHORTPSW 0x0008000000000000ULL
a19a21
-#define RESET_PSW_MASK (PSW_MASK_SHORTPSW | PSW_MASK_32 | PSW_MASK_64)
a19a21
+#define RESET_PSW_MASK (PSW_MASK_SHORTPSW | PSW_MASK_64)
a19a21
 
a19a21
 typedef struct ResetInfo {
a19a21
     uint64_t ipl_psw;
a19a21
@@ -54,7 +52,7 @@ void jump_to_IPL_code(uint64_t address)
a19a21
 
a19a21
     current->ipl_psw = (uint64_t) &jump_to_IPL_2;
a19a21
     current->ipl_psw |= RESET_PSW_MASK;
a19a21
-    current->ipl_continue = address & 0x7fffffff;
a19a21
+    current->ipl_continue = address & PSW_MASK_SHORT_ADDR;
a19a21
 
a19a21
     debug_print_int("set IPL addr to", current->ipl_continue);
a19a21
 
a19a21
@@ -86,7 +84,7 @@ void jump_to_low_kernel(void)
a19a21
 
a19a21
     /* Trying to get PSW at zero address */
a19a21
     if (*((uint64_t *)0) & RESET_PSW_MASK) {
a19a21
-        jump_to_IPL_code((*((uint64_t *)0)) & 0x7fffffff);
a19a21
+        jump_to_IPL_code((*((uint64_t *)0)) & PSW_MASK_SHORT_ADDR);
a19a21
     }
a19a21
 
a19a21
     /* No other option left, so use the Linux kernel start address */
a19a21
diff --git a/pc-bios/s390-ccw/s390-arch.h b/pc-bios/s390-ccw/s390-arch.h
a19a21
index 73852029d4e..6da44d4436c 100644
a19a21
--- a/pc-bios/s390-ccw/s390-arch.h
a19a21
+++ b/pc-bios/s390-ccw/s390-arch.h
a19a21
@@ -26,9 +26,11 @@ _Static_assert(sizeof(struct PSWLegacy) == 8, "PSWLegacy size incorrect");
a19a21
 
a19a21
 /* s390 psw bit masks */
a19a21
 #define PSW_MASK_IOINT      0x0200000000000000ULL
a19a21
+#define PSW_MASK_SHORTPSW   0x0008000000000000ULL
a19a21
 #define PSW_MASK_WAIT       0x0002000000000000ULL
a19a21
 #define PSW_MASK_EAMODE     0x0000000100000000ULL
a19a21
 #define PSW_MASK_BAMODE     0x0000000080000000ULL
a19a21
+#define PSW_MASK_SHORT_ADDR 0x000000007fffffffULL
a19a21
 #define PSW_MASK_64         (PSW_MASK_EAMODE | PSW_MASK_BAMODE)
a19a21
 
a19a21
 /* Low core mapping */
a19a21
-- 
a19a21
2.27.0
a19a21