Received: from eggs.gnu.org ([2001:4830:134:3::10]:41052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4VSk-0002oA-E0 for qemu-devel@nongnu.org; Tue, 08 Jul 2014 09:29:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X4VSa-0008HW-St for qemu-devel@nongnu.org; Tue, 08 Jul 2014 09:29:38 -0400 Received: from e06smtp15.uk.ibm.com ([195.75.94.111]:52575) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4VSa-0008HO-Ju for qemu-devel@nongnu.org; Tue, 08 Jul 2014 09:29:28 -0400 Received: from /spool/local by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 8 Jul 2014 14:29:27 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 11C6C17D8042 for ; Tue, 8 Jul 2014 14:30:58 +0100 (BST) Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [9.149.37.248]) by b06cxnps4075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s68DTOVQ33489066 for ; Tue, 8 Jul 2014 13:29:24 GMT Received: from d06av07.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s68DTN5F017997 for ; Tue, 8 Jul 2014 09:29:24 -0400 From: Cornelia Huck Date: Tue, 8 Jul 2014 15:29:16 +0200 Message-Id: <1404826158-2735-2-git-send-email-cornelia.huck@de.ibm.com> In-Reply-To: <1404826158-2735-1-git-send-email-cornelia.huck@de.ibm.com> References: <1404826158-2735-1-git-send-email-cornelia.huck@de.ibm.com> Subject: [Qemu-devel] [PULL for-2.1 1/3] pc-bios/s390-ccw: store proper subsystem information word List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, agraf@suse.de, borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com, aliguori@amazon.com, Cornelia Huck From: Christian Borntraeger POP chapter 17 requires to store a subsystem information word at 184 during IPL. Furthermore bytes 188-191 should be zero. The bootmap might contain data blocks that are written to the first page. We have to write these values after we processed the bootmap and before the final IPL. Signed-off-by: Christian Borntraeger Reviewed-by: Cornelia Huck Signed-off-by: Cornelia Huck --- pc-bios/s390-ccw/bootmap.c | 2 ++ pc-bios/s390-ccw/main.c | 17 ++++++++++++++++- pc-bios/s390-ccw/s390-ccw.h | 1 + 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c index fa54abb..f175679 100644 --- a/pc-bios/s390-ccw/bootmap.c +++ b/pc-bios/s390-ccw/bootmap.c @@ -51,6 +51,8 @@ static void jump_to_IPL_2(void) static void jump_to_IPL_code(uint64_t address) { + /* store the subsystem information _after_ the bootmap was loaded */ + write_subsystem_identification(); /* * The IPL PSW is at address 0. We also must not overwrite the * content of non-BIOS memory after we loaded the guest, so we diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c index dbfb40e..f9ec215 100644 --- a/pc-bios/s390-ccw/main.c +++ b/pc-bios/s390-ccw/main.c @@ -13,6 +13,22 @@ char stack[PAGE_SIZE * 8] __attribute__((__aligned__(PAGE_SIZE))); uint64_t boot_value; +struct subchannel_id blk_schid = { .one = 1 }; + +/* + * Priniciples of Operations (SA22-7832-09) chapter 17 requires that + * a subsystem-identification is at 184-187 and bytes 188-191 are zero + * after list-directed-IPL and ccw-IPL. + */ +void write_subsystem_identification(void) +{ + struct subchannel_id *schid = (struct subchannel_id *) 184; + uint32_t *zeroes = (uint32_t *) 188; + + *schid = blk_schid; + *zeroes = 0; +} + void virtio_panic(const char *string) { @@ -23,7 +39,6 @@ void virtio_panic(const char *string) static void virtio_setup(uint64_t dev_info) { - struct subchannel_id blk_schid = { .one = 1 }; struct schib schib; int i; int r; diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h index 959aed0..2b773de 100644 --- a/pc-bios/s390-ccw/s390-ccw.h +++ b/pc-bios/s390-ccw/s390-ccw.h @@ -50,6 +50,7 @@ void disabled_wait(void); /* main.c */ void virtio_panic(const char *string); +void write_subsystem_identification(void); /* sclp-ascii.c */ void sclp_print(const char *string); -- 1.7.9.5