Hi,
On 23/10/24 15:17, Thomas Huth wrote:
From: Jared Rossi <jro...@linux.ibm.com>
Build an IPLB for any device with a bootindex (up to a maximum of 8 devices).
The IPLB chain is placed immediately before the BIOS in memory. Because this
is not a fixed address, the location of the next IPLB and number of remaining
boot devices is stored in the QIPL global variable for possible later access by
the guest during IPL.
Signed-off-by: Jared Rossi <jro...@linux.ibm.com>
Reviewed-by: Thomas Huth <th...@redhat.com>
Message-ID: <20241020012953.1380075-16-jro...@linux.ibm.com>
[thuth: Fix endianness problem when accessing the qipl structure]
Signed-off-by: Thomas Huth <th...@redhat.com>
---
hw/s390x/ipl.h | 1 +
include/hw/s390x/ipl/qipl.h | 4 +-
hw/s390x/ipl.c | 129 ++++++++++++++++++++++++++++--------
3 files changed, 105 insertions(+), 29 deletions(-)
diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
index 656996b500..b9d741d0b0 100644
--- a/hw/s390x/ipl.c
+++ b/hw/s390x/ipl.c
+static uint64_t s390_ipl_map_iplb_chain(IplParameterBlock *iplb_chain)
+{
+ S390IPLState *ipl = get_ipl_device();
+ uint16_t count = be16_to_cpu(ipl->qipl.chain_len);
+ uint64_t len = sizeof(IplParameterBlock) * count;
+ uint64_t chain_addr = find_iplb_chain_addr(ipl->bios_start_addr, count);
+
+ cpu_physical_memory_write(chain_addr, iplb_chain, len);
This patch introduces a call to a legacy API (documented since at least
2017 in commit b7ecba0f6f6: "docs/devel/loads-stores.rst: Document our
various load and store APIs"). Can we access the device address space
instead?
+ return chain_addr;
+}