From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34464) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXQrm-0000WA-S4 for qemu-devel@nongnu.org; Thu, 13 Dec 2018 08:17:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXQrj-00026B-Fp for qemu-devel@nongnu.org; Thu, 13 Dec 2018 08:17:26 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:50564 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXQrg-00022m-Co for qemu-devel@nongnu.org; Thu, 13 Dec 2018 08:17:22 -0500 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wBDDEDkp039249 for ; Thu, 13 Dec 2018 08:17:19 -0500 Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.149]) by mx0b-001b2d01.pphosted.com with ESMTP id 2pbr048my1-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 13 Dec 2018 08:17:19 -0500 Received: from localhost by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 13 Dec 2018 13:17:18 -0000 References: <1544623878-11248-1-git-send-email-jjherne@linux.ibm.com> <1544623878-11248-4-git-send-email-jjherne@linux.ibm.com> From: Farhan Ali Date: Thu, 13 Dec 2018 08:17:11 -0500 MIME-Version: 1.0 In-Reply-To: <1544623878-11248-4-git-send-email-jjherne@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Message-Id: <1204fbf0-cb45-0416-909c-27758847e12c@linux.ibm.com> Subject: Re: [Qemu-devel] [PATCH 03/15] s390-bios: decouple common boot logic from virtio List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Jason J. Herne" , qemu-devel@nongnu.org, qemu-s390x@nongnu.org, cohuck@redhat.com, pasic@linux.ibm.com, bjsdjshi@linux.ibm.com, borntraeger@de.ibm.com On 12/12/2018 09:11 AM, Jason J. Herne wrote: > Create a boot_setup function to handle getting boot information from > the machine/hypervisor. This decouples common boot logic from the > virtio code path and allows us to make use of it for the real dasd boot > scenario. > > Signed-off-by: Jason J. Herne > Acked-by: Halil Pasic > Reviewed-by: Collin Walling Reviewed-by: Thomas Huth > --- > pc-bios/s390-ccw/main.c | 28 ++++++++++++++++++++-------- > 1 file changed, 20 insertions(+), 8 deletions(-) > > diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c > index e82fe2c..67df421 100644 > --- a/pc-bios/s390-ccw/main.c > +++ b/pc-bios/s390-ccw/main.c > @@ -14,16 +14,17 @@ > > char stack[PAGE_SIZE * 8] __attribute__((__aligned__(PAGE_SIZE))); > static SubChannelId blk_schid = { .one = 1 }; > -IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE))); > static char loadparm_str[LOADPARM_LEN + 1] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; > QemuIplParameters qipl; > +IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE))); > +static bool have_iplb; > > #define LOADPARM_PROMPT "PROMPT " > #define LOADPARM_EMPTY " " > #define BOOT_MENU_FLAG_MASK (QIPL_FLAG_BM_OPTS_CMD | QIPL_FLAG_BM_OPTS_ZIPL) > > /* > - * Priniciples of Operations (SA22-7832-09) chapter 17 requires that > + * Principles 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. > */ > @@ -111,23 +112,33 @@ static void css_setup(void) > enable_mss_facility(); > } > > +/* > + * Collect various pieces of information from the hypervisor/hardware that > + * we'll use to determine exactly how we'll boot. > + */ > +static void boot_setup(void) > +{ > + char lpmsg[] = "LOADPARM=[________]\n"; > + > + sclp_get_loadparm_ascii(loadparm_str); > + memcpy(lpmsg + 10, loadparm_str, 8); > + sclp_print(lpmsg); > + > + have_iplb = store_iplb(&iplb); > +} > + > static void virtio_setup(void) > { > Schib schib; > int ssid; > bool found = false; > uint16_t dev_no; > - char ldp[] = "LOADPARM=[________]\n"; > VDev *vdev = virtio_get_device(); > QemuIplParameters *early_qipl = (QemuIplParameters *)QIPL_ADDRESS; > > - sclp_get_loadparm_ascii(loadparm_str); > - memcpy(ldp + 10, loadparm_str, LOADPARM_LEN); > - sclp_print(ldp); > - > memcpy(&qipl, early_qipl, sizeof(QemuIplParameters)); > > - if (store_iplb(&iplb)) { > + if (have_iplb) { > switch (iplb.pbt) { > case S390_IPL_TYPE_CCW: > dev_no = iplb.ccw.devno; > @@ -174,6 +185,7 @@ int main(void) > { > sclp_setup(); > css_setup(); > + boot_setup(); > virtio_setup(); > > zipl_load(); /* no return */ > Reviewed-by: Farhan Ali