From d8e5bbdd0d6fa8d9b5ac15de62c87105d92ff558 Mon Sep 17 00:00:00 2001 From: Eric Farman Date: Fri, 20 Nov 2020 17:01:16 +0100 Subject: pc-bios: s390x: Ensure Read IPL memory is clean If, for example, we boot off a virtio device and chreipl to a vfio-ccw device, the space at lowcore will be non-zero. We build a Read IPL CCW at address zero, but it will have leftover PSW data that will conflict with the Format-0 CCW being generated: 0x0: 00080000 80010000 ------ Ccw0.cda -- Ccw0.chainData -- Reserved bits The data address will be overwritten with the correct value (0x0), but the apparent data chain bit will cause subsequent memory to be used as the target of the data store, which may not be where we expect (0x0). Clear out this space when we boot from DASD, so that we know it exists exactly as we expect. Signed-off-by: Eric Farman Reviewed-by: Jason J. Herne Reviewed-by: Janosch Frank Acked-by: Christian Borntraeger Acked-by: Cornelia Huck Message-Id: <20201120160117.59366-2-farman@linux.ibm.com> Signed-off-by: Thomas Huth --- pc-bios/s390-ccw/dasd-ipl.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pc-bios') diff --git a/pc-bios/s390-ccw/dasd-ipl.c b/pc-bios/s390-ccw/dasd-ipl.c index 0fc879bb8e..71cbae2f16 100644 --- a/pc-bios/s390-ccw/dasd-ipl.c +++ b/pc-bios/s390-ccw/dasd-ipl.c @@ -100,6 +100,9 @@ static void make_readipl(void) { Ccw0 *ccwIplRead = (Ccw0 *)0x00; + /* Clear out any existing data */ + memset(ccwIplRead, 0, sizeof(Ccw0)); + /* Create Read IPL ccw at address 0 */ ccwIplRead->cmd_code = CCW_CMD_READ_IPL; ccwIplRead->cda = 0x00; /* Read into address 0x00 in main memory */ -- cgit v1.2.3