From: Janosch Frank <frankja@linux.ibm.com>
To: qemu-devel@nongnu.org
Cc: borntraeger@de.ibm.com, thuth@redhat.com, cohuck@redhat.com,
david@redhat.com
Subject: [PATCH v3 2/5] pc-bios: s390x: Save PSW rework
Date: Mon, 31 Aug 2020 11:09:07 -0400 [thread overview]
Message-ID: <20200831150910.317171-3-frankja@linux.ibm.com> (raw)
In-Reply-To: <20200831150910.317171-1-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>
---
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;
- void (*ipl)(void) = (void *) (uint64_t) current->ipl_continue;
- *current = save;
- ipl(); /* should not return */
+ /* Restore reset PSW */
+ *reset_psw = save_psw;
+
+ 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.25.1
next prev parent reply other threads:[~2020-08-31 15:10 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-31 15:09 [PATCH v3 0/5] pc-bios: s390x: Cleanup part 2 Janosch Frank
2020-08-31 15:09 ` [PATCH v3 1/5] pc-bios: s390x: Fix bootmap.c zipl component entry data handling Janosch Frank
2020-08-31 15:09 ` Janosch Frank [this message]
2020-08-31 15:27 ` [PATCH v3 2/5] pc-bios: s390x: Save PSW rework Thomas Huth
2020-08-31 15:09 ` [PATCH v3 3/5] pc-bios: s390x: Use reset PSW if avaliable Janosch Frank
2020-09-01 16:59 ` Thomas Huth
2020-09-02 8:46 ` Janosch Frank
2020-09-02 9:50 ` Thomas Huth
2020-08-31 15:09 ` [PATCH v3 4/5] pc-bios: s390x: Save io and external new PSWs before overwriting them Janosch Frank
2020-09-01 17:22 ` Thomas Huth
2020-09-02 10:30 ` Janosch Frank
2020-09-02 16:55 ` Thomas Huth
2020-08-31 15:09 ` [PATCH v3 5/5] pc-bios: s390x: Go into disabled wait when encountering a PGM exception Janosch Frank
2020-09-01 17:24 ` Thomas Huth
2020-08-31 18:31 ` [PATCH v3 0/5] pc-bios: s390x: Cleanup part 2 no-reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200831150910.317171-3-frankja@linux.ibm.com \
--to=frankja@linux.ibm.com \
--cc=borntraeger@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=david@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).