[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 13/25] hw/s390x/ipl: Set iplb->len to maximum length of IPL Pa
From: |
Zhuoying Cai |
Subject: |
[PATCH v2 13/25] hw/s390x/ipl: Set iplb->len to maximum length of IPL Parameter Block |
Date: |
Thu, 8 May 2025 18:50:29 -0400 |
The IPL Information Report Block (IIRB) immediately follows the IPL
Parameter Block (IPLB).
The IPLB struct is allocated 4KB in memory, and iplb->len indicates
the amount of memory currently used by the IPLB.
To ensure proper alignment of the IIRB and prevent overlap, set
iplb->len to the maximum length of the IPLB, allowing alignment
constraints to be determined based on its size.
Signed-off-by: Zhuoying Cai <zycai@linux.ibm.com>
---
hw/s390x/ipl.c | 6 +++---
hw/s390x/ipl.h | 1 +
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
index 8ac0cee73d..d1a972ac8d 100644
--- a/hw/s390x/ipl.c
+++ b/hw/s390x/ipl.c
@@ -459,7 +459,7 @@ static bool s390_build_iplb(DeviceState *dev_st,
IplParameterBlock *iplb)
if (scsi_lp && strlen(scsi_lp) > 0) {
lp = scsi_lp;
}
- iplb->len = cpu_to_be32(S390_IPLB_MIN_QEMU_SCSI_LEN);
+ iplb->len = cpu_to_be32(S390_IPLB_MAX_LEN);
iplb->blk0_len =
cpu_to_be32(S390_IPLB_MIN_QEMU_SCSI_LEN -
S390_IPLB_HEADER_LEN);
iplb->pbt = S390_IPL_TYPE_QEMU_SCSI;
@@ -470,14 +470,14 @@ static bool s390_build_iplb(DeviceState *dev_st,
IplParameterBlock *iplb)
iplb->scsi.ssid = ccw_dev->sch->ssid & 3;
break;
case CCW_DEVTYPE_VFIO:
- iplb->len = cpu_to_be32(S390_IPLB_MIN_CCW_LEN);
+ iplb->len = cpu_to_be32(S390_IPLB_MAX_LEN);
iplb->pbt = S390_IPL_TYPE_CCW;
iplb->ccw.devno = cpu_to_be16(ccw_dev->sch->devno);
iplb->ccw.ssid = ccw_dev->sch->ssid & 3;
break;
case CCW_DEVTYPE_VIRTIO_NET:
case CCW_DEVTYPE_VIRTIO:
- iplb->len = cpu_to_be32(S390_IPLB_MIN_CCW_LEN);
+ iplb->len = cpu_to_be32(S390_IPLB_MAX_LEN);
iplb->blk0_len =
cpu_to_be32(S390_IPLB_MIN_CCW_LEN - S390_IPLB_HEADER_LEN);
iplb->pbt = S390_IPL_TYPE_CCW;
diff --git a/hw/s390x/ipl.h b/hw/s390x/ipl.h
index 3e7190c7d8..ed29881dfa 100644
--- a/hw/s390x/ipl.h
+++ b/hw/s390x/ipl.h
@@ -101,6 +101,7 @@ QEMU_BUILD_BUG_MSG(offsetof(S390IPLState, iplb) & 3,
"alignment of iplb wrong");
#define S390_IPLB_MIN_CCW_LEN 200
#define S390_IPLB_MIN_FCP_LEN 384
#define S390_IPLB_MIN_QEMU_SCSI_LEN 200
+#define S390_IPLB_MAX_LEN 4096
static inline bool diag_parm_addr_valid(uint64_t addr, size_t size, bool write)
{
--
2.49.0
- [PATCH v2 02/25] hw/s390x/ipl: Create certificate store, (continued)
- [PATCH v2 02/25] hw/s390x/ipl: Create certificate store, Zhuoying Cai, 2025/05/08
- [PATCH v2 03/25] s390x: Guest support for Certificate Store Facility (CS), Zhuoying Cai, 2025/05/08
- [PATCH v2 04/25] s390x/diag: Introduce DIAG 320 for certificate store facility, Zhuoying Cai, 2025/05/08
- [PATCH v2 05/25] s390x/diag: Refactor address validation check from diag308_parm_check, Zhuoying Cai, 2025/05/08
- [PATCH v2 06/25] s390x/diag: Implement DIAG 320 subcode 1, Zhuoying Cai, 2025/05/08
- [PATCH v2 07/25] s390x/diag: Implement DIAG 320 subcode 2, Zhuoying Cai, 2025/05/08
- [PATCH v2 08/25] s390x/diag: Introduce DIAG 508 for secure IPL operations, Zhuoying Cai, 2025/05/08
- [PATCH v2 09/25] s390x/diag: Implement DIAG 508 subcode 1 for signature verification, Zhuoying Cai, 2025/05/08
- [PATCH v2 10/25] pc-bios/s390-ccw: Introduce IPL Information Report Block (IIRB), Zhuoying Cai, 2025/05/08
- [PATCH v2 12/25] hw/s390x/ipl: Add IPIB flags to IPL Parameter Block, Zhuoying Cai, 2025/05/08
- [PATCH v2 13/25] hw/s390x/ipl: Set iplb->len to maximum length of IPL Parameter Block,
Zhuoying Cai <=
- [PATCH v2 11/25] pc-bios/s390-ccw: Define memory for IPLB and convert IPLB to pointers, Zhuoying Cai, 2025/05/08
- [PATCH v2 14/25] s390x: Guest support for Secure-IPL Facility, Zhuoying Cai, 2025/05/08
- [PATCH v2 15/25] pc-bios/s390-ccw: Refactor zipl_run(), Zhuoying Cai, 2025/05/08
- [PATCH v2 16/25] pc-bios/s390-ccw: Refactor zipl_load_segment function, Zhuoying Cai, 2025/05/08
- [PATCH v2 17/25] pc-bios/s390-ccw: Add signature verification for secure IPL in audit mode, Zhuoying Cai, 2025/05/08
- [PATCH v2 18/25] s390x: Guest support for Secure-IPL Code Loading Attributes Facility (SCLAF), Zhuoying Cai, 2025/05/08
- [PATCH v2 19/25] pc-bios/s390-ccw: Add additional security checks for secure boot, Zhuoying Cai, 2025/05/08
- [PATCH v2 20/25] Add -secure-boot to s390-ccw-virtio machine type option, Zhuoying Cai, 2025/05/08
- [PATCH v2 21/25] hw/s390x/ipl: Set IPIB flags for secure IPL, Zhuoying Cai, 2025/05/08
- [PATCH v2 22/25] pc-bios/s390-ccw: Handle true secure IPL mode, Zhuoying Cai, 2025/05/08