Consolidate PSW masks

While at it, rename PSW_SHORT_ADDR_MASK and PSW_ADDRESS_MASK to
PSW32_ADDR_MASK. As a side effect this removes the zipl.h dependency
of the boot loaders. While at it,

Reviewed-by: Philipp Rudo <prudo@linux.ibm.com>
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Marc Hartmayer
2020-03-23 12:26:57 +01:00
committed by Jan Höppner
parent eb4e806cdc
commit 93a0cb254e
8 changed files with 15 additions and 16 deletions
+1 -5
View File
@@ -6,6 +6,7 @@
#include <glib/gi18n-lib.h>
#include "boot/linux_layout.h"
#include "boot/s390.h"
#include "lib/zt_common.h"
static const gchar tool_name[] = "genprotimg";
@@ -15,11 +16,6 @@ static const gchar copyright_notice[] = "Copyright IBM Corp. 2020";
#define GENPROTIMG_STAGE3A_PATH (STRINGIFY(PKGDATADIR) "/stage3a.bin")
#define GENPROTIMG_STAGE3B_PATH (STRINGIFY(PKGDATADIR) "/stage3b_reloc.bin")
#define PSW_SHORT_ADDR_MASK 0x000000007FFFFFFFULL
#define PSW_MASK_BA 0x0000000080000000ULL
#define PSW_MASK_EA 0x0000000100000000ULL
#define PSW_MASK_BIT_12 0x0008000000000000ULL
#define DEFAULT_INITIAL_PSW_ADDR IMAGE_ENTRY
#define DEFAULT_INITIAL_PSW_MASK (PSW_MASK_EA | PSW_MASK_BA)
+3 -2
View File
@@ -14,6 +14,7 @@
#include <stdlib.h>
#include <string.h>
#include "boot/s390.h"
#include "boot/stage3a.h"
#include "common.h"
#include "include/pv_crypto_def.h"
@@ -741,7 +742,7 @@ static gint convert_psw_to_short_psw(const struct psw_t *psw, uint64_t *dst,
uint64_t psw_mask = psw->mask;
/* test if PSW mask can be converted */
if (psw_mask & PSW_SHORT_ADDR_MASK) {
if (psw_mask & PSW32_ADDR_MASK) {
g_set_error(err, PV_ERROR, PV_ERROR_INTERNAL,
_("Failed to convert PSW to short PSW"));
return -1;
@@ -755,7 +756,7 @@ static gint convert_psw_to_short_psw(const struct psw_t *psw, uint64_t *dst,
}
/* test if PSW addr can be converted */
if (psw_addr & ~PSW_SHORT_ADDR_MASK) {
if (psw_addr & ~PSW32_ADDR_MASK) {
g_set_error(err, PV_ERROR, PV_ERROR_INTERNAL,
_("Failed to convert PSW to short PSW"));
return -1;