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

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