[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 12/16] pc-bios: s390x: Save PSW rework
From: |
Thomas Huth |
Subject: |
[PULL 12/16] pc-bios: s390x: Save PSW rework |
Date: |
Tue, 6 Oct 2020 20:31:18 +0200 |
From: Janosch Frank <frankja@linux.ibm.com>
We don't need to save the ipl_continue variable in lowcore and have it
limited to 32 bits because of the lowcore layout. Let's move it to a
new 64 bit variable and get rid of the reset info struct.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20201006094249.50640-3-frankja@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
pc-bios/s390-ccw/jump2ipl.c | 33 +++++++++++++--------------------
1 file changed, 13 insertions(+), 20 deletions(-)
diff --git a/pc-bios/s390-ccw/jump2ipl.c b/pc-bios/s390-ccw/jump2ipl.c
index 767012bf0c..b6aad32def 100644
--- a/pc-bios/s390-ccw/jump2ipl.c
+++ b/pc-bios/s390-ccw/jump2ipl.c
@@ -13,20 +13,17 @@
#define KERN_IMAGE_START 0x010000UL
#define RESET_PSW_MASK (PSW_MASK_SHORTPSW | PSW_MASK_64)
-typedef struct ResetInfo {
- uint64_t ipl_psw;
- uint32_t ipl_continue;
-} ResetInfo;
+static uint64_t *reset_psw = 0, save_psw, ipl_continue;
-static ResetInfo save;
-
-static void jump_to_IPL_2(void)
+static void jump_to_IPL_addr(void)
{
- ResetInfo *current = 0;
+ __attribute__((noreturn)) void (*ipl)(void) = (void *)ipl_continue;
+
+ /* Restore reset PSW */
+ *reset_psw = save_psw;
- void (*ipl)(void) = (void *) (uint64_t) current->ipl_continue;
- *current = save;
- ipl(); /* should not return */
+ ipl();
+ /* should not return */
}
void jump_to_IPL_code(uint64_t address)
@@ -46,15 +43,11 @@ void jump_to_IPL_code(uint64_t address)
* content of non-BIOS memory after we loaded the guest, so we
* save the original content and restore it in jump_to_IPL_2.
*/
- ResetInfo *current = 0;
-
- save = *current;
-
- current->ipl_psw = (uint64_t) &jump_to_IPL_2;
- current->ipl_psw |= RESET_PSW_MASK;
- current->ipl_continue = address & PSW_MASK_SHORT_ADDR;
-
- debug_print_int("set IPL addr to", current->ipl_continue);
+ save_psw = *reset_psw;
+ *reset_psw = (uint64_t) &jump_to_IPL_addr;
+ *reset_psw |= RESET_PSW_MASK;
+ ipl_continue = address;
+ debug_print_int("set IPL addr to", ipl_continue);
/* Ensure the guest output starts fresh */
sclp_print("\n");
--
2.18.2
- [PULL 04/16] pc-bios/s390-ccw: Move the inner logic of find_subch() to a separate function, (continued)
- [PULL 04/16] pc-bios/s390-ccw: Move the inner logic of find_subch() to a separate function, Thomas Huth, 2020/10/06
- [PULL 03/16] pc-bios/s390-ccw: Introduce ENODEV define and remove guards of others, Thomas Huth, 2020/10/06
- [PULL 07/16] pc-bios/s390-ccw: Allow booting in case the first virtio-blk disk is bad, Thomas Huth, 2020/10/06
- [PULL 05/16] pc-bios/s390-ccw: Do not bail out early if not finding a SCSI disk, Thomas Huth, 2020/10/06
- [PULL 10/16] pc-bios/s390-ccw: break loop if a null block number is reached, Thomas Huth, 2020/10/06
- [PULL 06/16] pc-bios/s390-ccw: Scan through all devices if no boot device specified, Thomas Huth, 2020/10/06
- [PULL 09/16] pc-bios/s390-ccw: fix off-by-one error, Thomas Huth, 2020/10/06
- [PULL 11/16] pc-bios: s390x: Fix bootmap.c zipl component entry data handling, Thomas Huth, 2020/10/06
- [PULL 14/16] pc-bios: s390x: Go into disabled wait when encountering a PGM exception, Thomas Huth, 2020/10/06
- [PULL 08/16] pc-bios/s390-ccw/main: Remove superfluous call to enable_subchannel(), Thomas Huth, 2020/10/06
- [PULL 12/16] pc-bios: s390x: Save PSW rework,
Thomas Huth <=
- [PULL 13/16] pc-bios: s390x: Use reset PSW if avaliable, Thomas Huth, 2020/10/06
- [PULL 16/16] tests/qtest/cdrom: Add more s390x-related boot tests, Thomas Huth, 2020/10/06
- [PULL 15/16] pc-bios/s390: Update the s390-ccw bios binaries, Thomas Huth, 2020/10/06
- Re: [PULL 00/16] s390-ccw bios update, Christian Borntraeger, 2020/10/07
- Re: [PULL 00/16] s390-ccw bios update, Peter Maydell, 2020/10/08