yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

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

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