pc-bios: s390x: Save PSW rework

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>
This commit is contained in:
Janosch Frank 2020-10-06 05:42:47 -04:00 committed by Thomas Huth
parent 4906a4e41c
commit 26e0b96fa9
1 changed files with 13 additions and 20 deletions

View File

@ -13,20 +13,17 @@
#define KERN_IMAGE_START 0x010000UL #define KERN_IMAGE_START 0x010000UL
#define RESET_PSW_MASK (PSW_MASK_SHORTPSW | PSW_MASK_64) #define RESET_PSW_MASK (PSW_MASK_SHORTPSW | PSW_MASK_64)
typedef struct ResetInfo { static uint64_t *reset_psw = 0, save_psw, ipl_continue;
uint64_t ipl_psw;
uint32_t ipl_continue;
} ResetInfo;
static ResetInfo save; static void jump_to_IPL_addr(void)
static void jump_to_IPL_2(void)
{ {
ResetInfo *current = 0; __attribute__((noreturn)) void (*ipl)(void) = (void *)ipl_continue;
void (*ipl)(void) = (void *) (uint64_t) current->ipl_continue; /* Restore reset PSW */
*current = save; *reset_psw = save_psw;
ipl(); /* should not return */
ipl();
/* should not return */
} }
void jump_to_IPL_code(uint64_t address) 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 * content of non-BIOS memory after we loaded the guest, so we
* save the original content and restore it in jump_to_IPL_2. * save the original content and restore it in jump_to_IPL_2.
*/ */
ResetInfo *current = 0; save_psw = *reset_psw;
*reset_psw = (uint64_t) &jump_to_IPL_addr;
save = *current; *reset_psw |= RESET_PSW_MASK;
ipl_continue = address;
current->ipl_psw = (uint64_t) &jump_to_IPL_2; debug_print_int("set IPL addr to", ipl_continue);
current->ipl_psw |= RESET_PSW_MASK;
current->ipl_continue = address & PSW_MASK_SHORT_ADDR;
debug_print_int("set IPL addr to", current->ipl_continue);
/* Ensure the guest output starts fresh */ /* Ensure the guest output starts fresh */
sclp_print("\n"); sclp_print("\n");