From nobody Mon Nov 10 12:52:48 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1556198797; cv=none; d=zoho.com; s=zohoarc; b=Sbt7zKuHzmnoB8gWXoDRk4vabD+NRqNn9UkweUtHZKBBwR0famwuI47XUR7dWqv1w3mxpO5OIYNRxdj2eWCbd7KL2m65qnr03QAeN4VaBeQk8kAjLI05MssG3fOW73DawECt8jLuuW1o+6UvQruDXoq2pms9i9lAkEf0q4GWBB4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556198797; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=kl08dVSJZBAq/cr3W/MvCl3eWZwxJ3KvIieL59iSi0M=; b=MqrvINvLqaZWlg3IYLexxH5sN1UOtNeTOFd6LLHGaw0I6XZ6wX2xaOovbGS4/LBt4vNzrGbV3RwEaKZfsBL628EGfkxs+F+zc52zRadY3teneR1m3Y9JFSvJ0PuFSorx5nQ3fs2m7SiDnbwirE/xfPJF8Jf9+zleRgSj/+Wu/mk= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1556198797979830.8047302883587; Thu, 25 Apr 2019 06:26:37 -0700 (PDT) Received: from localhost ([127.0.0.1]:57132 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJeOX-0006oE-Vh for importer@patchew.org; Thu, 25 Apr 2019 09:26:34 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58308) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJeJs-000389-G9 for qemu-devel@nongnu.org; Thu, 25 Apr 2019 09:21:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hJeJr-0003ba-H3 for qemu-devel@nongnu.org; Thu, 25 Apr 2019 09:21:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58768) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hJeJr-0003bC-8s; Thu, 25 Apr 2019 09:21:43 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7FA4B319939F; Thu, 25 Apr 2019 13:21:42 +0000 (UTC) Received: from localhost (dhcp-192-187.str.redhat.com [10.33.192.187]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2B0381001E6C; Thu, 25 Apr 2019 13:21:42 +0000 (UTC) From: Cornelia Huck To: Peter Maydell Date: Thu, 25 Apr 2019 15:21:18 +0200 Message-Id: <20190425132134.2839-4-cohuck@redhat.com> In-Reply-To: <20190425132134.2839-1-cohuck@redhat.com> References: <20190425132134.2839-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Thu, 25 Apr 2019 13:21:42 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 03/19] s390-bios: decouple common boot logic from virtio X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Jason J. Herne" , qemu-s390x@nongnu.org, qemu-devel@nongnu.org, Thomas Huth Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Jason J. Herne" 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: Farhan Ali Reviewed-by: Cornelia Huck Message-Id: <1554388475-18329-4-git-send-email-jjherne@linux.ibm.com> Signed-off-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 e82fe2ce2315..67df42191b94 100644 --- a/pc-bios/s390-ccw/main.c +++ b/pc-bios/s390-ccw/main.c @@ -14,16 +14,17 @@ =20 char stack[PAGE_SIZE * 8] __attribute__((__aligned__(PAGE_SIZE))); static SubChannelId blk_schid =3D { .one =3D 1 }; -IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE))); static char loadparm_str[LOADPARM_LEN + 1] =3D { 0, 0, 0, 0, 0, 0, 0, 0, 0= }; QemuIplParameters qipl; +IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE))); +static bool have_iplb; =20 #define LOADPARM_PROMPT "PROMPT " #define LOADPARM_EMPTY " " #define BOOT_MENU_FLAG_MASK (QIPL_FLAG_BM_OPTS_CMD | QIPL_FLAG_BM_OPTS_ZIP= L) =20 /* - * 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(); } =20 +/* + * 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[] =3D "LOADPARM=3D[________]\n"; + + sclp_get_loadparm_ascii(loadparm_str); + memcpy(lpmsg + 10, loadparm_str, 8); + sclp_print(lpmsg); + + have_iplb =3D store_iplb(&iplb); +} + static void virtio_setup(void) { Schib schib; int ssid; bool found =3D false; uint16_t dev_no; - char ldp[] =3D "LOADPARM=3D[________]\n"; VDev *vdev =3D virtio_get_device(); QemuIplParameters *early_qipl =3D (QemuIplParameters *)QIPL_ADDRESS; =20 - sclp_get_loadparm_ascii(loadparm_str); - memcpy(ldp + 10, loadparm_str, LOADPARM_LEN); - sclp_print(ldp); - memcpy(&qipl, early_qipl, sizeof(QemuIplParameters)); =20 - if (store_iplb(&iplb)) { + if (have_iplb) { switch (iplb.pbt) { case S390_IPL_TYPE_CCW: dev_no =3D iplb.ccw.devno; @@ -174,6 +185,7 @@ int main(void) { sclp_setup(); css_setup(); + boot_setup(); virtio_setup(); =20 zipl_load(); /* no return */ --=20 2.17.2