From nobody Sat Nov 23 21:59:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1728350220; cv=none; d=zohomail.com; s=zohoarc; b=UMi2T0cMAhBdlLaZNsXU5WbpPBHXHlEdyNKK+3ZnZKpsOQO5Ni8dli+pA/qpVecF7NEazL8peaspezjrFFbM/azMcIKRNvqx0K63vn4ySF9WFD2IhRaH0/GFl0FMuEbbH+ifqLrmxUxT0iENb6rC6I1KhG3YfyfXlVvcU6LHGNE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728350220; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=TS38svw3GIfh/UCeQY7JIwa367Mp4DNIwZtu7DSWuAU=; b=HzT/xT1sCKA+sJtemwA6Qrdy/tLnmRJfH6xWpFEpY6Q5FWL22FhG1/t9Sn9U0t/Fv4Us+jJduAEacZsIEFvr9qCvpOqiqYEauFuJi52lidROS5xhH1qMWwmhS32H38BPgNNVLLOj9az2iNi2pXrUpalsqxFdbouZHEojxnIAsL4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1728350220087720.1276067223666; Mon, 7 Oct 2024 18:17:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxypb-00041g-P0; Mon, 07 Oct 2024 21:16:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypa-000412-C6; Mon, 07 Oct 2024 21:16:06 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypX-0008Cz-Fm; Mon, 07 Oct 2024 21:16:05 -0400 Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4980nunj008380; Tue, 8 Oct 2024 01:16:00 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424thq02j6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:00 +0000 (GMT) Received: from m0356516.ppops.net (m0356516.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4981G0K9026738; Tue, 8 Oct 2024 01:16:00 GMT Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424thq02j1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:00 +0000 (GMT) Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 4981Ap01011516; Tue, 8 Oct 2024 01:15:59 GMT Received: from smtprelay05.dal12v.mail.ibm.com ([172.16.1.7]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 423g5xhpuv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:15:59 +0000 Received: from smtpav06.dal12v.mail.ibm.com (smtpav06.dal12v.mail.ibm.com [10.241.53.105]) by smtprelay05.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4981FwJC38666694 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Oct 2024 01:15:58 GMT Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 478BD5805F; Tue, 8 Oct 2024 01:15:58 +0000 (GMT) Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C241958043; Tue, 8 Oct 2024 01:15:57 +0000 (GMT) Received: from localhost.localdomain (unknown [9.61.51.58]) by smtpav06.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 8 Oct 2024 01:15:57 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=pp1; bh=TS38svw3GIfh/ UCeQY7JIwa367Mp4DNIwZtu7DSWuAU=; b=YQvJ1aGEXk++6qRF5PgvgMO7/AEP8 AuQyLMtWWuGD7eQu+CmfGLDQJaXnPmzaP7CHYV0WkqQbVDr6fEgPhrYi9QYR7m7I 1neCABhSNI1/E6oG6JGT05XjGt5l7aDsv1R5S/RK4ZRRe7bytfFPn9/qh90Yla7h Si5FmtWpsEhcmGr24Jfuw6yk2wbgVAIQotrTXSVJpMHyhbaBX1SJMeDbDbzJIYKA X607dV/qDH/CZ6bIht06q56ntm7/V1q7WQpHhMzTJplTcqciFbrQnv/BC08k2iJk CcEaaI9h5kUJeOED5K3mNRJXSyfBXFcNen5vn8JzW/YRS0qxgzvGTafJQ== From: jrossi@linux.ibm.com To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org, thuth@redhat.com Cc: frankja@linux.ibm.com, jrossi@linux.ibm.com Subject: [PATCH v3 01/19] hw/s390x/ipl: Provide more memory to the s390-ccw.img firmware Date: Mon, 7 Oct 2024 21:15:34 -0400 Message-ID: <20241008011552.2645520-2-jrossi@linux.ibm.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241008011552.2645520-1-jrossi@linux.ibm.com> References: <20241008011552.2645520-1-jrossi@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: Sm0-PrHjXbwCb0c25w8YTVDV0e_ZBrgF X-Proofpoint-GUID: 7gedMW2YGgVfbZLi5SzOm8NhevUcygg0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-07_16,2024-10-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 phishscore=0 adultscore=0 malwarescore=0 priorityscore=1501 suspectscore=0 lowpriorityscore=0 mlxlogscore=575 bulkscore=0 clxscore=1015 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410080006 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=148.163.158.5; envelope-from=jrossi@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1728350222383116600 Content-Type: text/plain; charset="utf-8" From: Jared Rossi We are going to link the SLOF libc into the s390-ccw.img, and this libc needs more memory for providing space for malloc() and friends. Thus bump the memory size that we reserve for the bios to 3 MiB instead of only 2 MiB. While we're at it, add a proper check that there is really enough memory assigned to the machine before blindly using it. Co-authored by: Thomas Huth Signed-off-by: Jared Rossi --- hw/s390x/ipl.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c index 5ab7433908..5f60977ceb 100644 --- a/hw/s390x/ipl.c +++ b/hw/s390x/ipl.c @@ -45,6 +45,7 @@ #define INITRD_PARM_START 0x010408UL #define PARMFILE_START 0x001000UL #define ZIPL_IMAGE_START 0x009000UL +#define BIOS_MAX_SIZE 0x300000UL #define IPL_PSW_MASK (PSW_MASK_32 | PSW_MASK_64) =20 static bool iplb_extended_needed(void *opaque) @@ -144,7 +145,14 @@ static void s390_ipl_realize(DeviceState *dev, Error *= *errp) * even if an external kernel has been defined. */ if (!ipl->kernel || ipl->enforce_bios) { - uint64_t fwbase =3D (MIN(ms->ram_size, 0x80000000U) - 0x200000) & = ~0xffffUL; + uint64_t fwbase; + + if (ms->ram_size < BIOS_MAX_SIZE) { + error_setg(errp, "not enough RAM to load the BIOS file"); + return; + } + + fwbase =3D (MIN(ms->ram_size, 0x80000000U) - BIOS_MAX_SIZE) & ~0xf= fffUL; =20 bios_filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, ipl->firmwar= e); if (bios_filename =3D=3D NULL) { --=20 2.45.1 From nobody Sat Nov 23 21:59:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1728350253; cv=none; d=zohomail.com; s=zohoarc; b=G/W6+/8baPYyzjWI3PFz9SxeP31ZNZLV/VnTOYGc36tDyU1Mj8Y9pnjIlCylXDW0MKiYGlELk4dybIKY4V4s4NZTJFoGuvFkuoMfUkuvZjh2nM35MwWk58/7ryjeDGFUPQsMe2wstT/X/i9dDQEn9QoWjYOunBntw/jhgaOR2dE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728350253; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=8Ibr4Y+oEzkr6z88q1Ix6um4qVHlqA2MwU1jo4zakzc=; b=K75g7z4wlshojsMVUP2GEZgmW0wCSkErTVnA4I4Fp9KoPzHwnNCQlLGnQyycMYYUPQDYjzQ6lEXJQtaMpqJGjxVxUmdQhMQgjdnrLjHieSQuQUeE5H6g8sr8M+6ySg81iPTqMwOtiBBl/eZDGQlW9j0XLtY3xYBB4+IgwEyDBOk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1728350253691717.4886765673847; Mon, 7 Oct 2024 18:17:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxypd-000436-No; Mon, 07 Oct 2024 21:16:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypc-000421-5H; Mon, 07 Oct 2024 21:16:08 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypY-0008Ds-2M; Mon, 07 Oct 2024 21:16:07 -0400 Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4980nunk008380; Tue, 8 Oct 2024 01:16:03 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424thq02je-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:02 +0000 (GMT) Received: from m0356516.ppops.net (m0356516.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4981G2tO026814; Tue, 8 Oct 2024 01:16:02 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424thq02ja-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:02 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 497Mk1I7022848; Tue, 8 Oct 2024 01:16:01 GMT Received: from smtprelay07.dal12v.mail.ibm.com ([172.16.1.9]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 423jg0s7nk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:01 +0000 Received: from smtpav06.dal12v.mail.ibm.com (smtpav06.dal12v.mail.ibm.com [10.241.53.105]) by smtprelay07.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4981G0MP42664432 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Oct 2024 01:16:00 GMT Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 64A1758055; Tue, 8 Oct 2024 01:16:00 +0000 (GMT) Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C1E9558043; Tue, 8 Oct 2024 01:15:59 +0000 (GMT) Received: from localhost.localdomain (unknown [9.61.51.58]) by smtpav06.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 8 Oct 2024 01:15:59 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=pp1; bh=8Ibr4Y+oEzkr6 z88q1Ix6um4qVHlqA2MwU1jo4zakzc=; b=Nw+tx9ErAaM8jn30FfaFf43flF0t5 o/1lhmBifHEEYi1+0vreJx5CIXiCr4hbRGqLEp6AiRHOv6IW4Y/5kS69a4UZY1Dd KMBDzoTLXaifOdhq+E4l2AqDb4RNkEhjN5lWXMjXbbdzyCpIyKAke1OZ6Tb/L7Wb gSCkDYTXsvSqce6taMGK4HOAa+AJLeN7tVru9Ltlw9UlA6cEDIJc0ASxYc6R7x86 tUnG/XE6fIWp5aG3bV3g6bOk/YDno/cmTVoFdVVgaDuJyMhysub4zoZpTlG+GENI h5wwJL+XZMDZJ5Q3O5OmREuLf9o9d9AQkuZMpuGxYrBBZjCGZBT1zCEsg== From: jrossi@linux.ibm.com To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org, thuth@redhat.com Cc: frankja@linux.ibm.com, jrossi@linux.ibm.com Subject: [PATCH v3 02/19] pc-bios/s390-ccw: Use the libc from SLOF and remove sclp prints Date: Mon, 7 Oct 2024 21:15:35 -0400 Message-ID: <20241008011552.2645520-3-jrossi@linux.ibm.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241008011552.2645520-1-jrossi@linux.ibm.com> References: <20241008011552.2645520-1-jrossi@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: j60S4G2e3sattYaDST6-zEptLaY0Bwwn X-Proofpoint-GUID: 9OBI0FEocqmy-HWzSYmwAPvEBjurNDkG X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-07_16,2024-10-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 phishscore=0 adultscore=0 malwarescore=0 priorityscore=1501 suspectscore=0 lowpriorityscore=0 mlxlogscore=999 bulkscore=0 clxscore=1015 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410080006 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=148.163.158.5; envelope-from=jrossi@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1728350254366116600 Content-Type: text/plain; charset="utf-8" From: Jared Rossi We are already using the libc from SLOF for the s390-netboot.img, and this libc implementation is way more complete and accurate than the simple implementation that we currently use for the s390-ccw.img binary. Since we are now always assuming that the SLOF submodule is available when building the s390-ccw bios (see commit bf6903f6944f), we can drop the simple implementation and use the SLOF libc for the s390-ccw.img binary, too. Additionally replace sclp_print calls with puts/printf now that it is avali= able. Co-authored by: Thomas Huth Signed-off-by: Jared Rossi --- pc-bios/s390-ccw/netboot.mak | 3 -- pc-bios/s390-ccw/bootmap.h | 4 +- pc-bios/s390-ccw/libc.h | 89 -------------------------------- pc-bios/s390-ccw/s390-ccw.h | 30 ++++------- pc-bios/s390-ccw/bootmap.c | 47 ++++++++--------- pc-bios/s390-ccw/cio.c | 78 +++++++++++++--------------- pc-bios/s390-ccw/dasd-ipl.c | 5 +- pc-bios/s390-ccw/jump2ipl.c | 5 +- pc-bios/s390-ccw/libc.c | 88 ------------------------------- pc-bios/s390-ccw/main.c | 14 ++--- pc-bios/s390-ccw/menu.c | 51 +++++++++--------- pc-bios/s390-ccw/netmain.c | 10 ++-- pc-bios/s390-ccw/sclp.c | 7 +-- pc-bios/s390-ccw/virtio-blkdev.c | 6 +-- pc-bios/s390-ccw/virtio-scsi.c | 17 +++--- pc-bios/s390-ccw/virtio.c | 2 +- pc-bios/s390-ccw/Makefile | 15 ++++-- 17 files changed, 136 insertions(+), 335 deletions(-) delete mode 100644 pc-bios/s390-ccw/libc.h delete mode 100644 pc-bios/s390-ccw/libc.c diff --git a/pc-bios/s390-ccw/netboot.mak b/pc-bios/s390-ccw/netboot.mak index 046aa35587..d2b3d8ee74 100644 --- a/pc-bios/s390-ccw/netboot.mak +++ b/pc-bios/s390-ccw/netboot.mak @@ -1,9 +1,6 @@ =20 -SLOF_DIR :=3D $(SRC_PATH)/../../roms/SLOF - NETOBJS :=3D start.o sclp.o cio.o virtio.o virtio-net.o jump2ipl.o netmain= .o =20 -LIBC_INC :=3D -nostdinc -I$(SLOF_DIR)/lib/libc/include LIBNET_INC :=3D -I$(SLOF_DIR)/lib/libnet =20 NETLDFLAGS :=3D $(LDFLAGS) -Wl,-Ttext=3D0x7800000 diff --git a/pc-bios/s390-ccw/bootmap.h b/pc-bios/s390-ccw/bootmap.h index d4690a88c2..bbe2c132aa 100644 --- a/pc-bios/s390-ccw/bootmap.h +++ b/pc-bios/s390-ccw/bootmap.h @@ -336,9 +336,7 @@ static inline void print_volser(const void *volser) =20 ebcdic_to_ascii((char *)volser, ascii, 6); ascii[6] =3D '\0'; - sclp_print("VOLSER=3D["); - sclp_print(ascii); - sclp_print("]\n"); + printf("VOLSER=3D[%s]", ascii); } =20 static inline bool unused_space(const void *p, size_t size) diff --git a/pc-bios/s390-ccw/libc.h b/pc-bios/s390-ccw/libc.h deleted file mode 100644 index bcdc45732d..0000000000 --- a/pc-bios/s390-ccw/libc.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * libc-style definitions and functions - * - * Copyright (c) 2013 Alexander Graf - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - */ - -#ifndef S390_CCW_LIBC_H -#define S390_CCW_LIBC_H - -typedef unsigned long size_t; -typedef int bool; -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -typedef unsigned long long uint64_t; - -static inline void *memset(void *s, int c, size_t n) -{ - size_t i; - unsigned char *p =3D s; - - for (i =3D 0; i < n; i++) { - p[i] =3D c; - } - - return s; -} - -static inline void *memcpy(void *s1, const void *s2, size_t n) -{ - uint8_t *dest =3D s1; - const uint8_t *src =3D s2; - size_t i; - - for (i =3D 0; i < n; i++) { - dest[i] =3D src[i]; - } - - return s1; -} - -static inline int memcmp(const void *s1, const void *s2, size_t n) -{ - size_t i; - const uint8_t *p1 =3D s1, *p2 =3D s2; - - for (i =3D 0; i < n; i++) { - if (p1[i] !=3D p2[i]) { - return p1[i] > p2[i] ? 1 : -1; - } - } - - return 0; -} - -static inline size_t strlen(const char *str) -{ - size_t i; - for (i =3D 0; *str; i++) { - str++; - } - return i; -} - -static inline char *strcat(char *dest, const char *src) -{ - int i; - char *dest_end =3D dest + strlen(dest); - - for (i =3D 0; i <=3D strlen(src); i++) { - dest_end[i] =3D src[i]; - } - return dest; -} - -static inline int isdigit(int c) -{ - return (c >=3D '0') && (c <=3D '9'); -} - -uint64_t atoui(const char *str); -char *uitoa(uint64_t num, char *str, size_t len); - -#endif diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h index c977a52b50..9b622e616a 100644 --- a/pc-bios/s390-ccw/s390-ccw.h +++ b/pc-bios/s390-ccw/s390-ccw.h @@ -13,6 +13,11 @@ =20 /* #define DEBUG */ =20 +#include +#include +#include +#include + typedef unsigned char u8; typedef unsigned short u16; typedef unsigned int u32; @@ -26,9 +31,6 @@ typedef unsigned long long u64; #define EBUSY 2 #define ENODEV 3 =20 -#ifndef NULL -#define NULL 0 -#endif #ifndef MIN #define MIN(a, b) (((a) < (b)) ? (a) : (b)) #endif @@ -87,7 +89,7 @@ bool menu_is_enabled_enum(void); __attribute__ ((__noreturn__)) static inline void panic(const char *string) { - sclp_print(string); + printf("ERROR: %s\n ", string); disabled_wait(); } =20 @@ -109,20 +111,10 @@ static inline void fill_hex_val(char *out, void *ptr,= unsigned size) } } =20 -static inline void print_int(const char *desc, u64 addr) -{ - char out[] =3D ": 0xffffffffffffffff\n"; - - fill_hex_val(&out[4], &addr, sizeof(addr)); - - sclp_print(desc); - sclp_print(out); -} - static inline void debug_print_int(const char *desc, u64 addr) { #ifdef DEBUG - print_int(desc, addr); + printf("%s 0x%X", desc, addr); #endif } =20 @@ -147,18 +139,14 @@ static inline void debug_print_addr(const char *desc,= void *p) static inline void IPL_assert(bool term, const char *message) { if (!term) { - sclp_print("\n! "); - sclp_print(message); - panic(" !\n"); /* no return */ + panic(message); /* no return */ } } =20 static inline void IPL_check(bool term, const char *message) { if (!term) { - sclp_print("\n! WARNING: "); - sclp_print(message); - sclp_print(" !\n"); + printf("WARNING: %s\n", message); } } =20 diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c index a2137449dc..3cc79706be 100644 --- a/pc-bios/s390-ccw/bootmap.c +++ b/pc-bios/s390-ccw/bootmap.c @@ -8,7 +8,8 @@ * directory. */ =20 -#include "libc.h" +#include +#include #include "s390-ccw.h" #include "s390-arch.h" #include "bootmap.h" @@ -21,7 +22,7 @@ =20 #ifdef DEBUG_FALLBACK #define dputs(txt) \ - do { sclp_print("zipl: " txt); } while (0) + do { printf("zipl: " txt); } while (0) #else #define dputs(fmt, ...) \ do { } while (0) @@ -270,7 +271,7 @@ static int eckd_get_boot_menu_index(block_number_t s1b_= block_nr) prev_block_nr =3D cur_block_nr; } =20 - sclp_print("No zipl boot menu data found. Booting default entry."); + printf("No zipl boot menu data found. Booting default entry."); return 0; } =20 @@ -338,22 +339,22 @@ static void ipl_eckd_cdl(void) block_number_t bmt_block_nr, s1b_block_nr; =20 /* we have just read the block #0 and recognized it as "IPL1" */ - sclp_print("CDL\n"); + puts("CDL"); =20 memset(sec, FREE_SPACE_FILLER, sizeof(sec)); read_block(1, ipl2, "Cannot read IPL2 record at block 1"); =20 mbr =3D &ipl2->mbr; if (!magic_match(mbr, ZIPL_MAGIC)) { - sclp_print("No zIPL section in IPL2 record.\n"); + puts("No zIPL section in IPL2 record."); return; } if (!block_size_ok(mbr->blockptr.xeckd.bptr.size)) { - sclp_print("Bad block size in zIPL section of IPL2 record.\n"); + puts("Bad block size in zIPL section of IPL2 record."); return; } if (mbr->dev_type !=3D DEV_TYPE_ECKD) { - sclp_print("Non-ECKD device type in zIPL section of IPL2 record.\n= "); + puts("Non-ECKD device type in zIPL section of IPL2 record."); return; } =20 @@ -366,11 +367,11 @@ static void ipl_eckd_cdl(void) memset(sec, FREE_SPACE_FILLER, sizeof(sec)); read_block(2, vlbl, "Cannot read Volume Label at block 2"); if (!magic_match(vlbl->key, VOL1_MAGIC)) { - sclp_print("Invalid magic of volume label block.\n"); + puts("Invalid magic of volume label block."); return; } if (!magic_match(vlbl->f.key, VOL1_MAGIC)) { - sclp_print("Invalid magic of volser block.\n"); + puts("Invalid magic of volser block."); return; } print_volser(vlbl->f.volser); @@ -384,8 +385,8 @@ static void print_eckd_ldl_msg(ECKD_IPL_mode_t mode) LDL_VTOC *vlbl =3D (void *)sec; /* already read, 3rd block */ char msg[4] =3D { '?', '.', '\n', '\0' }; =20 - sclp_print((mode =3D=3D ECKD_CMS) ? "CMS" : "LDL"); - sclp_print(" version "); + printf((mode =3D=3D ECKD_CMS) ? "CMS" : "LDL"); + printf(" version "); switch (vlbl->LDL_version) { case LDL1_VERSION: msg[0] =3D '1'; @@ -398,7 +399,7 @@ static void print_eckd_ldl_msg(ECKD_IPL_mode_t mode) msg[1] =3D '?'; break; } - sclp_print(msg); + printf("%s", msg); print_volser(vlbl->volser); } =20 @@ -419,7 +420,7 @@ static void ipl_eckd_ldl(ECKD_IPL_mode_t mode) if (!magic_match(ipl1->bip.magic, ZIPL_MAGIC)) { return; /* not applicable layout */ } - sclp_print("unlabeled LDL.\n"); + puts("unlabeled LDL."); } verify_boot_info(&ipl1->bip); =20 @@ -466,7 +467,7 @@ static void print_eckd_msg(void) *p-- =3D ' '; } } - sclp_print(msg); + printf("%s", msg); } =20 static void ipl_eckd(void) @@ -488,11 +489,11 @@ static void ipl_eckd(void) if (eckd_valid_address((ExtEckdBlockPtr *)&vlbl->f.br, 0)) { ldipl_bmt =3D eckd_find_bmt((ExtEckdBlockPtr *)&vlbl->f.br); if (ldipl_bmt) { - sclp_print("List-Directed\n"); + puts("List-Directed"); /* LD-IPL does not use the S1B bock, just make it NULL */ run_eckd_boot_script(ldipl_bmt, NULL_BLOCK_NR); /* Only return in error, retry as CCW-IPL */ - sclp_print("Retrying IPL "); + printf("Retrying IPL "); print_eckd_msg(); } memset(sec, FREE_SPACE_FILLER, sizeof(sec)); @@ -634,7 +635,7 @@ static void ipl_scsi(void) return; } =20 - sclp_print("Using SCSI scheme.\n"); + puts("Using SCSI scheme."); debug_print_int("MBR Version", mbr->version_id); IPL_check(mbr->version_id =3D=3D 1, "Unknown MBR layout version, assuming version 1"); @@ -743,7 +744,7 @@ static inline uint32_t iso_get_file_size(uint32_t load_= rba) if (cur_record->file_flags & 0x2) { /* Subdirectory */ if (level =3D=3D ISO9660_MAX_DIR_DEPTH - 1) { - sclp_print("ISO-9660 directory depth limit exceeded\n"= ); + puts("ISO-9660 directory depth limit exceeded"); } else { level++; sec_loc[level] =3D iso_733_to_u32(cur_record->ext_loc); @@ -778,9 +779,9 @@ static void load_iso_bc_entry(IsoBcSection *load) if (real_size) { /* Round up blocks to load */ blks_to_load =3D (real_size + ISO_SECTOR_SIZE - 1) / ISO_SECTOR_SI= ZE; - sclp_print("ISO boot image size verified\n"); + puts("ISO boot image size verified"); } else { - sclp_print("ISO boot image size could not be verified\n"); + puts("ISO boot image size could not be verified"); } =20 read_iso_boot_image(bswap32(s.load_rba), @@ -896,7 +897,7 @@ static void zipl_load_vblk(void) } =20 if (blksize !=3D VIRTIO_DASD_DEFAULT_BLOCK_SIZE) { - sclp_print("Using guessed DASD geometry.\n"); + puts("Using guessed DASD geometry."); virtio_assume_eckd(); } ipl_eckd(); @@ -909,7 +910,7 @@ static void zipl_load_vscsi(void) ipl_iso_el_torito(); } =20 - sclp_print("Using guessed DASD geometry.\n"); + puts("Using guessed DASD geometry."); virtio_assume_eckd(); ipl_eckd(); } @@ -944,5 +945,5 @@ void zipl_load(void) panic("\n! Unknown IPL device type !\n"); } =20 - sclp_print("zIPL load failed.\n"); + puts("zIPL load failed."); } diff --git a/pc-bios/s390-ccw/cio.c b/pc-bios/s390-ccw/cio.c index 83ca27ab41..758e74965e 100644 --- a/pc-bios/s390-ccw/cio.c +++ b/pc-bios/s390-ccw/cio.c @@ -11,7 +11,8 @@ * directory. */ =20 -#include "libc.h" +#include +#include #include "s390-ccw.h" #include "s390-arch.h" #include "helper.h" @@ -90,9 +91,9 @@ static void print_eckd_dasd_sense_data(SenseDataEckdDasd = *sd) char msgline[512]; =20 if (sd->config_info & 0x8000) { - sclp_print("Eckd Dasd Sense Data (fmt 24-bytes):\n"); + puts("Eckd Dasd Sense Data (fmt 24-bytes):"); } else { - sclp_print("Eckd Dasd Sense Data (fmt 32-bytes):\n"); + puts("Eckd Dasd Sense Data (fmt 32-bytes):"); } =20 strcat(msgline, " Sense Condition Flags :"); @@ -158,22 +159,21 @@ static void print_eckd_dasd_sense_data(SenseDataEckdD= asd *sd) if (sd->status[1] & SNS_STAT2_IMPRECISE_END) { strcat(msgline, " [Imprecise-End]"); } - strcat(msgline, "\n"); - sclp_print(msgline); - - print_int(" Residual Count =3D", sd->res_count); - print_int(" Phys Drive ID =3D", sd->phys_drive_id); - print_int(" low cyl address =3D", sd->low_cyl_addr); - print_int(" head addr & hi cyl =3D", sd->head_high_cyl_addr); - print_int(" format/message =3D", sd->fmt_msg); - print_int(" fmt-dependent[0-7] =3D", sd->fmt_dependent_info[0]); - print_int(" fmt-dependent[8-15]=3D", sd->fmt_dependent_info[1]); - print_int(" prog action code =3D", sd->program_action_code); - print_int(" Configuration info =3D", sd->config_info); - print_int(" mcode / hi-cyl =3D", sd->mcode_hicyl); - print_int(" cyl & head addr [0]=3D", sd->cyl_head_addr[0]); - print_int(" cyl & head addr [1]=3D", sd->cyl_head_addr[1]); - print_int(" cyl & head addr [2]=3D", sd->cyl_head_addr[2]); + puts(msgline); + + printf(" Residual Count =3D 0x%X", sd->res_count); + printf(" Phys Drive ID =3D 0x%X", sd->phys_drive_id); + printf(" low cyl address =3D 0x%X", sd->low_cyl_addr); + printf(" head addr & hi cyl =3D 0x%X", sd->head_high_cyl_addr); + printf(" format/message =3D 0x%X", sd->fmt_msg); + printf(" fmt-dependent[0-7] =3D 0x%llX", sd->fmt_dependent_info[0]); + printf(" fmt-dependent[8-15]=3D 0x%llX", sd->fmt_dependent_info[1]); + printf(" prog action code =3D 0x%X", sd->program_action_code); + printf(" Configuration info =3D 0x%X", sd->config_info); + printf(" mcode / hi-cyl =3D 0x%X", sd->mcode_hicyl); + printf(" cyl & head addr [0]=3D 0x%X", sd->cyl_head_addr[0]); + printf(" cyl & head addr [1]=3D 0x%X", sd->cyl_head_addr[1]); + printf(" cyl & head addr [2]=3D 0x%X", sd->cyl_head_addr[2]); } =20 static void print_irb_err(Irb *irb) @@ -182,7 +182,7 @@ static void print_irb_err(Irb *irb) uint64_t prev_ccw =3D *(uint64_t *)u32toptr(irb->scsw.cpa - 8); char msgline[256]; =20 - sclp_print("Interrupt Response Block Data:\n"); + puts("Interrupt Response Block Data:"); =20 strcat(msgline, " Function Ctrl :"); if (irb->scsw.ctrl & SCSW_FCTL_START_FUNC) { @@ -194,8 +194,7 @@ static void print_irb_err(Irb *irb) if (irb->scsw.ctrl & SCSW_FCTL_CLEAR_FUNC) { strcat(msgline, " [Clear]"); } - strcat(msgline, "\n"); - sclp_print(msgline); + puts(msgline); =20 msgline[0] =3D '\0'; strcat(msgline, " Activity Ctrl :"); @@ -220,8 +219,7 @@ static void print_irb_err(Irb *irb) if (irb->scsw.ctrl & SCSW_ACTL_SUSPENDED) { strcat(msgline, " [Suspended]"); } - strcat(msgline, "\n"); - sclp_print(msgline); + puts(msgline); =20 msgline[0] =3D '\0'; strcat(msgline, " Status Ctrl :"); @@ -240,9 +238,7 @@ static void print_irb_err(Irb *irb) if (irb->scsw.ctrl & SCSW_SCTL_STATUS_PEND) { strcat(msgline, " [Status-Pending]"); } - - strcat(msgline, "\n"); - sclp_print(msgline); + puts(msgline); =20 msgline[0] =3D '\0'; strcat(msgline, " Device Status :"); @@ -270,8 +266,7 @@ static void print_irb_err(Irb *irb) if (irb->scsw.dstat & SCSW_DSTAT_UEXCP) { strcat(msgline, " [Unit-Exception]"); } - strcat(msgline, "\n"); - sclp_print(msgline); + puts(msgline); =20 msgline[0] =3D '\0'; strcat(msgline, " Channel Status :"); @@ -299,12 +294,11 @@ static void print_irb_err(Irb *irb) if (irb->scsw.cstat & SCSW_CSTAT_CHAINCHK) { strcat(msgline, " [Chaining-Check]"); } - strcat(msgline, "\n"); - sclp_print(msgline); + puts(msgline); =20 - print_int(" cpa=3D", irb->scsw.cpa); - print_int(" prev_ccw=3D", prev_ccw); - print_int(" this_ccw=3D", this_ccw); + printf(" cpa=3D 0x%X", irb->scsw.cpa); + printf(" prev_ccw=3D 0x%llX", prev_ccw); + printf(" this_ccw=3D 0x%llX", this_ccw); } =20 /* @@ -341,7 +335,7 @@ static int __do_cio(SubChannelId schid, uint32_t ccw_ad= dr, int fmt, Irb *irb) return -1; } if (rc) { - print_int("ssch failed with cc=3D", rc); + printf("ssch failed with cc=3D 0x%x", rc); return rc; } =20 @@ -350,7 +344,7 @@ static int __do_cio(SubChannelId schid, uint32_t ccw_ad= dr, int fmt, Irb *irb) /* collect status */ rc =3D tsch(schid, irb); if (rc) { - print_int("tsch failed with cc=3D", rc); + printf("tsch failed with cc=3D 0x%X", rc); } =20 return rc; @@ -406,12 +400,12 @@ int do_cio(SubChannelId schid, uint16_t cutype, uint3= 2_t ccw_addr, int fmt) continue; } =20 - sclp_print("cio device error\n"); - print_int(" ssid ", schid.ssid); - print_int(" cssid ", schid.cssid); - print_int(" sch_no", schid.sch_no); - print_int(" ctrl-unit type", cutype); - sclp_print("\n"); + printf("cio device error\n"); + printf(" ssid 0x%X", schid.ssid); + printf(" cssid 0x%X", schid.cssid); + printf(" sch_no 0x%X", schid.sch_no); + printf(" ctrl-unit type 0x%X", cutype); + printf("\n"); print_irb_err(&irb); if (cutype =3D=3D CU_TYPE_DASD_3990 || cutype =3D=3D CU_TYPE_DASD_= 2107 || cutype =3D=3D CU_TYPE_UNKNOWN) { diff --git a/pc-bios/s390-ccw/dasd-ipl.c b/pc-bios/s390-ccw/dasd-ipl.c index 254bb1a15e..99c0b93083 100644 --- a/pc-bios/s390-ccw/dasd-ipl.c +++ b/pc-bios/s390-ccw/dasd-ipl.c @@ -8,7 +8,8 @@ * directory. */ =20 -#include "libc.h" +#include +#include #include "s390-ccw.h" #include "s390-arch.h" #include "dasd-ipl.h" @@ -82,7 +83,7 @@ static int run_dynamic_ccw_program(SubChannelId schid, ui= nt16_t cutype, do { has_next =3D dynamic_cp_fixup(cpa, &next_cpa); =20 - print_int("executing ccw chain at ", cpa); + printf("executing ccw chain at 0x%X", cpa); enable_prefixing(); rc =3D do_cio(schid, cutype, cpa, CCW_FMT0); disable_prefixing(); diff --git a/pc-bios/s390-ccw/jump2ipl.c b/pc-bios/s390-ccw/jump2ipl.c index 78f5f46533..80b7f6a1f3 100644 --- a/pc-bios/s390-ccw/jump2ipl.c +++ b/pc-bios/s390-ccw/jump2ipl.c @@ -6,7 +6,8 @@ * directory. */ =20 -#include "libc.h" +#include +#include #include "s390-ccw.h" #include "s390-arch.h" =20 @@ -57,7 +58,7 @@ void jump_to_IPL_code(uint64_t address) debug_print_int("set IPL addr to", address ?: *reset_psw & PSW_MASK_SH= ORT_ADDR); =20 /* Ensure the guest output starts fresh */ - sclp_print("\n"); + printf("\n"); =20 /* * HACK ALERT. diff --git a/pc-bios/s390-ccw/libc.c b/pc-bios/s390-ccw/libc.c deleted file mode 100644 index 3187923950..0000000000 --- a/pc-bios/s390-ccw/libc.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - * libc-style definitions and functions - * - * Copyright 2018 IBM Corp. - * Author(s): Collin L. Walling - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - */ - -#include "libc.h" -#include "s390-ccw.h" - -/** - * atoui: - * @str: the string to be converted. - * - * Given a string @str, convert it to an integer. Leading spaces are - * ignored. Any other non-numerical value will terminate the conversion - * and return 0. This function only handles numbers between 0 and - * UINT64_MAX inclusive. - * - * Returns: an integer converted from the string @str, or the number 0 - * if an error occurred. - */ -uint64_t atoui(const char *str) -{ - int val =3D 0; - - if (!str || !str[0]) { - return 0; - } - - while (*str =3D=3D ' ') { - str++; - } - - while (*str) { - if (!isdigit(*(unsigned char *)str)) { - break; - } - val =3D val * 10 + *str - '0'; - str++; - } - - return val; -} - -/** - * uitoa: - * @num: an integer (base 10) to be converted. - * @str: a pointer to a string to store the conversion. - * @len: the length of the passed string. - * - * Given an integer @num, convert it to a string. The string @str must be - * allocated beforehand. The resulting string will be null terminated and - * returned. This function only handles numbers between 0 and UINT64_MAX - * inclusive. - * - * Returns: the string @str of the converted integer @num - */ -char *uitoa(uint64_t num, char *str, size_t len) -{ - long num_idx =3D 1; /* account for NUL */ - uint64_t tmp =3D num; - - IPL_assert(str !=3D NULL, "uitoa: no space allocated to store string"); - - /* Count indices of num */ - while ((tmp /=3D 10) !=3D 0) { - num_idx++; - } - - /* Check if we have enough space for num and NUL */ - IPL_assert(len > num_idx, "uitoa: array too small for conversion"); - - str[num_idx--] =3D '\0'; - - /* Convert int to string */ - while (num_idx >=3D 0) { - str[num_idx--] =3D num % 10 + '0'; - num /=3D 10; - } - - return str; -} diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c index 5506798098..73093d3f14 100644 --- a/pc-bios/s390-ccw/main.c +++ b/pc-bios/s390-ccw/main.c @@ -8,7 +8,9 @@ * directory. */ =20 -#include "libc.h" +#include +#include +#include #include "helper.h" #include "s390-arch.h" #include "s390-ccw.h" @@ -50,7 +52,7 @@ void write_iplb_location(void) =20 unsigned int get_loadparm_index(void) { - return atoui(loadparm_str); + return atoi(loadparm_str); } =20 static int is_dev_possibly_bootable(int dev_no, int sch_no) @@ -176,7 +178,7 @@ static void boot_setup(void) =20 sclp_get_loadparm_ascii(loadparm_str); memcpy(lpmsg + 10, loadparm_str, 8); - sclp_print(lpmsg); + puts(lpmsg); =20 /* * Clear out any potential S390EP magic (see jump_to_low_kernel()), @@ -228,7 +230,7 @@ static int virtio_setup(void) =20 switch (vdev->senseid.cu_model) { case VIRTIO_ID_NET: - sclp_print("Network boot device detected\n"); + puts("Network boot device detected"); vdev->netboot_start_addr =3D qipl.netboot_start_addr; return 0; case VIRTIO_ID_BLOCK: @@ -261,7 +263,7 @@ static void ipl_boot_device(void) } break; default: - print_int("Attempting to boot from unexpected device type", cutype= ); + printf("Attempting to boot from unexpected device type 0x%X", cuty= pe); panic("\nBoot failed.\n"); } } @@ -287,7 +289,7 @@ static void probe_boot_device(void) } } =20 - sclp_print("Could not find a suitable boot device (none specified)\n"); + puts("Could not find a suitable boot device (none specified)"); } =20 void main(void) diff --git a/pc-bios/s390-ccw/menu.c b/pc-bios/s390-ccw/menu.c index d601952d3e..84062e94af 100644 --- a/pc-bios/s390-ccw/menu.c +++ b/pc-bios/s390-ccw/menu.c @@ -9,7 +9,10 @@ * directory. */ =20 -#include "libc.h" +#include +#include +#include +#include #include "s390-ccw.h" #include "sclp.h" #include "s390-time.h" @@ -93,7 +96,7 @@ static int read_prompt(char *buf, size_t len) case KEYCODE_BACKSP: if (idx > 0) { buf[--idx] =3D 0; - sclp_print("\b \b"); + printf("\b \b"); } continue; case KEYCODE_ENTER: @@ -103,7 +106,7 @@ static int read_prompt(char *buf, size_t len) /* Echo input and add to buffer */ if (idx < len) { buf[idx++] =3D inp[0]; - sclp_print(inp); + printf("%s", inp); } } } @@ -140,22 +143,19 @@ static int get_index(void) } } =20 - return atoui(buf); + return atoi(buf); } =20 static void boot_menu_prompt(bool retry) { - char tmp[11]; - if (retry) { - sclp_print("\nError: undefined configuration" + printf("\nError: undefined configuration" "\nPlease choose:\n"); } else if (timeout > 0) { - sclp_print("Please choose (default will boot in "); - sclp_print(uitoa(timeout / 1000, tmp, sizeof(tmp))); - sclp_print(" seconds):\n"); + printf("Please choose (default will boot in %d seconds):\n", + (int)(timeout / 1000)); } else { - sclp_print("Please choose:\n"); + puts("Please choose:"); } } =20 @@ -163,7 +163,6 @@ static int get_boot_index(bool *valid_entries) { int boot_index; bool retry =3D false; - char tmp[5]; =20 do { boot_menu_prompt(retry); @@ -172,8 +171,7 @@ static int get_boot_index(bool *valid_entries) } while (boot_index < 0 || boot_index >=3D MAX_BOOT_ENTRIES || !valid_entries[boot_index]); =20 - sclp_print("\nBooting entry #"); - sclp_print(uitoa(boot_index, tmp, sizeof(tmp))); + printf("\nBooting entry #%d", boot_index); =20 return boot_index; } @@ -187,9 +185,9 @@ static int zipl_print_entry(const char *data, size_t le= n) buf[len] =3D '\n'; buf[len + 1] =3D '\0'; =20 - sclp_print(buf); + printf("%s", buf); =20 - return buf[0] =3D=3D ' ' ? atoui(buf + 1) : atoui(buf); + return buf[0] =3D=3D ' ' ? atoi(buf + 1) : atoi(buf); } =20 int menu_get_zipl_boot_index(const char *menu_data) @@ -209,7 +207,7 @@ int menu_get_zipl_boot_index(const char *menu_data) } =20 /* Print banner */ - sclp_print("s390-ccw zIPL Boot Menu\n\n"); + puts("s390-ccw zIPL Boot Menu\n"); menu_data +=3D strlen(menu_data) + 1; =20 /* Print entries */ @@ -221,37 +219,34 @@ int menu_get_zipl_boot_index(const char *menu_data) valid_entries[entry] =3D true; =20 if (entry =3D=3D 0) { - sclp_print("\n"); + printf("\n"); } } =20 - sclp_print("\n"); + printf("\n"); return get_boot_index(valid_entries); } =20 int menu_get_enum_boot_index(bool *valid_entries) { - char tmp[3]; int i; =20 - sclp_print("s390-ccw Enumerated Boot Menu.\n\n"); + puts("s390-ccw Enumerated Boot Menu.\n"); =20 for (i =3D 0; i < MAX_BOOT_ENTRIES; i++) { if (valid_entries[i]) { if (i < 10) { - sclp_print(" "); + printf(" "); } - sclp_print("["); - sclp_print(uitoa(i, tmp, sizeof(tmp))); - sclp_print("]"); + printf("[%d]", i); if (i =3D=3D 0) { - sclp_print(" default\n"); + printf(" default\n"); } - sclp_print("\n"); + printf("\n"); } } =20 - sclp_print("\n"); + printf("\n"); return get_boot_index(valid_entries); } =20 diff --git a/pc-bios/s390-ccw/netmain.c b/pc-bios/s390-ccw/netmain.c index 5cd619b2d6..509119be15 100644 --- a/pc-bios/s390-ccw/netmain.c +++ b/pc-bios/s390-ccw/netmain.c @@ -293,7 +293,7 @@ static int load_kernel_with_initrd(filename_ip_t *fn_ip, printf("Loading pxelinux.cfg entry '%s'\n", entry->label); =20 if (!entry->kernel) { - printf("Kernel entry is missing!\n"); + puts("Kernel entry is missing!\n"); return -1; } =20 @@ -515,13 +515,13 @@ void main(void) int rc, fnlen; =20 sclp_setup(); - sclp_print("Network boot starting...\n"); + puts("Network boot starting..."); =20 virtio_setup(); =20 rc =3D net_init(&fn_ip); if (rc) { - panic("Network initialization failed. Halting.\n"); + panic("Network initialization failed. Halting."); } =20 fnlen =3D strlen(fn_ip.filename); @@ -535,9 +535,9 @@ void main(void) net_release(&fn_ip); =20 if (rc > 0) { - sclp_print("Network loading done, starting kernel...\n"); + puts("Network loading done, starting kernel..."); jump_to_low_kernel(); } =20 - panic("Failed to load OS from network\n"); + panic("Failed to load OS from network."); } diff --git a/pc-bios/s390-ccw/sclp.c b/pc-bios/s390-ccw/sclp.c index 7251f9af4d..4a07de018d 100644 --- a/pc-bios/s390-ccw/sclp.c +++ b/pc-bios/s390-ccw/sclp.c @@ -8,7 +8,7 @@ * directory. */ =20 -#include "libc.h" +#include #include "s390-ccw.h" #include "sclp.h" =20 @@ -101,11 +101,6 @@ long write(int fd, const void *str, size_t len) return len; } =20 -void sclp_print(const char *str) -{ - write(1, str, strlen(str)); -} - void sclp_get_loadparm_ascii(char *loadparm) { =20 diff --git a/pc-bios/s390-ccw/virtio-blkdev.c b/pc-bios/s390-ccw/virtio-blk= dev.c index a81207b52e..2666326801 100644 --- a/pc-bios/s390-ccw/virtio-blkdev.c +++ b/pc-bios/s390-ccw/virtio-blkdev.c @@ -8,7 +8,7 @@ * directory. */ =20 -#include "libc.h" +#include #include "s390-ccw.h" #include "virtio.h" #include "virtio-scsi.h" @@ -76,7 +76,7 @@ unsigned long virtio_load_direct(unsigned long rec_list1,= unsigned long rec_list return -1; } =20 - sclp_print("."); + printf("."); status =3D virtio_read_many(sec, (void *)addr, sec_num); if (status) { panic("I/O Error"); @@ -230,7 +230,7 @@ int virtio_blk_setup_device(SubChannelId schid) vdev->schid =3D schid; virtio_setup_ccw(vdev); =20 - sclp_print("Using virtio-blk.\n"); + puts("Using virtio-blk."); =20 return 0; } diff --git a/pc-bios/s390-ccw/virtio-scsi.c b/pc-bios/s390-ccw/virtio-scsi.c index d1a84b937c..0e274d0c38 100644 --- a/pc-bios/s390-ccw/virtio-scsi.c +++ b/pc-bios/s390-ccw/virtio-scsi.c @@ -9,7 +9,8 @@ * directory. */ =20 -#include "libc.h" +#include +#include #include "s390-ccw.h" #include "virtio.h" #include "scsi.h" @@ -30,9 +31,9 @@ static inline void vs_assert(bool term, const char **msgs) if (!term) { int i =3D 0; =20 - sclp_print("\n! "); + printf("\n! "); while (msgs[i]) { - sclp_print(msgs[i++]); + printf("%s", msgs[i++]); } panic(" !\n"); } @@ -236,11 +237,11 @@ static int virtio_scsi_locate_device(VDev *vdev) if (resp.response =3D=3D VIRTIO_SCSI_S_BAD_TARGET) { continue; } - print_int("target", target); + printf("target 0x%X", target); virtio_scsi_verify_response(&resp, "SCSI cannot report LUNs"); } if (r->lun_list_len =3D=3D 0) { - print_int("no LUNs for target", target); + printf("no LUNs for target 0x%X", target); continue; } luns =3D r->lun_list_len / 8; @@ -264,7 +265,7 @@ static int virtio_scsi_locate_device(VDev *vdev) } } =20 - sclp_print("Warning: Could not locate a usable virtio-scsi device\n"); + puts("Warning: Could not locate a usable virtio-scsi device"); return -ENODEV; } =20 @@ -379,7 +380,7 @@ static int virtio_scsi_setup(VDev *vdev) } =20 if (virtio_scsi_inquiry_response_is_cdrom(scsi_inquiry_std_response)) { - sclp_print("SCSI CD-ROM detected.\n"); + puts("SCSI CD-ROM detected."); vdev->is_cdrom =3D true; vdev->scsi_block_size =3D VIRTIO_ISO_BLOCK_SIZE; } @@ -443,7 +444,7 @@ int virtio_scsi_setup_device(SubChannelId schid) IPL_assert(vdev->config.scsi.cdb_size =3D=3D VIRTIO_SCSI_CDB_SIZE, "Config: CDB size mismatch"); =20 - sclp_print("Using virtio-scsi.\n"); + puts("Using virtio-scsi."); =20 return virtio_scsi_setup(vdev); } diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c index 5edd058d88..8c6b0a8a92 100644 --- a/pc-bios/s390-ccw/virtio.c +++ b/pc-bios/s390-ccw/virtio.c @@ -8,7 +8,7 @@ * directory. */ =20 -#include "libc.h" +#include #include "s390-ccw.h" #include "cio.h" #include "virtio.h" diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile index 6207911b53..3f4232636e 100644 --- a/pc-bios/s390-ccw/Makefile +++ b/pc-bios/s390-ccw/Makefile @@ -33,13 +33,18 @@ QEMU_DGFLAGS =3D -MMD -MP -MT $@ -MF $(@D)/$(*F).d .PHONY : all clean build-all distclean =20 OBJECTS =3D start.o main.o bootmap.o jump2ipl.o sclp.o menu.o \ - virtio.o virtio-scsi.o virtio-blkdev.o libc.o cio.o dasd-ipl.o + virtio.o virtio-scsi.o virtio-blkdev.o cio.o dasd-ipl.o + +SLOF_DIR :=3D $(SRC_PATH)/../../roms/SLOF + +LIBC_INC :=3D -nostdinc -I$(SLOF_DIR)/lib/libc/include =20 EXTRA_CFLAGS +=3D -Wall EXTRA_CFLAGS +=3D -ffreestanding -fno-delete-null-pointer-checks -fno-comm= on -fPIE EXTRA_CFLAGS +=3D -fwrapv -fno-strict-aliasing -fno-asynchronous-unwind-ta= bles EXTRA_CFLAGS +=3D -msoft-float EXTRA_CFLAGS +=3D -std=3Dgnu99 +EXTRA_CFLAGS +=3D $(LIBC_INC) LDFLAGS +=3D -Wl,-pie -nostdlib -z noexecstack =20 cc-test =3D $(CC) -Werror $1 -c -o /dev/null -xc /dev/null >/dev/null 2>/d= ev/null @@ -55,18 +60,18 @@ config-cc.mak: Makefile $(call cc-option,-march=3Dz900,-march=3Dz10)) 3> config-cc.mak -include config-cc.mak =20 +include $(SRC_PATH)/netboot.mak + build-all: s390-ccw.img s390-netboot.img =20 -s390-ccw.elf: $(OBJECTS) - $(call quiet-command,$(CC) $(LDFLAGS) -o $@ $(OBJECTS),Linking) +s390-ccw.elf: $(OBJECTS) libc.a + $(call quiet-command,$(CC) $(LDFLAGS) -o $@ $^,Linking) =20 s390-ccw.img: s390-ccw.elf $(call quiet-command,$(STRIP) --strip-unneeded $< -o $@,Stripping $< into) =20 $(OBJECTS): Makefile =20 -include $(SRC_PATH)/netboot.mak - ALL_OBJS =3D $(sort $(OBJECTS) $(NETOBJS) $(LIBCOBJS) $(LIBNETOBJS)) -include $(ALL_OBJS:%.o=3D%.d) =20 --=20 2.45.1 From nobody Sat Nov 23 21:59:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1728350220; cv=none; d=zohomail.com; s=zohoarc; b=moMbTXiBCWdAASt0Um9/ozro1sxp2O2BHMJc7sjdgp1C7T8OfapMFAK67zivJmVS2uFTZv1U2j3BRRVBpt6BssHvcI7m7QXAusYKV2RMW+qAYTS+JotE3ptWMRJ1znK0NrK5thI19ki/AKDdv52625kRWfCihAEcCnamuc4bHAY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728350220; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Xa9SWvj2nTOBj7ZdljDWx6GyUtVU/3eH1k+1NqUZLt0=; b=MCh4IJ3r/Eii62jYOUy7q/680BnrYPYefKyM/I6p2tXUakEjqYmXanK1fF1R3iuiFcr9GS0zTjiVQ5u7lLMgoHLDq8wYTeirC4WLldCq6w06Qcwm0JNFRQ/bZJSM2GI1fgmrVMuAzcZDJ+iFxmMX5N0SjIVdDJFo6caFQvZr40Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 172835022022035.82093342541589; Mon, 7 Oct 2024 18:17:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxypg-00043m-7x; Mon, 07 Oct 2024 21:16:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypc-00042M-Th; Mon, 07 Oct 2024 21:16:08 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypa-0008F9-SI; Mon, 07 Oct 2024 21:16:08 -0400 Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4980P4mU002291; Tue, 8 Oct 2024 01:16:05 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424t5tg5d2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:05 +0000 (GMT) Received: from m0360083.ppops.net (m0360083.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4981G4in000799; Tue, 8 Oct 2024 01:16:04 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424t5tg5d0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:04 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 497N5EnV022861; Tue, 8 Oct 2024 01:16:03 GMT Received: from smtprelay01.wdc07v.mail.ibm.com ([172.16.1.68]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 423jg0s7nt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:03 +0000 Received: from smtpav06.dal12v.mail.ibm.com (smtpav06.dal12v.mail.ibm.com [10.241.53.105]) by smtprelay01.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4981G1kY47645314 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Oct 2024 01:16:02 GMT Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C51B958055; Tue, 8 Oct 2024 01:16:01 +0000 (GMT) Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 47CA158043; Tue, 8 Oct 2024 01:16:01 +0000 (GMT) Received: from localhost.localdomain (unknown [9.61.51.58]) by smtpav06.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 8 Oct 2024 01:16:01 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=pp1; bh=Xa9SWvj2nTOBj 7ZdljDWx6GyUtVU/3eH1k+1NqUZLt0=; b=MnOurqNOsllNcqgCEEFdkjUUxYFPT 1bGM+9dAR8lwXUj5qtBn11o7uaw+eyqphNxqw03L94itqf7X2tYdym+tPxiGRrMy GdSHVk40A6cbw6uw7Hml8HcuuaU3fJ3EVVM0EyMyDuDtwN8aPxkqJhkLMQeXK5k0 Z7adQqD8rhPSTmgwrsx0+wPuynwEvCWP0Ap+zPRJ9K5imhqZXse8pq/rOdaCAmqw zkEzRdccq8AzXDiJRDPN1tv/B3/Iv8eqAgQmRQqYTsfdT2a6neoK8Pau1eV7z6jg Y3ANWxAoiFZhkYPdGL4HpF79aY3cxZHZPlu3V++fhsd6jKTdLyJN3y7CQ== From: jrossi@linux.ibm.com To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org, thuth@redhat.com Cc: frankja@linux.ibm.com, jrossi@linux.ibm.com Subject: [PATCH v3 03/19] pc-bios/s390-ccw: Link the netboot code into the main s390-ccw.img binary Date: Mon, 7 Oct 2024 21:15:36 -0400 Message-ID: <20241008011552.2645520-4-jrossi@linux.ibm.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241008011552.2645520-1-jrossi@linux.ibm.com> References: <20241008011552.2645520-1-jrossi@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: EY-2RPkI7Ksw5XYJuncxneDU9Lt74Rri X-Proofpoint-GUID: Um5hFovDlJbjrdUX3xDVz5Hl5LxWNpb1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-07_16,2024-10-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 mlxscore=0 lowpriorityscore=0 clxscore=1015 mlxlogscore=898 adultscore=0 spamscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410080006 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=148.163.156.1; envelope-from=jrossi@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1728350222426116600 Content-Type: text/plain; charset="utf-8" From: Jared Rossi We originally built a separate binary for the netboot code since it was considered as experimental and we could not be sure that the necessary SLOF module had been checked out. Time passed, the code proved its usefulness, and the build system nowadays makes sure that the SLOF module is checked out if you have a s390x compiler available for building the s390-ccw bios. So there is no real compelling reason anymore to keep the netboot code in a separate binary. Linking the code together with the main s390-ccw.img will make future enhancements much easier, like supporting more than one boot device. Co-authored by: Thomas Huth Signed-off-by: Jared Rossi --- pc-bios/s390-ccw/netboot.mak | 14 -------------- pc-bios/s390-ccw/cio.h | 2 ++ pc-bios/s390-ccw/iplb.h | 4 ++-- pc-bios/s390-ccw/s390-ccw.h | 3 +++ pc-bios/s390-ccw/virtio.h | 1 - pc-bios/s390-ccw/bootmap.c | 2 +- pc-bios/s390-ccw/main.c | 10 +++++++--- pc-bios/s390-ccw/netmain.c | 15 ++------------- pc-bios/s390-ccw/Makefile | 13 +++++++------ 9 files changed, 24 insertions(+), 40 deletions(-) diff --git a/pc-bios/s390-ccw/netboot.mak b/pc-bios/s390-ccw/netboot.mak index d2b3d8ee74..0a24257ff4 100644 --- a/pc-bios/s390-ccw/netboot.mak +++ b/pc-bios/s390-ccw/netboot.mak @@ -1,18 +1,4 @@ =20 -NETOBJS :=3D start.o sclp.o cio.o virtio.o virtio-net.o jump2ipl.o netmain= .o - -LIBNET_INC :=3D -I$(SLOF_DIR)/lib/libnet - -NETLDFLAGS :=3D $(LDFLAGS) -Wl,-Ttext=3D0x7800000 - -$(NETOBJS): EXTRA_CFLAGS +=3D $(LIBC_INC) $(LIBNET_INC) - -s390-netboot.elf: $(NETOBJS) libnet.a libc.a - $(call quiet-command,$(CC) $(NETLDFLAGS) -o $@ $^,Linking) - -s390-netboot.img: s390-netboot.elf - $(call quiet-command,$(STRIP) --strip-unneeded $< -o $@,Stripping $< into) - # libc files: =20 LIBC_CFLAGS =3D $(EXTRA_CFLAGS) $(CFLAGS) $(LIBC_INC) $(LIBNET_INC) \ diff --git a/pc-bios/s390-ccw/cio.h b/pc-bios/s390-ccw/cio.h index 8b18153deb..6a5e86ba01 100644 --- a/pc-bios/s390-ccw/cio.h +++ b/pc-bios/s390-ccw/cio.h @@ -361,6 +361,8 @@ typedef struct CcwSearchIdData { uint8_t record; } __attribute__((packed)) CcwSearchIdData; =20 +extern SubChannelId net_schid; + int enable_mss_facility(void); void enable_subchannel(SubChannelId schid); uint16_t cu_type(SubChannelId schid); diff --git a/pc-bios/s390-ccw/iplb.h b/pc-bios/s390-ccw/iplb.h index cb6ac8a880..3758698468 100644 --- a/pc-bios/s390-ccw/iplb.h +++ b/pc-bios/s390-ccw/iplb.h @@ -87,9 +87,9 @@ extern IplParameterBlock iplb __attribute__((__aligned__(= PAGE_SIZE))); struct QemuIplParameters { uint8_t qipl_flags; uint8_t reserved1[3]; - uint64_t netboot_start_addr; + uint64_t reserved2; uint32_t boot_menu_timeout; - uint8_t reserved2[12]; + uint8_t reserved3[12]; } __attribute__ ((packed)); typedef struct QemuIplParameters QemuIplParameters; =20 diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h index 9b622e616a..0ed7eb8ade 100644 --- a/pc-bios/s390-ccw/s390-ccw.h +++ b/pc-bios/s390-ccw/s390-ccw.h @@ -55,6 +55,9 @@ void write_iplb_location(void); unsigned int get_loadparm_index(void); void main(void); =20 +/* netmain.c */ +void netmain(void); + /* sclp.c */ void sclp_print(const char *string); void sclp_set_write_mask(uint32_t receive_mask, uint32_t send_mask); diff --git a/pc-bios/s390-ccw/virtio.h b/pc-bios/s390-ccw/virtio.h index 85bd9d1695..6f9a558ff5 100644 --- a/pc-bios/s390-ccw/virtio.h +++ b/pc-bios/s390-ccw/virtio.h @@ -253,7 +253,6 @@ struct VDev { uint8_t scsi_dev_heads; bool scsi_device_selected; ScsiDevice selected_scsi_device; - uint64_t netboot_start_addr; uint32_t max_transfer; uint32_t guest_features[2]; }; diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c index 3cc79706be..414c3f1b47 100644 --- a/pc-bios/s390-ccw/bootmap.c +++ b/pc-bios/s390-ccw/bootmap.c @@ -929,7 +929,7 @@ void zipl_load(void) } =20 if (virtio_get_device_type() =3D=3D VIRTIO_ID_NET) { - jump_to_IPL_code(vdev->netboot_start_addr); + netmain(); } =20 ipl_scsi(); diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c index 73093d3f14..2345432abb 100644 --- a/pc-bios/s390-ccw/main.c +++ b/pc-bios/s390-ccw/main.c @@ -38,8 +38,13 @@ LowCore *lowcore; /* Yes, this *is* a pointer to address= 0 */ */ void write_subsystem_identification(void) { - lowcore->subchannel_id =3D blk_schid.sch_id; - lowcore->subchannel_nr =3D blk_schid.sch_no; + if (cutype =3D=3D CU_TYPE_VIRTIO && virtio_get_device_type() =3D=3D VI= RTIO_ID_NET) { + lowcore->subchannel_id =3D net_schid.sch_id; + lowcore->subchannel_nr =3D net_schid.sch_no; + } else { + lowcore->subchannel_id =3D blk_schid.sch_id; + lowcore->subchannel_nr =3D blk_schid.sch_no; + } lowcore->io_int_parm =3D 0; } =20 @@ -231,7 +236,6 @@ static int virtio_setup(void) switch (vdev->senseid.cu_model) { case VIRTIO_ID_NET: puts("Network boot device detected"); - vdev->netboot_start_addr =3D qipl.netboot_start_addr; return 0; case VIRTIO_ID_BLOCK: ret =3D virtio_blk_setup_device(blk_schid); diff --git a/pc-bios/s390-ccw/netmain.c b/pc-bios/s390-ccw/netmain.c index 509119be15..bc6ad8695f 100644 --- a/pc-bios/s390-ccw/netmain.c +++ b/pc-bios/s390-ccw/netmain.c @@ -41,7 +41,6 @@ #define DEFAULT_TFTP_RETRIES 20 =20 extern char _start[]; -void write_iplb_location(void) {} =20 #define KERNEL_ADDR ((void *)0L) #define KERNEL_MAX_SIZE ((long)_start) @@ -50,10 +49,9 @@ void write_iplb_location(void) {} /* STSI 3.2.2 offset of first vmdb + offset of uuid inside vmdb */ #define STSI322_VMDB_UUID_OFFSET ((8 + 12) * 4) =20 -IplParameterBlock iplb __attribute__((aligned(PAGE_SIZE))); static char cfgbuf[2048]; =20 -static SubChannelId net_schid =3D { .one =3D 1 }; +SubChannelId net_schid =3D { .one =3D 1 }; static uint8_t mac[6]; static uint64_t dest_timer; =20 @@ -438,15 +436,6 @@ static int net_try_direct_tftp_load(filename_ip_t *fn_= ip) return rc; } =20 -void write_subsystem_identification(void) -{ - SubChannelId *schid =3D (SubChannelId *) 184; - uint32_t *zeroes =3D (uint32_t *) 188; - - *schid =3D net_schid; - *zeroes =3D 0; -} - static bool find_net_dev(Schib *schib, int dev_no) { int i, r; @@ -509,7 +498,7 @@ static void virtio_setup(void) IPL_assert(found, "No virtio net device found"); } =20 -void main(void) +void netmain(void) { filename_ip_t fn_ip; int rc, fnlen; diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile index 3f4232636e..cf6859823a 100644 --- a/pc-bios/s390-ccw/Makefile +++ b/pc-bios/s390-ccw/Makefile @@ -32,19 +32,20 @@ QEMU_DGFLAGS =3D -MMD -MP -MT $@ -MF $(@D)/$(*F).d =20 .PHONY : all clean build-all distclean =20 -OBJECTS =3D start.o main.o bootmap.o jump2ipl.o sclp.o menu.o \ - virtio.o virtio-scsi.o virtio-blkdev.o cio.o dasd-ipl.o +OBJECTS =3D start.o main.o bootmap.o jump2ipl.o sclp.o menu.o netmain.o \ + virtio.o virtio-net.o virtio-scsi.o virtio-blkdev.o cio.o dasd-ipl.o =20 SLOF_DIR :=3D $(SRC_PATH)/../../roms/SLOF =20 LIBC_INC :=3D -nostdinc -I$(SLOF_DIR)/lib/libc/include +LIBNET_INC :=3D -I$(SLOF_DIR)/lib/libnet =20 EXTRA_CFLAGS +=3D -Wall EXTRA_CFLAGS +=3D -ffreestanding -fno-delete-null-pointer-checks -fno-comm= on -fPIE EXTRA_CFLAGS +=3D -fwrapv -fno-strict-aliasing -fno-asynchronous-unwind-ta= bles EXTRA_CFLAGS +=3D -msoft-float EXTRA_CFLAGS +=3D -std=3Dgnu99 -EXTRA_CFLAGS +=3D $(LIBC_INC) +EXTRA_CFLAGS +=3D $(LIBC_INC) $(LIBNET_INC) LDFLAGS +=3D -Wl,-pie -nostdlib -z noexecstack =20 cc-test =3D $(CC) -Werror $1 -c -o /dev/null -xc /dev/null >/dev/null 2>/d= ev/null @@ -62,9 +63,9 @@ config-cc.mak: Makefile =20 include $(SRC_PATH)/netboot.mak =20 -build-all: s390-ccw.img s390-netboot.img +build-all: s390-ccw.img =20 -s390-ccw.elf: $(OBJECTS) libc.a +s390-ccw.elf: $(OBJECTS) libnet.a libc.a $(call quiet-command,$(CC) $(LDFLAGS) -o $@ $^,Linking) =20 s390-ccw.img: s390-ccw.elf @@ -72,7 +73,7 @@ s390-ccw.img: s390-ccw.elf =20 $(OBJECTS): Makefile =20 -ALL_OBJS =3D $(sort $(OBJECTS) $(NETOBJS) $(LIBCOBJS) $(LIBNETOBJS)) +ALL_OBJS =3D $(sort $(OBJECTS) $(LIBCOBJS) $(LIBNETOBJS)) -include $(ALL_OBJS:%.o=3D%.d) =20 clean: --=20 2.45.1 From nobody Sat Nov 23 21:59:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1728350243; cv=none; d=zohomail.com; s=zohoarc; b=VEl8l0HHVEt05imXOEuEN7lBGQHkdBteF3poA+4WXezMLPO1Mu8w8bYVkovsgwLZjfQEPuLjCGr5jB1NM0KETpvZrIdy7BRdwJ+uGf2EcEecHLKwvJk0I38zEHZV8DMXGaRLLyj6LKgDsLUbAqWqtgxcOBbdxa0vjdh74K/s6Lc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728350243; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Wgfcz87uZBAneHSMMi1Wkl9ZAA23tfYn02tGR2s1e8U=; b=AZbqEdnZXs5pnwT/g7Wb9yRwpgpsZipowdM+1kGUXOudbpn/78aKVYv3OqsoXpgR7hD8b3KcA7CwyU1/KHB9g88QUfpME/u+W7YDaaO7pRqgcU+nv5p1l/pnqHsW/jiotFSDBP3iJe1/uJBcomSnswys5h8YHqk9BE5MTNPMUqc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1728350243630980.0831083570247; Mon, 7 Oct 2024 18:17:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxypg-00044o-U1; Mon, 07 Oct 2024 21:16:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxype-00043M-MA; Mon, 07 Oct 2024 21:16:10 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypc-0008Fu-Hy; Mon, 07 Oct 2024 21:16:10 -0400 Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 497Ljwpo022420; Tue, 8 Oct 2024 01:16:06 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424qu78m4a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:06 +0000 (GMT) Received: from m0356517.ppops.net (m0356517.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4981G5ZC027039; Tue, 8 Oct 2024 01:16:05 GMT Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424qu78m47-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:05 +0000 (GMT) Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 4981Ap03011516; Tue, 8 Oct 2024 01:16:04 GMT Received: from smtprelay02.wdc07v.mail.ibm.com ([172.16.1.69]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 423g5xhpv5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:04 +0000 Received: from smtpav06.dal12v.mail.ibm.com (smtpav06.dal12v.mail.ibm.com [10.241.53.105]) by smtprelay02.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4981G3OW23200478 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Oct 2024 01:16:03 GMT Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0FDBF5805D; Tue, 8 Oct 2024 01:16:03 +0000 (GMT) Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8F4AE58043; Tue, 8 Oct 2024 01:16:02 +0000 (GMT) Received: from localhost.localdomain (unknown [9.61.51.58]) by smtpav06.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 8 Oct 2024 01:16:02 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=pp1; bh=Wgfcz87uZBAne HSMMi1Wkl9ZAA23tfYn02tGR2s1e8U=; b=tqc8LAnvO/ht9/Rv/i8VjSatKnHpJ +BGhKIqoTg6Bh6JhmsO2ohsDvKACFM0IIBLEyhCxPQxq5sfIqDgeh0NmMBBOCSEI MFWxyCL2VZs9J9AwYx/ArB991ypbEJh43PHor8DvlKyLCyLRUyt4K4HOuoDZ34yF phONOgpjA4WM8PAkabPcdd6PqD92zFoVhQdQx091XKh6VLEEA7DAauCdUMKQ1qU3 ZpltQRUdMyV1soBd9HR0SAqQ4wU2EREVwpF/S3bIErLEknDNnsvR/pO4AW+8zpcs sLf1mSYQHjIOgsxqTbN2FYFlREdUO+jCsyLqg7P1o2eeldcQunQvufX4Q== From: jrossi@linux.ibm.com To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org, thuth@redhat.com Cc: frankja@linux.ibm.com, jrossi@linux.ibm.com Subject: [PATCH v3 04/19] hw/s390x: Remove the possibility to load the s390-netboot.img binary Date: Mon, 7 Oct 2024 21:15:37 -0400 Message-ID: <20241008011552.2645520-5-jrossi@linux.ibm.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241008011552.2645520-1-jrossi@linux.ibm.com> References: <20241008011552.2645520-1-jrossi@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 9LUIZj8vzThYqdjOMuVtBEJn11gGp12t X-Proofpoint-GUID: g5IrIqX6xXCSiY8ygoWEN6D4as8tdr0t X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-07_16,2024-10-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 lowpriorityscore=0 adultscore=0 malwarescore=0 phishscore=0 spamscore=0 mlxlogscore=999 clxscore=1015 priorityscore=1501 mlxscore=0 impostorscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410080006 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=148.163.156.1; envelope-from=jrossi@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1728350244179116600 Content-Type: text/plain; charset="utf-8" From: Jared Rossi Since the netboot code has now been merged into the main s390-ccw.img binary, we don't need the separate s390-netboot.img anymore. Remove it and the code that was responsible for loading it. Co-authored by: Thomas Huth Signed-off-by: Jared Rossi --- hw/s390x/ipl.h | 12 +++------ hw/s390x/ipl.c | 55 -------------------------------------- hw/s390x/s390-virtio-ccw.c | 10 ++----- pc-bios/meson.build | 1 - 4 files changed, 6 insertions(+), 72 deletions(-) diff --git a/hw/s390x/ipl.h b/hw/s390x/ipl.h index 57cd125769..b2105b616a 100644 --- a/hw/s390x/ipl.h +++ b/hw/s390x/ipl.h @@ -134,11 +134,8 @@ void s390_ipl_clear_reset_request(void); /* * The QEMU IPL Parameters will be stored at absolute address * 204 (0xcc) which means it is 32-bit word aligned but not - * double-word aligned. - * Placement of data fields in this area must account for - * their alignment needs. E.g., netboot_start_address must - * have an offset of 4 + n * 8 bytes within the struct in order - * to keep it double-word aligned. + * double-word aligned. Placement of 64-bit data fields in this + * area must account for their alignment needs. * The total size of the struct must never exceed 28 bytes. * This definition must be kept in sync with the definition * in pc-bios/s390-ccw/iplb.h. @@ -146,9 +143,9 @@ void s390_ipl_clear_reset_request(void); struct QemuIplParameters { uint8_t qipl_flags; uint8_t reserved1[3]; - uint64_t netboot_start_addr; + uint64_t reserved2; uint32_t boot_menu_timeout; - uint8_t reserved2[12]; + uint8_t reserved3[12]; } QEMU_PACKED; typedef struct QemuIplParameters QemuIplParameters; =20 @@ -178,7 +175,6 @@ struct S390IPLState { char *initrd; char *cmdline; char *firmware; - char *netboot_fw; uint8_t cssid; uint8_t ssid; uint16_t devno; diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c index 5f60977ceb..8c490eeb52 100644 --- a/hw/s390x/ipl.c +++ b/hw/s390x/ipl.c @@ -288,7 +288,6 @@ static Property s390_ipl_properties[] =3D { DEFINE_PROP_STRING("initrd", S390IPLState, initrd), DEFINE_PROP_STRING("cmdline", S390IPLState, cmdline), DEFINE_PROP_STRING("firmware", S390IPLState, firmware), - DEFINE_PROP_STRING("netboot_fw", S390IPLState, netboot_fw), DEFINE_PROP_BOOL("enforce_bios", S390IPLState, enforce_bios, false), DEFINE_PROP_BOOL("iplbext_migration", S390IPLState, iplbext_migration, true), @@ -480,56 +479,6 @@ int s390_ipl_set_loadparm(uint8_t *loadparm) return -1; } =20 -static int load_netboot_image(Error **errp) -{ - MachineState *ms =3D MACHINE(qdev_get_machine()); - S390IPLState *ipl =3D get_ipl_device(); - char *netboot_filename; - MemoryRegion *sysmem =3D get_system_memory(); - MemoryRegion *mr =3D NULL; - void *ram_ptr =3D NULL; - int img_size =3D -1; - - mr =3D memory_region_find(sysmem, 0, 1).mr; - if (!mr) { - error_setg(errp, "Failed to find memory region at address 0"); - return -1; - } - - ram_ptr =3D memory_region_get_ram_ptr(mr); - if (!ram_ptr) { - error_setg(errp, "No RAM found"); - goto unref_mr; - } - - netboot_filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, ipl->netboot_= fw); - if (netboot_filename =3D=3D NULL) { - error_setg(errp, "Could not find network bootloader '%s'", - ipl->netboot_fw); - goto unref_mr; - } - - img_size =3D load_elf_ram(netboot_filename, NULL, NULL, NULL, - &ipl->start_addr, - NULL, NULL, NULL, 1, EM_S390, 0, 0, NULL, - false); - - if (img_size < 0) { - img_size =3D load_image_size(netboot_filename, ram_ptr, ms->ram_si= ze); - ipl->start_addr =3D KERN_IMAGE_START; - } - - if (img_size < 0) { - error_setg(errp, "Failed to load network bootloader"); - } - - g_free(netboot_filename); - -unref_mr: - memory_region_unref(mr); - return img_size; -} - static bool is_virtio_ccw_device_of_type(IplParameterBlock *iplb, int virtio_id) { @@ -754,10 +703,6 @@ void s390_ipl_prepare_cpu(S390CPU *cpu) ipl->iplb_valid =3D s390_gen_initial_iplb(ipl); } } - if (ipl->netboot) { - load_netboot_image(&error_fatal); - ipl->qipl.netboot_start_addr =3D cpu_to_be64(ipl->start_addr); - } s390_ipl_set_boot_menu(ipl); s390_ipl_prepare_qipl(cpu); } diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 5aa8d207a3..529e53f308 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -197,11 +197,10 @@ static void s390_memory_init(MemoryRegion *ram) static void s390_init_ipl_dev(const char *kernel_filename, const char *kernel_cmdline, const char *initrd_filename, const char *fir= mware, - const char *netboot_fw, bool enforce_bios) + bool enforce_bios) { Object *new =3D object_new(TYPE_S390_IPL); DeviceState *dev =3D DEVICE(new); - char *netboot_fw_prop; =20 if (kernel_filename) { qdev_prop_set_string(dev, "kernel", kernel_filename); @@ -212,11 +211,6 @@ static void s390_init_ipl_dev(const char *kernel_filen= ame, qdev_prop_set_string(dev, "cmdline", kernel_cmdline); qdev_prop_set_string(dev, "firmware", firmware); qdev_prop_set_bit(dev, "enforce_bios", enforce_bios); - netboot_fw_prop =3D object_property_get_str(new, "netboot_fw", &error_= abort); - if (!strlen(netboot_fw_prop)) { - qdev_prop_set_string(dev, "netboot_fw", netboot_fw); - } - g_free(netboot_fw_prop); object_property_add_child(qdev_get_machine(), TYPE_S390_IPL, new); object_unref(new); @@ -284,7 +278,7 @@ static void ccw_init(MachineState *machine) s390_init_ipl_dev(machine->kernel_filename, machine->kernel_cmdline, machine->initrd_filename, machine->firmware ?: "s390-ccw.img", - "s390-netboot.img", true); + true); =20 dev =3D qdev_new(TYPE_S390_PCI_HOST_BRIDGE); object_property_add_child(qdev_get_machine(), TYPE_S390_PCI_HOST_BRIDG= E, diff --git a/pc-bios/meson.build b/pc-bios/meson.build index 090379763e..4823dff189 100644 --- a/pc-bios/meson.build +++ b/pc-bios/meson.build @@ -68,7 +68,6 @@ blobs =3D [ 'kvmvapic.bin', 'pvh.bin', 's390-ccw.img', - 's390-netboot.img', 'slof.bin', 'skiboot.lid', 'palcode-clipper', --=20 2.45.1 From nobody Sat Nov 23 21:59:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1728350291; cv=none; d=zohomail.com; s=zohoarc; b=SxMeo0tC/nAEH0JWEksJj53FbqJ3QeGzMBDd+QH8EtX6RlMRzr3ABup4ZZ7C8MHkXvucU3c8zq19ketItjLgnCsIl85WGt6ICpkw+Xg5z4so4O+9KRRJzCzW4r/laYIx5N6gMlBSBm+Lcb5j18EHiVnHBTNjW/c2jHI5pIlU9Rk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728350291; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=tX2wGx0xeOmZ7E/fy5NtqQJRluafjriSO7wns8yXhiM=; b=iYYogasO0A6K41oEx7k0FytITldSNmhbOSWVplFe7+nLbUCOsrVPXAqzAL8mvABXUu2D/FXIGYiLtItoN0elfqoYiDEKfrirBUvN/n2upQRfqXIx3lRTmIv5pBcn2Uoq/A5TRKJEsEpkEiKCNqQdAQLR30nvW9YH+/lGCShwvA4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1728350291797251.81797307759166; Mon, 7 Oct 2024 18:18:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxypk-00046p-Ne; Mon, 07 Oct 2024 21:16:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypi-00045R-VB; Mon, 07 Oct 2024 21:16:15 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypc-0008GJ-Rs; Mon, 07 Oct 2024 21:16:14 -0400 Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 497NtLgS026830; Tue, 8 Oct 2024 01:16:07 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424sr4g7gq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:07 +0000 (GMT) Received: from m0360072.ppops.net (m0360072.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4981G6kH016973; Tue, 8 Oct 2024 01:16:06 GMT Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424sr4g7gj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:06 +0000 (GMT) Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 49816PCo011521; Tue, 8 Oct 2024 01:16:06 GMT Received: from smtprelay03.wdc07v.mail.ibm.com ([172.16.1.70]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 423g5xhpv6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:06 +0000 Received: from smtpav06.dal12v.mail.ibm.com (smtpav06.dal12v.mail.ibm.com [10.241.53.105]) by smtprelay03.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4981G4an28639970 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Oct 2024 01:16:04 GMT Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6336D58059; Tue, 8 Oct 2024 01:16:04 +0000 (GMT) Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C73A158043; Tue, 8 Oct 2024 01:16:03 +0000 (GMT) Received: from localhost.localdomain (unknown [9.61.51.58]) by smtpav06.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 8 Oct 2024 01:16:03 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=pp1; bh=tX2wGx0xeOmZ7 E/fy5NtqQJRluafjriSO7wns8yXhiM=; b=a9ZTu35Gc2ugf3lXTRWViYOOsK0YK jN3G42yWtD0mGqwfg7G2jpxFB3kRLIeHMN7TG7LHp2/EwqAw2Q/sPw60QA6ZNory FM9hH38UWGXued0wWM2Wis6jzSNv7rWQcfw896CMwqkz/pcOuQKczr0GY6lY3Dbj Qz1FSlqAQZDsS7JE/P4qwFU+HR2GzyQ1IeidyKmTcrPYV3R/qm5mOkEvz8bU1zDd dpGnISxvjdKjoZEMuq0vr36D/aDqXnVVz3zHNrn23cfks8WKSKsuhrzoNpjulgBL D52cTmVeryBvFv9uZUZcbB8XmHSxzu16qugpMkdSaze2nNstrEJwkTGpQ== From: jrossi@linux.ibm.com To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org, thuth@redhat.com Cc: frankja@linux.ibm.com, jrossi@linux.ibm.com Subject: [PATCH v3 05/19] pc-bios/s390-ccw: Merge netboot.mak into the main Makefile Date: Mon, 7 Oct 2024 21:15:38 -0400 Message-ID: <20241008011552.2645520-6-jrossi@linux.ibm.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241008011552.2645520-1-jrossi@linux.ibm.com> References: <20241008011552.2645520-1-jrossi@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: i3k1yHZKFxHwPTcaDCTLKjficNaA1uVM X-Proofpoint-GUID: c6G5ZnII-5PhGJ_fl0sobfzJr9_ut72E X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-07_16,2024-10-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 bulkscore=0 clxscore=1015 spamscore=0 mlxscore=0 lowpriorityscore=0 phishscore=0 malwarescore=0 suspectscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410080003 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=148.163.158.5; envelope-from=jrossi@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, LOTS_OF_MONEY=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1728350292356116600 Content-Type: text/plain; charset="utf-8" From: Jared Rossi Now that the netboot code has been merged into the main s390-ccw.img, it also does not make sense to keep the build rules in a separate file. Thus let's merge netboot.mak into the main Makefile. Co-authored by: Thomas Huth Signed-off-by: Jared Rossi --- pc-bios/s390-ccw/netboot.mak | 45 --------------------------------- pc-bios/s390-ccw/Makefile | 47 ++++++++++++++++++++++++++++++++++- pc-bios/s390-netboot.img | Bin 67232 -> 0 bytes 3 files changed, 46 insertions(+), 46 deletions(-) delete mode 100644 pc-bios/s390-ccw/netboot.mak delete mode 100644 pc-bios/s390-netboot.img diff --git a/pc-bios/s390-ccw/netboot.mak b/pc-bios/s390-ccw/netboot.mak deleted file mode 100644 index 0a24257ff4..0000000000 --- a/pc-bios/s390-ccw/netboot.mak +++ /dev/null @@ -1,45 +0,0 @@ - -# libc files: - -LIBC_CFLAGS =3D $(EXTRA_CFLAGS) $(CFLAGS) $(LIBC_INC) $(LIBNET_INC) \ - -MMD -MP -MT $@ -MF $(@:%.o=3D%.d) - -CTYPE_OBJS =3D isdigit.o isxdigit.o toupper.o -%.o : $(SLOF_DIR)/lib/libc/ctype/%.c - $(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,Compiling) - -STRING_OBJS =3D strcat.o strchr.o strrchr.o strcpy.o strlen.o strncpy.o \ - strcmp.o strncmp.o strcasecmp.o strncasecmp.o strstr.o \ - memset.o memcpy.o memmove.o memcmp.o -%.o : $(SLOF_DIR)/lib/libc/string/%.c - $(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,Compiling) - -STDLIB_OBJS =3D atoi.o atol.o strtoul.o strtol.o rand.o malloc.o free.o -%.o : $(SLOF_DIR)/lib/libc/stdlib/%.c - $(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,Compiling) - -STDIO_OBJS =3D sprintf.o snprintf.o vfprintf.o vsnprintf.o vsprintf.o fpri= ntf.o \ - printf.o putc.o puts.o putchar.o stdchnls.o fileno.o -%.o : $(SLOF_DIR)/lib/libc/stdio/%.c - $(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,Compiling) - -sbrk.o: $(SLOF_DIR)/slof/sbrk.c - $(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,Compiling) - -LIBCOBJS :=3D $(STRING_OBJS) $(CTYPE_OBJS) $(STDLIB_OBJS) $(STDIO_OBJS) sb= rk.o - -libc.a: $(LIBCOBJS) - $(call quiet-command,$(AR) -rc $@ $^,Creating static library) - -# libnet files: - -LIBNETOBJS :=3D args.o dhcp.o dns.o icmpv6.o ipv6.o tcp.o udp.o bootp.o \ - dhcpv6.o ethernet.o ipv4.o ndp.o tftp.o pxelinux.o -LIBNETCFLAGS =3D $(EXTRA_CFLAGS) $(CFLAGS) $(LIBC_INC) $(LIBNET_INC) \ - -DDHCPARCH=3D0x1F -MMD -MP -MT $@ -MF $(@:%.o=3D%.d) - -%.o : $(SLOF_DIR)/lib/libnet/%.c - $(call quiet-command,$(CC) $(LIBNETCFLAGS) -c -o $@ $<,Compiling) - -libnet.a: $(LIBNETOBJS) - $(call quiet-command,$(AR) -rc $@ $^,Creating static library) diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile index cf6859823a..27cbb354af 100644 --- a/pc-bios/s390-ccw/Makefile +++ b/pc-bios/s390-ccw/Makefile @@ -61,7 +61,52 @@ config-cc.mak: Makefile $(call cc-option,-march=3Dz900,-march=3Dz10)) 3> config-cc.mak -include config-cc.mak =20 -include $(SRC_PATH)/netboot.mak +# libc files: + +LIBC_CFLAGS =3D $(EXTRA_CFLAGS) $(CFLAGS) $(LIBC_INC) $(LIBNET_INC) \ + -MMD -MP -MT $@ -MF $(@:%.o=3D%.d) + +CTYPE_OBJS =3D isdigit.o isxdigit.o toupper.o +%.o : $(SLOF_DIR)/lib/libc/ctype/%.c + $(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,Compiling) + +STRING_OBJS =3D strcat.o strchr.o strrchr.o strcpy.o strlen.o strncpy.o \ + strcmp.o strncmp.o strcasecmp.o strncasecmp.o strstr.o \ + memset.o memcpy.o memmove.o memcmp.o +%.o : $(SLOF_DIR)/lib/libc/string/%.c + $(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,Compiling) + +STDLIB_OBJS =3D atoi.o atol.o strtoul.o strtol.o rand.o malloc.o free.o +%.o : $(SLOF_DIR)/lib/libc/stdlib/%.c + $(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,Compiling) + +STDIO_OBJS =3D sprintf.o snprintf.o vfprintf.o vsnprintf.o vsprintf.o fpri= ntf.o \ + printf.o putc.o puts.o putchar.o stdchnls.o fileno.o +%.o : $(SLOF_DIR)/lib/libc/stdio/%.c + $(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,Compiling) + +sbrk.o: $(SLOF_DIR)/slof/sbrk.c + $(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,Compiling) + +LIBCOBJS :=3D $(STRING_OBJS) $(CTYPE_OBJS) $(STDLIB_OBJS) $(STDIO_OBJS) sb= rk.o + +libc.a: $(LIBCOBJS) + $(call quiet-command,$(AR) -rc $@ $^,Creating static library) + +# libnet files: + +LIBNETOBJS :=3D args.o dhcp.o dns.o icmpv6.o ipv6.o tcp.o udp.o bootp.o \ + dhcpv6.o ethernet.o ipv4.o ndp.o tftp.o pxelinux.o +LIBNETCFLAGS =3D $(EXTRA_CFLAGS) $(CFLAGS) $(LIBC_INC) $(LIBNET_INC) \ + -DDHCPARCH=3D0x1F -MMD -MP -MT $@ -MF $(@:%.o=3D%.d) + +%.o : $(SLOF_DIR)/lib/libnet/%.c + $(call quiet-command,$(CC) $(LIBNETCFLAGS) -c -o $@ $<,Compiling) + +libnet.a: $(LIBNETOBJS) + $(call quiet-command,$(AR) -rc $@ $^,Creating static library) + +# Main targets: =20 build-all: s390-ccw.img =20 diff --git a/pc-bios/s390-netboot.img b/pc-bios/s390-netboot.img deleted file mode 100644 index 6908e49f06801808b826d3a01f88132cf1b2f57c..000000000000000000000000000= 0000000000000 GIT binary patch literal 0 HcmV?d00001 literal 67232 zcmeEPdw5jUwO?m4Bm)LG36n4h7*3KAl7KMbB>^Aj1kePu4k~rk)u_{6tPchl z5VX}HidSn}M>KA=3D4+pfB zh$x?ky!(_Rw|wqX*(Kj+KgmZ#dHwY~GvxdIKWVtzZuS#!;a|4DL;QJD@ekH_`e{w?+@0+RdW zaRF{Fex4@T-u|Byl+SaY-bu>aIcqVJv2-`~D?W$`3ZBC^HoCn=3DMzy!@g` zS6(uG>cs1=3Do>2amrT~(m(D|5;vWB{deAbS>F-%zZIyS)BK7H73LjdgZao` z=3DOvFmy2zageqQj=3DpDvnwTgNB)Z@oKd`wVmHA8x$o_MuO0e*I3j{vrSJa&)^-k)dkt zd5)g(=3DPx2E#Fv7VH^1-J09}qQB07qnFVE4dMnpCJ<*#+=3Dm2sHd|2*tAm0qwlu zzR>8p=3Dp~n4d+p*&E{tACi?54bcx{xfyY#9{7GK_qS66>CDqmgRIvsDLm(t~}S6(D* z7sLi<*Q11cxm+&=3DF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FifM>F9 zl;8J$`se(<+r{Uqo_jMJRX7gH^d1oD?=3D9~h`SINCfRR>kfZnS9>G}6Qd{ptlpywir z-m^1`1;<4n)5{OHgUfXmBHc2Cai#C`AkCaMd2%nkL@>r$dFI9cE%2V>Z|v*q79BSZ z?p`A{c5dhligm$tYl9osUL`tq7%{OmVyf`Ky5Jh3&g^K`%$SiO>NJf*CUwSf`J1NB zWXd!;N0Q^6L*wy8ED(N}VGq zlR8z{P&P}Q(bO1tuu4Zhz=3DOH#z=3D7$DN1aX)kvg6t`f=3D6j&yPa_@HAHC*JDz{^N-4J zTCB2_AE!P%&6t`x#>u}`eLHVz)A7#Zc771il_}f)t^RiMYkKLt>BALT%1?FsuO=3D$f zFDJhy49*({ei=3D48zMLQUay=3D2%&aK~}*Ur04pPi?=3D|67R4{n6z+^x1hceOB@$>T%ld z;Hy&}=3Dl4uH (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1728350680205964.7433911666446; Mon, 7 Oct 2024 18:24:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxyq3-0004Ek-Mp; Mon, 07 Oct 2024 21:16:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypi-00045S-V4; Mon, 07 Oct 2024 21:16:15 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxype-0008HD-4a; Mon, 07 Oct 2024 21:16:14 -0400 Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4980o7ZY008625; Tue, 8 Oct 2024 01:16:09 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424thq02k0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:08 +0000 (GMT) Received: from m0356516.ppops.net (m0356516.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4981G866026875; Tue, 8 Oct 2024 01:16:08 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424thq02jv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:08 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 497MEwQE010727; Tue, 8 Oct 2024 01:16:07 GMT Received: from smtprelay04.wdc07v.mail.ibm.com ([172.16.1.71]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 423j0j9ba5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:07 +0000 Received: from smtpav06.dal12v.mail.ibm.com (smtpav06.dal12v.mail.ibm.com [10.241.53.105]) by smtprelay04.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4981G51N48038364 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Oct 2024 01:16:06 GMT Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9C9D258055; Tue, 8 Oct 2024 01:16:05 +0000 (GMT) Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 250A95805D; Tue, 8 Oct 2024 01:16:05 +0000 (GMT) Received: from localhost.localdomain (unknown [9.61.51.58]) by smtpav06.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 8 Oct 2024 01:16:05 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from :to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:mime-version; s=pp1; bh=3baPwsJ4d9/44 iWyLE2uKRwn3a4yRi/xHKhWUigxytk=; b=Rnr6vXLSNLgI2KWaLdoej6tHr6GwV ZwjuVndyZvZobRowEPZQSGJF/B30l40/VmfMLRbnIVhNUoP+/fIM/5vr9pT+y0TD lYsZoSaX5Dw78V4XzrDK8PrOYkIGUQsyKkf5qtgCpj4iB+EGwRNash5B+Ap87Hom MZ69yy5kIi/jTCHBkc4th65VG6UsIvUWkfiRgw9R+nBwgtkUwUbWBZaP4jTEfWnk 3mUx0pA0Vu8E57yS9idk0tPuMR7PsoRC7T4BKib1vvLFTOS4Vh9XZNMb4nny3kGN v3mzNLMXVYTYni03wj74hDg93WQkIDouIwhQNIlm02fNgqzgL1x+PoslA== From: jrossi@linux.ibm.com To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org, thuth@redhat.com Cc: frankja@linux.ibm.com, jrossi@linux.ibm.com Subject: [PATCH v3 06/19] docs/system/s390x/bootdevices: Update the documentation about network booting Date: Mon, 7 Oct 2024 21:15:39 -0400 Message-ID: <20241008011552.2645520-7-jrossi@linux.ibm.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241008011552.2645520-1-jrossi@linux.ibm.com> References: <20241008011552.2645520-1-jrossi@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: gvifKiS6IWwDdpVnhV4FqZqURrkHYdd8 X-Proofpoint-GUID: uh9FDgf2pI6dKlSjAXK2Nr_rrxfl6urq Content-Transfer-Encoding: quoted-printable X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-07_16,2024-10-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 phishscore=0 adultscore=0 malwarescore=0 priorityscore=1501 suspectscore=0 lowpriorityscore=0 mlxlogscore=923 bulkscore=0 clxscore=1015 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410080006 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=148.163.158.5; envelope-from=jrossi@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1728350680608116600 Content-Type: text/plain; charset="utf-8" From: Jared Rossi Remove the information about the separate s390-netboot.img from the documentation. Co-authored by: Thomas Huth Signed-off-by: Jared Rossi --- docs/system/s390x/bootdevices.rst | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/docs/system/s390x/bootdevices.rst b/docs/system/s390x/bootdevi= ces.rst index 1a7a18b43b..c97efb8fc0 100644 --- a/docs/system/s390x/bootdevices.rst +++ b/docs/system/s390x/bootdevices.rst @@ -82,23 +82,17 @@ Note that ``0`` can be used to boot the default entry. Booting from a network device ----------------------------- =20 -Beside the normal guest firmware (which is loaded from the file ``s390-ccw= .img`` -in the data directory of QEMU, or via the ``-bios`` option), QEMU ships wi= th -a small TFTP network bootloader firmware for virtio-net-ccw devices, too. = This -firmware is loaded from a file called ``s390-netboot.img`` in the QEMU data -directory. In case you want to load it from a different filename instead, -you can specify it via the ``-global s390-ipl.netboot_fw=3Dfilename`` -command line option. - -The ``bootindex`` property is especially important for booting via the net= work. -If you don't specify the ``bootindex`` property here, the network bootload= er -firmware code won't get loaded into the guest memory so that the network b= oot -will fail. For a successful network boot, try something like this:: +The firmware that ships with QEMU includes a small TFTP network bootloader +for virtio-net-ccw devices. The ``bootindex`` property is especially +important for booting via the network. If you don't specify the ``bootinde= x`` +property here, the network bootloader won't be taken into consideration and +the network boot will fail. For a successful network boot, try something +like this:: =20 qemu-system-s390x -netdev user,id=3Dn1,tftp=3D...,bootfile=3D... \ -device virtio-net-ccw,netdev=3Dn1,bootindex=3D1 =20 -The network bootloader firmware also has basic support for pxelinux.cfg-st= yle +The network bootloader also has basic support for pxelinux.cfg-style configuration files. See the `PXELINUX Configuration page `= __ for details how to set up the configuration file on your TFTP server. --=20 2.45.1 From nobody Sat Nov 23 21:59:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1728350312; cv=none; d=zohomail.com; s=zohoarc; b=oLvhM/tLe1/+8pqaMFqBi+tJSB6I1lE9KDT8mHD1UDtduwwAwhY0WqRz1gIH96lU6Ixna9GYkEIKVfyOM88uNReIFYaM7dlnRO0lg6nfs/fmpPAaXvc1mPsbUyllx7b1fNbI4i2CAEisDkZabE+u9tnlQl3DcDQkgEjRJXLVjGk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728350312; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=EMFlUjXFbClm+byH4iu81LclUpFGQnIekH0pDh+MOKo=; b=TnmCWRZKQgMExQ61mvbNX+eOypzzHQdn5pn0lW2HPYeISDKu9RfKTDWQIRCrtclQ67vRAASzYcBc8e+kbUwBHjN333PMZ7CfyOlnAh9lA2PrXjmgrPv1B2LMYDXt5DQzbeztuiixt/RemoOtO+RtRjsA8w8D5FLPubFDxuSQFE4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1728350312277792.5647434285041; Mon, 7 Oct 2024 18:18:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxypj-00045z-Vj; Mon, 07 Oct 2024 21:16:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxyph-00045H-Hv; Mon, 07 Oct 2024 21:16:13 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypf-0008HY-5f; Mon, 07 Oct 2024 21:16:12 -0400 Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 497Nt8Jr026653; Tue, 8 Oct 2024 01:16:10 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424sr4g7gy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:09 +0000 (GMT) Received: from m0360072.ppops.net (m0360072.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4981G8nD017417; Tue, 8 Oct 2024 01:16:09 GMT Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424sr4g7gu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:08 +0000 (GMT) Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 497Kicxn030253; Tue, 8 Oct 2024 01:16:08 GMT Received: from smtprelay05.wdc07v.mail.ibm.com ([172.16.1.72]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 423gsmhjj1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:08 +0000 Received: from smtpav06.dal12v.mail.ibm.com (smtpav06.dal12v.mail.ibm.com [10.241.53.105]) by smtprelay05.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4981G7MH2818594 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Oct 2024 01:16:07 GMT Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D81C258055; Tue, 8 Oct 2024 01:16:06 +0000 (GMT) Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 63CDC58043; Tue, 8 Oct 2024 01:16:06 +0000 (GMT) Received: from localhost.localdomain (unknown [9.61.51.58]) by smtpav06.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 8 Oct 2024 01:16:06 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=pp1; bh=EMFlUjXFbClm+ byH4iu81LclUpFGQnIekH0pDh+MOKo=; b=trka2cqO46iZNNtsDmZ5DgYZRQma9 XaP+ERCHRxOHTfBOi5bqdv/rRNzC2jBR96WiygJXMiBaSG7LasVTF6rFevXd2Zme +Qoq7VpQtf7847aHU5dZD6szOQbMaONONq0zSY4R+kbGNbNpksVHwlVmm9HtyAlN EStCPOyotgKTtrZkfb011LZJcWmcHREA94MUQAthMZXHGGvAQBVXhT77B8oYipXY AIJjBtMqizRwx9vP1ISVlVOQU0CSlLOt9HnSprMkGDb5KYo9brXBz1D59SIWipVd qB8T68a3JUYzZrjAxz9osQ58EalJR8nRw4bUDRt8UffXs7U1n0pjK8ZwQ== From: jrossi@linux.ibm.com To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org, thuth@redhat.com Cc: frankja@linux.ibm.com, jrossi@linux.ibm.com Subject: [PATCH v3 07/19] pc-bios/s390-ccw: Remove panics from ISO IPL path Date: Mon, 7 Oct 2024 21:15:40 -0400 Message-ID: <20241008011552.2645520-8-jrossi@linux.ibm.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241008011552.2645520-1-jrossi@linux.ibm.com> References: <20241008011552.2645520-1-jrossi@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: vZBnXx5xjy6E4L-dPcuZdnXKNMHL6_om X-Proofpoint-GUID: 64DOKli3yBS7e3vuRftSlJATWx37MMYm X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-07_16,2024-10-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 bulkscore=0 clxscore=1015 spamscore=0 mlxscore=0 lowpriorityscore=0 phishscore=0 malwarescore=0 suspectscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410080003 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=148.163.158.5; envelope-from=jrossi@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1728350314461116600 Content-Type: text/plain; charset="utf-8" From: Jared Rossi Remove panic-on-error from IPL ISO El Torito specific functions so that err= or recovery may be possible in the future. Functions that would previously panic now provide a return code. Signed-off-by: Jared Rossi --- pc-bios/s390-ccw/bootmap.h | 15 +++---- pc-bios/s390-ccw/s390-ccw.h | 1 + pc-bios/s390-ccw/bootmap.c | 78 ++++++++++++++++++++++++------------- 3 files changed, 59 insertions(+), 35 deletions(-) diff --git a/pc-bios/s390-ccw/bootmap.h b/pc-bios/s390-ccw/bootmap.h index bbe2c132aa..d639258eca 100644 --- a/pc-bios/s390-ccw/bootmap.h +++ b/pc-bios/s390-ccw/bootmap.h @@ -385,17 +385,14 @@ static inline uint32_t iso_733_to_u32(uint64_t x) =20 #define ISO_PRIMARY_VD_SECTOR 16 =20 -static inline void read_iso_sector(uint32_t block_offset, void *buf, - const char *errmsg) -{ - IPL_assert(virtio_read_many(block_offset, buf, 1) =3D=3D 0, errmsg); -} - -static inline void read_iso_boot_image(uint32_t block_offset, void *load_a= ddr, +static inline int read_iso_boot_image(uint32_t block_offset, void *load_ad= dr, uint32_t blks_to_load) { - IPL_assert(virtio_read_many(block_offset, load_addr, blks_to_load) =3D= =3D 0, - "Failed to read boot image!"); + if (virtio_read_many(block_offset, load_addr, blks_to_load)) { + puts("Failed to read boot image!"); + return 1; + } + return 0; } =20 #define ISO9660_MAX_DIR_DEPTH 8 diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h index 0ed7eb8ade..cbd92f3671 100644 --- a/pc-bios/s390-ccw/s390-ccw.h +++ b/pc-bios/s390-ccw/s390-ccw.h @@ -30,6 +30,7 @@ typedef unsigned long long u64; #define EIO 1 #define EBUSY 2 #define ENODEV 3 +#define EINVAL 4 =20 #ifndef MIN #define MIN(a, b) (((a) < (b)) ? (a) : (b)) diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c index 414c3f1b47..7984de62fe 100644 --- a/pc-bios/s390-ccw/bootmap.c +++ b/pc-bios/s390-ccw/bootmap.c @@ -678,8 +678,10 @@ static bool is_iso_bc_entry_compatible(IsoBcSection *s) if (s->unused || !s->sector_count) { return false; } - read_iso_sector(bswap32(s->load_rba), magic_sec, - "Failed to read image sector 0"); + if (virtio_read(bswap32(s->load_rba), magic_sec)) { + puts("Failed to read image sector 0"); + return false; + } =20 /* Checking bytes 8 - 32 for S390 Linux magic */ return !memcmp(magic_sec + 8, linux_s390_magic, 24); @@ -699,21 +701,28 @@ static inline uint32_t iso_get_file_size(uint32_t loa= d_rba) uint8_t *temp =3D sec + ISO_SECTOR_SIZE; int level =3D 0; =20 - read_iso_sector(ISO_PRIMARY_VD_SECTOR, sec, - "Failed to read ISO primary descriptor"); + if (virtio_read(ISO_PRIMARY_VD_SECTOR, sec)) { + puts("Failed to read ISO primary descriptor"); + return -EIO; + } + sec_loc[0] =3D iso_733_to_u32(cur_record->ext_loc); dir_rem[0] =3D 0; sec_offset[0] =3D 0; =20 while (level >=3D 0) { - IPL_assert(sec_offset[level] <=3D ISO_SECTOR_SIZE, - "Directory tree structure violation"); + if (sec_offset[level] > ISO_SECTOR_SIZE) { + puts("Directory tree structure violation"); + return -EIO; + } =20 cur_record =3D (IsoDirHdr *)(temp + sec_offset[level]); =20 if (sec_offset[level] =3D=3D 0) { - read_iso_sector(sec_loc[level], temp, - "Failed to read ISO directory"); + if (virtio_read(sec_loc[level], temp)) { + puts("Failed to read ISO directory"); + return -EIO; + } if (dir_rem[level] =3D=3D 0) { /* Skip self and parent records */ dir_rem[level] =3D iso_733_to_u32(cur_record->data_len) - @@ -758,8 +767,10 @@ static inline uint32_t iso_get_file_size(uint32_t load= _rba) if (dir_rem[level] =3D=3D 0) { /* Nothing remaining */ level--; - read_iso_sector(sec_loc[level], temp, - "Failed to read ISO directory"); + if (virtio_read(sec_loc[level], temp)) { + puts("Failed to read ISO directory"); + return -EIO; + } } } =20 @@ -784,9 +795,11 @@ static void load_iso_bc_entry(IsoBcSection *load) puts("ISO boot image size could not be verified"); } =20 - read_iso_boot_image(bswap32(s.load_rba), + if (read_iso_boot_image(bswap32(s.load_rba), (void *)((uint64_t)bswap16(s.load_segment)), - blks_to_load); + blks_to_load)) { + return; + } =20 jump_to_low_kernel(); } @@ -809,17 +822,18 @@ static uint32_t find_iso_bc(void) return bswap32(et->bc_offset); } } - read_iso_sector(block_num++, sec, - "Failed to read ISO volume descriptor"); + if (virtio_read(block_num++, sec)) { + puts("Failed to read ISO volume descriptor"); + return 0; + } } =20 return 0; } =20 -static IsoBcSection *find_iso_bc_entry(void) +static IsoBcSection *find_iso_bc_entry(uint32_t offset) { IsoBcEntry *e =3D (IsoBcEntry *)sec; - uint32_t offset =3D find_iso_bc(); int i; unsigned int loadparm =3D get_loadparm_index(); =20 @@ -827,11 +841,13 @@ static IsoBcSection *find_iso_bc_entry(void) return NULL; } =20 - read_iso_sector(offset, sec, "Failed to read El Torito boot catalog"); + if (virtio_read(offset, sec)) { + puts("Failed to read El Torito boot catalog"); + return NULL; + } =20 if (!is_iso_bc_valid(e)) { /* The validation entry is mandatory */ - panic("No valid boot catalog found!\n"); return NULL; } =20 @@ -851,19 +867,25 @@ static IsoBcSection *find_iso_bc_entry(void) } } =20 - panic("No suitable boot entry found on ISO-9660 media!\n"); - return NULL; } =20 -static void ipl_iso_el_torito(void) +static int ipl_iso_el_torito(void) { - IsoBcSection *s =3D find_iso_bc_entry(); + uint32_t offset =3D find_iso_bc(); + if (!offset) { + return 0; + } + + IsoBcSection *s =3D find_iso_bc_entry(offset); =20 if (s) { - load_iso_bc_entry(s); - /* no return */ + load_iso_bc_entry(s); /* only return in error */ + return 1; } + + puts("No suitable boot entry found on ISO-9660 media!"); + return -EIO; } =20 /** @@ -893,7 +915,9 @@ static void zipl_load_vblk(void) if (blksize !=3D VIRTIO_ISO_BLOCK_SIZE) { virtio_assume_iso9660(); } - ipl_iso_el_torito(); + if (ipl_iso_el_torito()) { + return; + } } =20 if (blksize !=3D VIRTIO_DASD_DEFAULT_BLOCK_SIZE) { @@ -907,7 +931,9 @@ static void zipl_load_vscsi(void) { if (virtio_get_block_size() =3D=3D VIRTIO_ISO_BLOCK_SIZE) { /* Is it an ISO image in non-CD drive? */ - ipl_iso_el_torito(); + if (ipl_iso_el_torito()) { + return; + } } =20 puts("Using guessed DASD geometry."); --=20 2.45.1 From nobody Sat Nov 23 21:59:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1728350336; cv=none; d=zohomail.com; s=zohoarc; b=OyKMkjrXdqosHPs/arZBB3yiX1qRHiA6UdKoC66yRavLrl7jKcSbLGuJ9Xxu/oFGjD6awvZXWRn2S3sM673Ku+M1KaXLa6iSRL/xfnPE+wAxPPeZfvfFjfFJ/YvLQfxKmvibghTSLha+rl2pRlIAUTMtCByoUItpc1KjrshWeSo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728350336; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=t6z5uXzymn4brorRXCN/qJXIMEP0rIygIs2yjOMQa64=; b=EG4MveZGyVkM+R3NZpbCzNG+GIVdKBkgiawwX8bZSajZJFrR/oS+Bw+A1kAfe3AeZOQuqnJsgOjV6HHbupk/9kxOrRc8fqe8ohWGXeT+zPxUx9VBNFqDMsQSjhEXSoXleQYyqNw32+4jEsvrN2E+xcDUmSqQ7Ycz/Nrm1QRrt9g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1728350336944574.2777583629651; Mon, 7 Oct 2024 18:18:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxyq2-0004DT-Qy; Mon, 07 Oct 2024 21:16:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypj-00045s-Mc; Mon, 07 Oct 2024 21:16:15 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxyph-0008IQ-8h; Mon, 07 Oct 2024 21:16:15 -0400 Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4980OvVu002125; Tue, 8 Oct 2024 01:16:11 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424t5tg5dg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:11 +0000 (GMT) Received: from m0360083.ppops.net (m0360083.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4981GAEh000844; Tue, 8 Oct 2024 01:16:10 GMT Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424t5tg5dd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:10 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 497LgUXT022856; Tue, 8 Oct 2024 01:16:09 GMT Received: from smtprelay07.wdc07v.mail.ibm.com ([172.16.1.74]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 423h9jsfjc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:09 +0000 Received: from smtpav06.dal12v.mail.ibm.com (smtpav06.dal12v.mail.ibm.com [10.241.53.105]) by smtprelay07.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4981G83c23528078 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Oct 2024 01:16:08 GMT Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2A41258059; Tue, 8 Oct 2024 01:16:08 +0000 (GMT) Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9D1D458043; Tue, 8 Oct 2024 01:16:07 +0000 (GMT) Received: from localhost.localdomain (unknown [9.61.51.58]) by smtpav06.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 8 Oct 2024 01:16:07 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=pp1; bh=t6z5uXzymn4br orRXCN/qJXIMEP0rIygIs2yjOMQa64=; b=R1xFCRF51eLa3tli4cONF/mP0OFYa 1QiluNQGszslKw6H9KaUtNZxvHYkuNBoG/wh438VklVR97ESYaXk3TOjzEzVmiJq uaGs7ePme5g3fPvQrnWzSvcYSH6IO2278vZq4YGRgfeJwawMRADpL120elNNiXiv 7do8A0FL6phEmaiJmgSgXQnYnGHH0/B9YjWst84fdcdFgK9Na5GxEi9fC74DfGJX Mh79AY4LeQGjDtKTnpLUyLjsa3XVh4Htk9BRd4PvJhYW7cKD8SuFxm5/T1dMcjVN wbP6qoe8qeQHT3hetJ6JLNtOnRcbBm4TG7tchH7C/g/nkpdZbgHxhzHfA== From: jrossi@linux.ibm.com To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org, thuth@redhat.com Cc: frankja@linux.ibm.com, jrossi@linux.ibm.com Subject: [PATCH v3 08/19] pc-bios/s390-ccw: Remove panics from ECKD IPL path Date: Mon, 7 Oct 2024 21:15:41 -0400 Message-ID: <20241008011552.2645520-9-jrossi@linux.ibm.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241008011552.2645520-1-jrossi@linux.ibm.com> References: <20241008011552.2645520-1-jrossi@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: d2phorUS-YxWaOUtP54ClrR0R2wpiu_p X-Proofpoint-GUID: hvLRgaC9F-viwBQzSpfoheQMwXHWdIsW X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-07_16,2024-10-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 mlxscore=0 lowpriorityscore=0 clxscore=1015 mlxlogscore=999 adultscore=0 spamscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410080006 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=148.163.156.1; envelope-from=jrossi@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1728350338592116600 Content-Type: text/plain; charset="utf-8" From: Jared Rossi Remove panic-on-error from ECKD block device IPL specific functions so that error recovery may be possible in the future. Functions that would previously panic now provide a return code. Signed-off-by: Jared Rossi --- pc-bios/s390-ccw/s390-ccw.h | 1 + pc-bios/s390-ccw/bootmap.c | 183 ++++++++++++++++++++++++------------ 2 files changed, 126 insertions(+), 58 deletions(-) diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h index cbd92f3671..7516e96a14 100644 --- a/pc-bios/s390-ccw/s390-ccw.h +++ b/pc-bios/s390-ccw/s390-ccw.h @@ -31,6 +31,7 @@ typedef unsigned long long u64; #define EBUSY 2 #define ENODEV 3 #define EINVAL 4 +#define ENOENT 5 =20 #ifndef MIN #define MIN(a, b) (((a) < (b)) ? (a) : (b)) diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c index 7984de62fe..266b38c034 100644 --- a/pc-bios/s390-ccw/bootmap.c +++ b/pc-bios/s390-ccw/bootmap.c @@ -145,14 +145,17 @@ static block_number_t load_eckd_segments(block_number= _t blk, bool ldipl, bool more_data; =20 memset(_bprs, FREE_SPACE_FILLER, sizeof(_bprs)); - read_block(blk, bprs, "BPRS read failed"); + if (virtio_read(blk, bprs)) { + puts("BPRS read failed"); + return -EIO; + } =20 do { more_data =3D false; for (j =3D 0;; j++) { block_nr =3D gen_eckd_block_num(&bprs[j].xeckd, ldipl); if (is_null_block_number(block_nr)) { /* end of chunk */ - break; + return -ENOENT; } =20 /* we need the updated blockno for the next indirect entry @@ -163,15 +166,20 @@ static block_number_t load_eckd_segments(block_number= _t blk, bool ldipl, } =20 /* List directed pointer does not store block size */ - IPL_assert(ldipl || block_size_ok(bprs[j].xeckd.bptr.size), - "bad chunk block size"); + if (!ldipl && !block_size_ok(bprs[j].xeckd.bptr.size)) { + puts("Bad chunk block size"); + return -EIO; + } =20 if (!eckd_valid_address(&bprs[j].xeckd, ldipl)) { /* * If an invalid address is found during LD-IPL then break= and - * retry as CCW + * retry as CCW-IPL, otherwise abort on error */ - IPL_assert(ldipl, "bad chunk ECKD addr"); + if (!ldipl) { + puts("Bad chunk ECKD address"); + return -EIO; + } break; } =20 @@ -189,7 +197,10 @@ static block_number_t load_eckd_segments(block_number_= t blk, bool ldipl, * I.e. the next ptr must point to the unused memory area */ memset(_bprs, FREE_SPACE_FILLER, sizeof(_bprs)); - read_block(block_nr, bprs, "BPRS continuation read failed"= ); + if (virtio_read(block_nr, bprs)) { + puts("BPRS continuation read failed"); + return -EIO; + } more_data =3D true; break; } @@ -198,7 +209,10 @@ static block_number_t load_eckd_segments(block_number_= t blk, bool ldipl, * to memory (address). */ rc =3D virtio_read_many(block_nr, (void *)(*address), count + = 1); - IPL_assert(rc =3D=3D 0, "code chunk read failed"); + if (rc !=3D 0) { + puts("Code chunk read failed"); + return -EIO; + } =20 *address +=3D (count + 1) * virtio_get_block_size(); } @@ -232,7 +246,10 @@ static int eckd_get_boot_menu_index(block_number_t s1b= _block_nr) =20 /* Get Stage1b data */ memset(sec, FREE_SPACE_FILLER, sizeof(sec)); - read_block(s1b_block_nr, s1b, "Cannot read stage1b boot loader"); + if (virtio_read(s1b_block_nr, s1b)) { + puts("Cannot read stage1b boot loader"); + return -EIO; + } =20 memset(_s2, FREE_SPACE_FILLER, sizeof(_s2)); =20 @@ -244,7 +261,10 @@ static int eckd_get_boot_menu_index(block_number_t s1b= _block_nr) break; } =20 - read_block(cur_block_nr, s2_cur_blk, "Cannot read stage2 boot load= er"); + if (virtio_read(cur_block_nr, s2_cur_blk)) { + puts("Cannot read stage2 boot loader"); + return -EIO; + } =20 if (find_zipl_boot_menu_banner(&banner_offset)) { /* @@ -252,8 +272,10 @@ static int eckd_get_boot_menu_index(block_number_t s1b= _block_nr) * possibility of menu data spanning multiple blocks. */ if (prev_block_nr) { - read_block(prev_block_nr, s2_prev_blk, - "Cannot read stage2 boot loader"); + if (virtio_read(prev_block_nr, s2_prev_blk)) { + puts("Cannot read stage2 boot loader"); + return -EIO; + } } =20 if (i + 1 < STAGE2_BLK_CNT_MAX) { @@ -261,8 +283,10 @@ static int eckd_get_boot_menu_index(block_number_t s1b= _block_nr) } =20 if (next_block_nr && !is_null_block_number(next_block_nr)) { - read_block(next_block_nr, s2_next_blk, - "Cannot read stage2 boot loader"); + if (virtio_read(next_block_nr, s2_next_blk)) { + puts("Cannot read stage2 boot loader"); + return -EIO; + } } =20 return menu_get_zipl_boot_index(s2_cur_blk + banner_offset); @@ -275,7 +299,7 @@ static int eckd_get_boot_menu_index(block_number_t s1b_= block_nr) return 0; } =20 -static void run_eckd_boot_script(block_number_t bmt_block_nr, +static int run_eckd_boot_script(block_number_t bmt_block_nr, block_number_t s1b_block_nr) { int i; @@ -292,17 +316,28 @@ static void run_eckd_boot_script(block_number_t bmt_b= lock_nr, } =20 debug_print_int("loadparm", loadparm); - IPL_assert(loadparm < MAX_BOOT_ENTRIES, "loadparm value greater than" - " maximum number of boot entries allowed"); + if (loadparm >=3D MAX_BOOT_ENTRIES) { + puts("loadparm value greater than max number of boot entries allow= ed"); + return -EINVAL; + } =20 memset(sec, FREE_SPACE_FILLER, sizeof(sec)); - read_block(bmt_block_nr, sec, "Cannot read Boot Map Table"); + if (virtio_read(bmt_block_nr, sec)) { + puts("Cannot read Boot Map Table"); + return -EIO; + } =20 block_nr =3D gen_eckd_block_num(&bmt->entry[loadparm].xeckd, ldipl); - IPL_assert(block_nr !=3D -1, "Cannot find Boot Map Table Entry"); + if (block_nr =3D=3D NULL_BLOCK_NR) { + puts("Cannot find Boot Map Table Entry"); + return -EIO; + } =20 memset(sec, FREE_SPACE_FILLER, sizeof(sec)); - read_block(block_nr, sec, "Cannot read Boot Map Script"); + if (virtio_read(block_nr, sec)) { + puts("Cannot read Boot Map Script"); + return -EIO; + } =20 for (i =3D 0; bms->entry[i].type =3D=3D BOOT_SCRIPT_LOAD || bms->entry[i].type =3D=3D BOOT_SCRIPT_SIGNATURE; i++) { @@ -317,21 +352,28 @@ static void run_eckd_boot_script(block_number_t bmt_b= lock_nr, =20 do { block_nr =3D load_eckd_segments(block_nr, ldipl, &address); - } while (block_nr !=3D -1); + } while (block_nr >=3D 0); + + if (block_nr !=3D -ENOENT && block_nr < 0) { + return ldipl ? 0 : -EIO; + } } =20 if (ldipl && bms->entry[i].type !=3D BOOT_SCRIPT_EXEC) { /* Abort LD-IPL and retry as CCW-IPL */ - return; + return 0; } =20 - IPL_assert(bms->entry[i].type =3D=3D BOOT_SCRIPT_EXEC, - "Unknown script entry type"); + if (bms->entry[i].type !=3D BOOT_SCRIPT_EXEC) { + puts("Unknown script entry type"); + return -EINVAL; + } write_reset_psw(bms->entry[i].address.load_address); /* no return */ jump_to_IPL_code(0); /* no return */ + return 1; } =20 -static void ipl_eckd_cdl(void) +static int ipl_eckd_cdl(void) { XEckdMbr *mbr; EckdCdlIpl2 *ipl2 =3D (void *)sec; @@ -342,20 +384,23 @@ static void ipl_eckd_cdl(void) puts("CDL"); =20 memset(sec, FREE_SPACE_FILLER, sizeof(sec)); - read_block(1, ipl2, "Cannot read IPL2 record at block 1"); + if (virtio_read(1, ipl2)) { + puts("Cannot read IPL2 record at block 1"); + return -EIO; + } =20 mbr =3D &ipl2->mbr; if (!magic_match(mbr, ZIPL_MAGIC)) { puts("No zIPL section in IPL2 record."); - return; + return 0; } if (!block_size_ok(mbr->blockptr.xeckd.bptr.size)) { puts("Bad block size in zIPL section of IPL2 record."); - return; + return 0; } if (mbr->dev_type !=3D DEV_TYPE_ECKD) { puts("Non-ECKD device type in zIPL section of IPL2 record."); - return; + return 0; } =20 /* save pointer to Boot Map Table */ @@ -365,19 +410,21 @@ static void ipl_eckd_cdl(void) s1b_block_nr =3D eckd_block_num(&ipl2->stage1.seek[0].chs); =20 memset(sec, FREE_SPACE_FILLER, sizeof(sec)); - read_block(2, vlbl, "Cannot read Volume Label at block 2"); + if (virtio_read(2, vlbl)) { + puts("Cannot read Volume Label at block 2"); + return -EIO; + } if (!magic_match(vlbl->key, VOL1_MAGIC)) { puts("Invalid magic of volume label block."); - return; + return 0; } if (!magic_match(vlbl->f.key, VOL1_MAGIC)) { puts("Invalid magic of volser block."); - return; + return 0; } print_volser(vlbl->f.volser); =20 - run_eckd_boot_script(bmt_block_nr, s1b_block_nr); - /* no return */ + return run_eckd_boot_script(bmt_block_nr, s1b_block_nr); } =20 static void print_eckd_ldl_msg(ECKD_IPL_mode_t mode) @@ -403,7 +450,7 @@ static void print_eckd_ldl_msg(ECKD_IPL_mode_t mode) print_volser(vlbl->volser); } =20 -static void ipl_eckd_ldl(ECKD_IPL_mode_t mode) +static int ipl_eckd_ldl(ECKD_IPL_mode_t mode) { block_number_t bmt_block_nr, s1b_block_nr; EckdLdlIpl1 *ipl1 =3D (void *)sec; @@ -415,10 +462,13 @@ static void ipl_eckd_ldl(ECKD_IPL_mode_t mode) /* DO NOT read BootMap pointer (only one, xECKD) at block #2 */ =20 memset(sec, FREE_SPACE_FILLER, sizeof(sec)); - read_block(0, sec, "Cannot read block 0 to grab boot info."); + if (virtio_read(0, sec)) { + puts("Cannot read block 0 to grab boot info."); + return -EIO; + } if (mode =3D=3D ECKD_LDL_UNLABELED) { if (!magic_match(ipl1->bip.magic, ZIPL_MAGIC)) { - return; /* not applicable layout */ + return 0; /* not applicable layout */ } puts("unlabeled LDL."); } @@ -430,8 +480,7 @@ static void ipl_eckd_ldl(ECKD_IPL_mode_t mode) /* save pointer to Stage1b Data */ s1b_block_nr =3D eckd_block_num(&ipl1->stage1.seek[0].chs); =20 - run_eckd_boot_script(bmt_block_nr, s1b_block_nr); - /* no return */ + return run_eckd_boot_script(bmt_block_nr, s1b_block_nr); } =20 static block_number_t eckd_find_bmt(ExtEckdBlockPtr *ptr) @@ -441,11 +490,14 @@ static block_number_t eckd_find_bmt(ExtEckdBlockPtr *= ptr) BootRecord *br; =20 blockno =3D gen_eckd_block_num(ptr, 0); - read_block(blockno, tmp_sec, "Cannot read boot record"); + if (virtio_read(blockno, tmp_sec)) { + puts("Cannot read boot record"); + return -EIO; + } br =3D (BootRecord *)tmp_sec; if (!magic_match(br->magic, ZIPL_MAGIC)) { /* If the boot record is invalid, return and try CCW-IPL instead */ - return NULL_BLOCK_NR; + return 0; } =20 return gen_eckd_block_num(&br->pgt.xeckd, 1); @@ -470,7 +522,7 @@ static void print_eckd_msg(void) printf("%s", msg); } =20 -static void ipl_eckd(void) +static int ipl_eckd(void) { IplVolumeLabel *vlbl =3D (void *)sec; LDL_VTOC *vtoc =3D (void *)sec; @@ -480,7 +532,10 @@ static void ipl_eckd(void) =20 /* Block 2 can contain either the CDL VOL1 label or the LDL VTOC */ memset(sec, FREE_SPACE_FILLER, sizeof(sec)); - read_block(2, vlbl, "Cannot read block 2"); + if (virtio_read(2, vlbl)) { + puts("Cannot read block 2"); + return -EIO; + } =20 /* * First check for a list-directed-format pointer which would @@ -490,34 +545,46 @@ static void ipl_eckd(void) ldipl_bmt =3D eckd_find_bmt((ExtEckdBlockPtr *)&vlbl->f.br); if (ldipl_bmt) { puts("List-Directed"); - /* LD-IPL does not use the S1B bock, just make it NULL */ - run_eckd_boot_script(ldipl_bmt, NULL_BLOCK_NR); - /* Only return in error, retry as CCW-IPL */ + /* + * LD-IPL does not use the S1B bock, just make it NULL_BLOCK_N= R. + * In some failure cases retry IPL before aborting. + */ + if (run_eckd_boot_script(ldipl_bmt, NULL_BLOCK_NR)) { + return -EIO; + } + /* Non-fatal error, retry as CCW-IPL */ printf("Retrying IPL "); print_eckd_msg(); } memset(sec, FREE_SPACE_FILLER, sizeof(sec)); - read_block(2, vtoc, "Cannot read block 2"); + if (virtio_read(2, vtoc)) { + puts("Cannot read block 2"); + return -EIO; + } } =20 /* Not list-directed */ if (magic_match(vtoc->magic, VOL1_MAGIC)) { - ipl_eckd_cdl(); /* may return in error */ + if (ipl_eckd_cdl()) { + return 1; + } } =20 if (magic_match(vtoc->magic, CMS1_MAGIC)) { - ipl_eckd_ldl(ECKD_CMS); /* no return */ + return ipl_eckd_ldl(ECKD_CMS); } if (magic_match(vtoc->magic, LNX1_MAGIC)) { - ipl_eckd_ldl(ECKD_LDL); /* no return */ + return ipl_eckd_ldl(ECKD_LDL); } =20 - ipl_eckd_ldl(ECKD_LDL_UNLABELED); /* it still may return */ + if (ipl_eckd_ldl(ECKD_LDL_UNLABELED)) { + return 1; + } /* * Ok, it is not a LDL by any means. * It still might be a CDL with zero record keys for IPL1 and IPL2 */ - ipl_eckd_cdl(); + return ipl_eckd_cdl(); } =20 /*********************************************************************** @@ -907,7 +974,7 @@ static bool has_iso_signature(void) * Bus specific IPL sequences */ =20 -static void zipl_load_vblk(void) +static int zipl_load_vblk(void) { int blksize =3D virtio_get_block_size(); =20 @@ -916,7 +983,7 @@ static void zipl_load_vblk(void) virtio_assume_iso9660(); } if (ipl_iso_el_torito()) { - return; + return 0; } } =20 @@ -924,21 +991,21 @@ static void zipl_load_vblk(void) puts("Using guessed DASD geometry."); virtio_assume_eckd(); } - ipl_eckd(); + return ipl_eckd(); } =20 -static void zipl_load_vscsi(void) +static int zipl_load_vscsi(void) { if (virtio_get_block_size() =3D=3D VIRTIO_ISO_BLOCK_SIZE) { /* Is it an ISO image in non-CD drive? */ if (ipl_iso_el_torito()) { - return; + return 0; } } =20 puts("Using guessed DASD geometry."); virtio_assume_eckd(); - ipl_eckd(); + return ipl_eckd(); } =20 /*********************************************************************** --=20 2.45.1 From nobody Sat Nov 23 21:59:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1728350220; cv=none; d=zohomail.com; s=zohoarc; b=SFskVBNMEv4nURgc2xxl4hVjzoNd71phGDW1B9MIMtgJriBuZcMKvkAQu4Aupj9KAfOsTJ2zoeBN2O8Qlq09oJ7U30+txNXDi2FOz7mEvnuQu49yLvD0TR33sYqAFpkS78vrxE/v0OITcQfM8TYAWajiUnfqozhGBiTypEZ4E7o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728350220; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=H4vxHDbCL8uUYyzg5wzTi+DxZD9HqPpMlYlSNGuAaWs=; b=b2Wp1XdL5KiHryUP4e20SD24klBSza13HCYqxVzgV/Sez/tg3AqiPK23FbRlseINLe2U0xGxvSqNuBKHrK2aSAM5o9QbYAIX7mJIFIm6PtyY8Au8N9IH+GVspY2kZ03BzHwaWytrVPeJ21JlxyahcIET5QB0ZM5hanWDw8BahIg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1728350220289341.3622373383173; Mon, 7 Oct 2024 18:17:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxypo-00048I-02; Mon, 07 Oct 2024 21:16:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypj-00045n-J9; Mon, 07 Oct 2024 21:16:15 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypg-0008IP-Rj; Mon, 07 Oct 2024 21:16:15 -0400 Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4980nwv8008385; Tue, 8 Oct 2024 01:16:11 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424thq02k7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:11 +0000 (GMT) Received: from m0356516.ppops.net (m0356516.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4981GBQX026895; Tue, 8 Oct 2024 01:16:11 GMT Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424thq02k4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:11 +0000 (GMT) Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 4980smWH013807; Tue, 8 Oct 2024 01:16:10 GMT Received: from smtprelay03.dal12v.mail.ibm.com ([172.16.1.5]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 423fss1r3n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:10 +0000 Received: from smtpav06.dal12v.mail.ibm.com (smtpav06.dal12v.mail.ibm.com [10.241.53.105]) by smtprelay03.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4981G9N246793028 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Oct 2024 01:16:09 GMT Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 67FCA58059; Tue, 8 Oct 2024 01:16:09 +0000 (GMT) Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DC64158043; Tue, 8 Oct 2024 01:16:08 +0000 (GMT) Received: from localhost.localdomain (unknown [9.61.51.58]) by smtpav06.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 8 Oct 2024 01:16:08 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=pp1; bh=H4vxHDbCL8uUY yzg5wzTi+DxZD9HqPpMlYlSNGuAaWs=; b=JmNI23oo2sn0y2gent9DOXri61pCF Z9my2VQSMu2HjVd/2sAPtorgCkW0wjErgVCjyz7Shtvi9raSTPHfMdwPuma3g5ss HhfEKivN1TKySlGLra+wxVr3YkP/PE2R64Qy/3NrhhfUn54RnOSfEmz5E3BNk2D4 xELsnsGrYD3GfaxmLsdOqO0aQIcU4AbfxS7u/lZwHDtxGiIUZbNRO0UoBg3qphoj +twJ8rNPj1mpONML+hB9R+yvzCnC2TsZ1h2XjXorYn+bweGiyoBNUA/fScQYFJiF ipZcCoiaM8VP5P7JPygRjTJ4Vg30c68J+5DOBC3j7jdBa+uFLmjPYZUVw== From: jrossi@linux.ibm.com To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org, thuth@redhat.com Cc: frankja@linux.ibm.com, jrossi@linux.ibm.com Subject: [PATCH v3 09/19] pc-bios/s390-ccw: Remove panics from SCSI IPL path Date: Mon, 7 Oct 2024 21:15:42 -0400 Message-ID: <20241008011552.2645520-10-jrossi@linux.ibm.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241008011552.2645520-1-jrossi@linux.ibm.com> References: <20241008011552.2645520-1-jrossi@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: sTKXF9Db4GPhgG7zpi-MDumI4CaPzxQz X-Proofpoint-GUID: EvsN-zoFTvx5QA2S2QwIRY9pNgwGdG7n X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-07_16,2024-10-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 phishscore=0 adultscore=0 malwarescore=0 priorityscore=1501 suspectscore=0 lowpriorityscore=0 mlxlogscore=999 bulkscore=0 clxscore=1015 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410080006 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=148.163.158.5; envelope-from=jrossi@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1728350222436116600 Content-Type: text/plain; charset="utf-8" From: Jared Rossi Remove panic-on-error from virtio-scsi IPL specific functions so that error recovery may be possible in the future. Functions that would previously panic now provide a return code. Signed-off-by: Jared Rossi --- pc-bios/s390-ccw/bootmap.c | 88 +++++++++++++----- pc-bios/s390-ccw/jump2ipl.c | 1 + pc-bios/s390-ccw/virtio-blkdev.c | 4 +- pc-bios/s390-ccw/virtio-scsi.c | 148 +++++++++++++++++++++---------- 4 files changed, 169 insertions(+), 72 deletions(-) diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c index 266b38c034..534d900f9e 100644 --- a/pc-bios/s390-ccw/bootmap.c +++ b/pc-bios/s390-ccw/bootmap.c @@ -591,7 +591,7 @@ static int ipl_eckd(void) * IPL a SCSI disk */ =20 -static void zipl_load_segment(ComponentEntry *entry) +static int zipl_load_segment(ComponentEntry *entry) { const int max_entries =3D (MAX_SECTOR_SIZE / sizeof(ScsiBlockPtr)); ScsiBlockPtr *bprs =3D (void *)sec; @@ -611,7 +611,10 @@ static void zipl_load_segment(ComponentEntry *entry) do { memset(bprs, FREE_SPACE_FILLER, bprs_size); fill_hex_val(blk_no, &blockno, sizeof(blockno)); - read_block(blockno, bprs, err_msg); + if (virtio_read(blockno, bprs)) { + puts(err_msg); + return -EIO; + } =20 for (i =3D 0;; i++) { uint64_t *cur_desc =3D (void *)&bprs[i]; @@ -639,23 +642,37 @@ static void zipl_load_segment(ComponentEntry *entry) } address =3D virtio_load_direct(cur_desc[0], cur_desc[1], 0, (void *)address); - IPL_assert(address !=3D -1, "zIPL load segment failed"); + if (!address) { + puts("zIPL load segment failed"); + return -EIO; + } } } while (blockno); + + return 0; } =20 /* Run a zipl program */ -static void zipl_run(ScsiBlockPtr *pte) +static int zipl_run(ScsiBlockPtr *pte) { ComponentHeader *header; ComponentEntry *entry; uint8_t tmp_sec[MAX_SECTOR_SIZE]; =20 - read_block(pte->blockno, tmp_sec, "Cannot read header"); + if (virtio_read(pte->blockno, tmp_sec)) { + puts("Cannot read header"); + return -EIO; + } header =3D (ComponentHeader *)tmp_sec; =20 - IPL_assert(magic_match(tmp_sec, ZIPL_MAGIC), "No zIPL magic in header"= ); - IPL_assert(header->type =3D=3D ZIPL_COMP_HEADER_IPL, "Bad header type"= ); + if (!magic_match(tmp_sec, ZIPL_MAGIC)) { + puts("No zIPL magic in header"); + return -EINVAL; + } + if (header->type !=3D ZIPL_COMP_HEADER_IPL) { + puts("Bad header type"); + return -EINVAL; + } =20 dputs("start loading images\n"); =20 @@ -670,22 +687,30 @@ static void zipl_run(ScsiBlockPtr *pte) continue; } =20 - zipl_load_segment(entry); + if (zipl_load_segment(entry)) { + return 1; + } =20 entry++; =20 - IPL_assert((uint8_t *)(&entry[1]) <=3D (tmp_sec + MAX_SECTOR_SIZE), - "Wrong entry value"); + if ((uint8_t *)(&entry[1]) > (tmp_sec + MAX_SECTOR_SIZE)) { + puts("Wrong entry value"); + return -EINVAL; + } } =20 - IPL_assert(entry->component_type =3D=3D ZIPL_COMP_ENTRY_EXEC, "No EXEC= entry"); + if (entry->component_type !=3D ZIPL_COMP_ENTRY_EXEC) { + puts("No EXEC entry"); + return -EINVAL; + } =20 /* should not return */ write_reset_psw(entry->compdat.load_psw); jump_to_IPL_code(0); + return 1; } =20 -static void ipl_scsi(void) +static int ipl_scsi(void) { ScsiMbr *mbr =3D (void *)sec; int program_table_entries =3D 0; @@ -696,10 +721,13 @@ static void ipl_scsi(void) =20 /* Grab the MBR */ memset(sec, FREE_SPACE_FILLER, sizeof(sec)); - read_block(0, mbr, "Cannot read block 0"); + if (virtio_read(0, mbr)) { + puts("Cannot read block 0"); + return -EIO; + } =20 if (!magic_match(mbr->magic, ZIPL_MAGIC)) { - return; + return 0; } =20 puts("Using SCSI scheme."); @@ -707,11 +735,20 @@ static void ipl_scsi(void) IPL_check(mbr->version_id =3D=3D 1, "Unknown MBR layout version, assuming version 1"); debug_print_int("program table", mbr->pt.blockno); - IPL_assert(mbr->pt.blockno, "No Program Table"); + if (!mbr->pt.blockno) { + puts("No Program Table"); + return -EINVAL; + } =20 /* Parse the program table */ - read_block(mbr->pt.blockno, sec, "Error reading Program Table"); - IPL_assert(magic_match(sec, ZIPL_MAGIC), "No zIPL magic in PT"); + if (virtio_read(mbr->pt.blockno, sec)) { + puts("Error reading Program Table"); + return -EIO; + } + if (!magic_match(sec, ZIPL_MAGIC)) { + puts("No zIPL magic in Program Table"); + return -EINVAL; + } =20 for (i =3D 0; i < MAX_BOOT_ENTRIES; i++) { if (prog_table->entry[i].scsi.blockno) { @@ -721,17 +758,22 @@ static void ipl_scsi(void) } =20 debug_print_int("program table entries", program_table_entries); - IPL_assert(program_table_entries !=3D 0, "Empty Program Table"); + if (program_table_entries =3D=3D 0) { + puts("Empty Program Table"); + return -EINVAL; + } =20 if (menu_is_enabled_enum()) { loadparm =3D menu_get_enum_boot_index(valid_entries); } =20 debug_print_int("loadparm", loadparm); - IPL_assert(loadparm < MAX_BOOT_ENTRIES, "loadparm value greater than" - " maximum number of boot entries allowed"); + if (loadparm >=3D MAX_BOOT_ENTRIES) { + puts("loadparm value greater than max number of boot entries allow= ed"); + return -EINVAL; + } =20 - zipl_run(&prog_table->entry[loadparm].scsi); /* no return */ + return zipl_run(&prog_table->entry[loadparm].scsi); } =20 /*********************************************************************** @@ -1025,7 +1067,9 @@ void zipl_load(void) netmain(); } =20 - ipl_scsi(); + if (ipl_scsi()) { + panic("\n! Cannot IPL this SCSI device !\n"); + } =20 switch (virtio_get_device_type()) { case VIRTIO_ID_BLOCK: diff --git a/pc-bios/s390-ccw/jump2ipl.c b/pc-bios/s390-ccw/jump2ipl.c index 80b7f6a1f3..6671e4fe5c 100644 --- a/pc-bios/s390-ccw/jump2ipl.c +++ b/pc-bios/s390-ccw/jump2ipl.c @@ -16,6 +16,7 @@ #define RESET_PSW ((uint64_t)&jump_to_IPL_addr | RESET_PSW_MASK) =20 static uint64_t *reset_psw =3D 0, save_psw, ipl_continue; +extern bool have_iplb; =20 void write_reset_psw(uint64_t psw) { diff --git a/pc-bios/s390-ccw/virtio-blkdev.c b/pc-bios/s390-ccw/virtio-blk= dev.c index 2666326801..1c585f034b 100644 --- a/pc-bios/s390-ccw/virtio-blkdev.c +++ b/pc-bios/s390-ccw/virtio-blkdev.c @@ -73,13 +73,13 @@ unsigned long virtio_load_direct(unsigned long rec_list= 1, unsigned long rec_list unsigned long addr =3D (unsigned long)load_addr; =20 if (sec_len !=3D virtio_get_block_size()) { - return -1; + return 0; } =20 printf("."); status =3D virtio_read_many(sec, (void *)addr, sec_num); if (status) { - panic("I/O Error"); + return 0; } addr +=3D sec_num * virtio_get_block_size(); =20 diff --git a/pc-bios/s390-ccw/virtio-scsi.c b/pc-bios/s390-ccw/virtio-scsi.c index 0e274d0c38..60bc6fcbfa 100644 --- a/pc-bios/s390-ccw/virtio-scsi.c +++ b/pc-bios/s390-ccw/virtio-scsi.c @@ -26,7 +26,7 @@ static uint8_t scsi_inquiry_std_response[256]; static ScsiInquiryEvpdPages scsi_inquiry_evpd_pages_response; static ScsiInquiryEvpdBl scsi_inquiry_evpd_bl_response; =20 -static inline void vs_assert(bool term, const char **msgs) +static inline bool vs_assert(bool term, const char **msgs) { if (!term) { int i =3D 0; @@ -35,11 +35,13 @@ static inline void vs_assert(bool term, const char **ms= gs) while (msgs[i]) { printf("%s", msgs[i++]); } - panic(" !\n"); + puts(" !"); } + + return term; } =20 -static void virtio_scsi_verify_response(VirtioScsiCmdResp *resp, +static bool virtio_scsi_verify_response(VirtioScsiCmdResp *resp, const char *title) { const char *mr[] =3D { @@ -56,8 +58,12 @@ static void virtio_scsi_verify_response(VirtioScsiCmdRes= p *resp, 0 }; =20 - vs_assert(resp->response =3D=3D VIRTIO_SCSI_S_OK, mr); - vs_assert(resp->status =3D=3D CDB_STATUS_GOOD, ms); + if (!vs_assert(resp->response =3D=3D VIRTIO_SCSI_S_OK, mr) || + !vs_assert(resp->status =3D=3D CDB_STATUS_GOOD, ms)) { + return false; + } + + return true; } =20 static void prepare_request(VDev *vdev, const void *cdb, int cdb_size, @@ -78,24 +84,30 @@ static void prepare_request(VDev *vdev, const void *cdb= , int cdb_size, } } =20 -static inline void vs_io_assert(bool term, const char *msg) +static inline bool vs_io_assert(bool term, const char *msg) { - if (!term) { - virtio_scsi_verify_response(&resp, msg); + if (!term && !virtio_scsi_verify_response(&resp, msg)) { + return false; } + + return true; } =20 -static void vs_run(const char *title, VirtioCmd *cmd, VDev *vdev, +static int vs_run(const char *title, VirtioCmd *cmd, VDev *vdev, const void *cdb, int cdb_size, void *data, uint32_t data_size) { prepare_request(vdev, cdb, cdb_size, data, data_size); - vs_io_assert(virtio_run(vdev, VR_REQUEST, cmd) =3D=3D 0, title); + if (!vs_io_assert(virtio_run(vdev, VR_REQUEST, cmd) =3D=3D 0, title)) { + puts(title); + } + + return 0; } =20 /* SCSI protocol implementation routines */ =20 -static bool scsi_inquiry(VDev *vdev, uint8_t evpd, uint8_t page, +static int scsi_inquiry(VDev *vdev, uint8_t evpd, uint8_t page, void *data, uint32_t data_size) { ScsiCdbInquiry cdb =3D { @@ -110,12 +122,13 @@ static bool scsi_inquiry(VDev *vdev, uint8_t evpd, ui= nt8_t page, { data, data_size, VRING_DESC_F_WRITE }, }; =20 - vs_run("inquiry", inquiry, vdev, &cdb, sizeof(cdb), data, data_size); + int cc =3D vs_run("inquiry", inquiry, + vdev, &cdb, sizeof(cdb), data, data_size); =20 - return virtio_scsi_response_ok(&resp); + return cc ? cc : virtio_scsi_response_ok(&resp); } =20 -static bool scsi_test_unit_ready(VDev *vdev) +static int scsi_test_unit_ready(VDev *vdev) { ScsiCdbTestUnitReady cdb =3D { .command =3D 0x00, @@ -131,7 +144,7 @@ static bool scsi_test_unit_ready(VDev *vdev) return virtio_scsi_response_ok(&resp); } =20 -static bool scsi_report_luns(VDev *vdev, void *data, uint32_t data_size) +static int scsi_report_luns(VDev *vdev, void *data, uint32_t data_size) { ScsiCdbReportLuns cdb =3D { .command =3D 0xa0, @@ -144,13 +157,13 @@ static bool scsi_report_luns(VDev *vdev, void *data, = uint32_t data_size) { data, data_size, VRING_DESC_F_WRITE }, }; =20 - vs_run("report luns", report_luns, + int cc =3D vs_run("report luns", report_luns, vdev, &cdb, sizeof(cdb), data, data_size); =20 - return virtio_scsi_response_ok(&resp); + return cc ? cc : virtio_scsi_response_ok(&resp); } =20 -static bool scsi_read_10(VDev *vdev, +static int scsi_read_10(VDev *vdev, unsigned long sector, int sectors, void *data, unsigned int data_size) { @@ -168,12 +181,13 @@ static bool scsi_read_10(VDev *vdev, debug_print_int("read_10 sector", sector); debug_print_int("read_10 sectors", sectors); =20 - vs_run("read(10)", read_10, vdev, &cdb, sizeof(cdb), data, data_size); + int cc =3D vs_run("read(10)", read_10, + vdev, &cdb, sizeof(cdb), data, data_size); =20 - return virtio_scsi_response_ok(&resp); + return cc ? cc : virtio_scsi_response_ok(&resp); } =20 -static bool scsi_read_capacity(VDev *vdev, +static int scsi_read_capacity(VDev *vdev, void *data, uint32_t data_size) { ScsiCdbReadCapacity16 cdb =3D { @@ -187,10 +201,10 @@ static bool scsi_read_capacity(VDev *vdev, { data, data_size, VRING_DESC_F_WRITE }, }; =20 - vs_run("read capacity", read_capacity_16, + int cc =3D vs_run("read capacity", read_capacity_16, vdev, &cdb, sizeof(cdb), data, data_size); =20 - return virtio_scsi_response_ok(&resp); + return cc ? cc : virtio_scsi_response_ok(&resp); } =20 /* virtio-scsi routines */ @@ -207,7 +221,7 @@ static int virtio_scsi_locate_device(VDev *vdev) static uint8_t data[16 + 8 * 63]; ScsiLunReport *r =3D (void *) data; ScsiDevice *sdev =3D vdev->scsi_device; - int i, luns; + int i, cc, luns; =20 /* QEMU has hardcoded channel #0 in many places. * If this hardcoded value is ever changed, we'll need to add code for @@ -233,13 +247,21 @@ static int virtio_scsi_locate_device(VDev *vdev) sdev->channel =3D channel; sdev->target =3D target; sdev->lun =3D 0; /* LUN has to be 0 for REPORT LUNS */ - if (!scsi_report_luns(vdev, data, sizeof(data))) { + cc =3D scsi_report_luns(vdev, data, sizeof(data)); + if (cc < 0) { + return cc; + } + + else if (cc =3D=3D 0) { if (resp.response =3D=3D VIRTIO_SCSI_S_BAD_TARGET) { continue; } printf("target 0x%X", target); - virtio_scsi_verify_response(&resp, "SCSI cannot report LUNs"); + if (!virtio_scsi_verify_response(&resp, "SCSI cannot report LU= Ns")) { + return -EIO; + } } + if (r->lun_list_len =3D=3D 0) { printf("no LUNs for target 0x%X", target); continue; @@ -283,7 +305,9 @@ int virtio_scsi_read_many(VDev *vdev, data_size =3D sector_count * virtio_get_block_size() * f; if (!scsi_read_10(vdev, sector * f, sector_count * f, load_addr, data_size)) { - virtio_scsi_verify_response(&resp, "virtio-scsi:read_many"); + if (!virtio_scsi_verify_response(&resp, "virtio-scsi:read_many= ")) { + return 1; + } } load_addr +=3D data_size; sector +=3D sector_count; @@ -337,7 +361,7 @@ static int virtio_scsi_setup(VDev *vdev) uint32_t data_size =3D sizeof(data); ScsiInquiryEvpdPages *evpd =3D &scsi_inquiry_evpd_pages_response; ScsiInquiryEvpdBl *evpd_bl =3D &scsi_inquiry_evpd_bl_response; - int i, ret; + int i, cc, ret; =20 vdev->scsi_device =3D &default_scsi_device; ret =3D virtio_scsi_locate_device(vdev); @@ -352,11 +376,16 @@ static int virtio_scsi_setup(VDev *vdev) uint8_t code =3D resp.sense[0] & SCSI_SENSE_CODE_MASK; uint8_t sense_key =3D resp.sense[2] & SCSI_SENSE_KEY_MASK; =20 - IPL_assert(resp.sense_len !=3D 0, "virtio-scsi:setup: no SENSE= data"); + if (resp.sense_len =3D=3D 0) { + puts("virtio-scsi: setup: no SENSE data"); + return -EINVAL; + } =20 - IPL_assert(retry_test_unit_ready && code =3D=3D 0x70 && - sense_key =3D=3D SCSI_SENSE_KEY_UNIT_ATTENTION, - "virtio-scsi:setup: cannot retry"); + if (!retry_test_unit_ready || code !=3D 0x70 || + sense_key !=3D SCSI_SENSE_KEY_UNIT_ATTENTION) { + puts("virtio-scsi:setup: cannot retry"); + return -EIO; + } =20 /* retry on CHECK_CONDITION/UNIT_ATTENTION as it * may not designate a real error, but it may be @@ -367,16 +396,22 @@ static int virtio_scsi_setup(VDev *vdev) continue; } =20 - virtio_scsi_verify_response(&resp, "virtio-scsi:setup"); + if (!virtio_scsi_verify_response(&resp, "virtio-scsi:setup")) { + return 1; + } } =20 /* read and cache SCSI INQUIRY response */ - if (!scsi_inquiry(vdev, + cc =3D scsi_inquiry(vdev, SCSI_INQUIRY_STANDARD, SCSI_INQUIRY_STANDARD_NONE, scsi_inquiry_std_response, - sizeof(scsi_inquiry_std_response))) { - virtio_scsi_verify_response(&resp, "virtio-scsi:setup:inquiry"); + sizeof(scsi_inquiry_std_response)); + if (cc < 1) { + if (cc !=3D 0 || !virtio_scsi_verify_response(&resp, + "virtio-scsi:setup:inquiry")) { + return 1; + } } =20 if (virtio_scsi_inquiry_response_is_cdrom(scsi_inquiry_std_response)) { @@ -385,12 +420,16 @@ static int virtio_scsi_setup(VDev *vdev) vdev->scsi_block_size =3D VIRTIO_ISO_BLOCK_SIZE; } =20 - if (!scsi_inquiry(vdev, + cc =3D scsi_inquiry(vdev, SCSI_INQUIRY_EVPD, SCSI_INQUIRY_EVPD_SUPPORTED_PAGES, evpd, - sizeof(*evpd))) { - virtio_scsi_verify_response(&resp, "virtio-scsi:setup:supported_pa= ges"); + sizeof(*evpd)); + if (cc < 1) { + if (cc !=3D 0 || !virtio_scsi_verify_response(&resp, + "virtio-scsi:setup:supported_pages")) { + return 1; + } } =20 debug_print_int("EVPD length", evpd->page_length); @@ -402,12 +441,16 @@ static int virtio_scsi_setup(VDev *vdev) continue; } =20 - if (!scsi_inquiry(vdev, + cc =3D scsi_inquiry(vdev, SCSI_INQUIRY_EVPD, SCSI_INQUIRY_EVPD_BLOCK_LIMITS, evpd_bl, - sizeof(*evpd_bl))) { - virtio_scsi_verify_response(&resp, "virtio-scsi:setup:blocklim= its"); + sizeof(*evpd_bl)); + if (cc < 1) { + if (cc !=3D 0 || !virtio_scsi_verify_response(&resp, + "virtio-scsi:setup:blocklimits")) { + return 1; + } } =20 debug_print_int("max transfer", evpd_bl->max_transfer); @@ -423,8 +466,12 @@ static int virtio_scsi_setup(VDev *vdev) vdev->max_transfer =3D MIN_NON_ZERO(VIRTIO_SCSI_MAX_SECTORS, vdev->max_transfer); =20 - if (!scsi_read_capacity(vdev, data, data_size)) { - virtio_scsi_verify_response(&resp, "virtio-scsi:setup:read_capacit= y"); + cc =3D scsi_read_capacity(vdev, data, data_size); + if (cc < 1) { + if (cc !=3D 0 || !virtio_scsi_verify_response(&resp, + "virtio-scsi:setup:read_capacity")) { + return 1; + } } scsi_parse_capacity_report(data, &vdev->scsi_last_block, (uint32_t *) &vdev->scsi_block_size); @@ -439,10 +486,15 @@ int virtio_scsi_setup_device(SubChannelId schid) vdev->schid =3D schid; virtio_setup_ccw(vdev); =20 - IPL_assert(vdev->config.scsi.sense_size =3D=3D VIRTIO_SCSI_SENSE_SIZE, - "Config: sense size mismatch"); - IPL_assert(vdev->config.scsi.cdb_size =3D=3D VIRTIO_SCSI_CDB_SIZE, - "Config: CDB size mismatch"); + if (vdev->config.scsi.sense_size !=3D VIRTIO_SCSI_SENSE_SIZE) { + puts("Config: sense size mismatch"); + return -EINVAL; + } + + if (vdev->config.scsi.cdb_size !=3D VIRTIO_SCSI_CDB_SIZE) { + puts("Config: CDB size mismatch"); + return -EINVAL; + } =20 puts("Using virtio-scsi."); =20 --=20 2.45.1 From nobody Sat Nov 23 21:59:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1728350241; cv=none; d=zohomail.com; s=zohoarc; b=aS60kWrom4LVHW+9A1g2HSSdPE1ZJasQjpV4GB+Y4LdhtTP7ulVm5QKxpmmKXrbZ1GdHcLKUWbSNY0YfcfA2222Wvf/PPDhNj1qYjOuv5lyRG/FPXwG6s+BtcUBAsX1gkPNu+e7HWijSGtqW/osjq1eY6EAoschbeRxEb+odluU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728350241; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZUUdu/c2klu/lgghMRDTGUq2UzLhPEPmvXFgnl1ycQA=; b=Ys37NuStI6ILVrWHkyJfjwDN28lb5HHcEc9X1j0jcPpwt4V6JMUW6Byu+stn86JEbL2Zgave0mrDUR2VcwJ6GnogVgMhXFjKWievls1OT7s3Wl3f3pV/cGR6iEf5lSulSU1DGUqe06F6SmSbzl2aH0BLlNDwF29L+RadQ2ZHOHw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1728350241265996.9505512759631; Mon, 7 Oct 2024 18:17:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxypr-00048a-3j; Mon, 07 Oct 2024 21:16:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypl-000479-4C; Mon, 07 Oct 2024 21:16:17 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypj-0008J0-BK; Mon, 07 Oct 2024 21:16:16 -0400 Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4980pPTU013662; Tue, 8 Oct 2024 01:16:13 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424thqr2wk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:13 +0000 (GMT) Received: from m0353729.ppops.net (m0353729.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4981GDeS030761; Tue, 8 Oct 2024 01:16:13 GMT Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424thqr2we-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:12 +0000 (GMT) Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 497KjDHj011524; Tue, 8 Oct 2024 01:16:11 GMT Received: from smtprelay04.dal12v.mail.ibm.com ([172.16.1.6]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 423g5xhpvb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:11 +0000 Received: from smtpav06.dal12v.mail.ibm.com (smtpav06.dal12v.mail.ibm.com [10.241.53.105]) by smtprelay04.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4981GAqx33947910 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Oct 2024 01:16:10 GMT Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A44E158059; Tue, 8 Oct 2024 01:16:10 +0000 (GMT) Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 304D258043; Tue, 8 Oct 2024 01:16:10 +0000 (GMT) Received: from localhost.localdomain (unknown [9.61.51.58]) by smtpav06.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 8 Oct 2024 01:16:10 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=pp1; bh=ZUUdu/c2klu/l gghMRDTGUq2UzLhPEPmvXFgnl1ycQA=; b=sxOoWR/1cWo08kvY+qTwql6sgYDoc osMbrQcIDLidWLPBNERapOC6qKO4TN0PSQVc8WkAUrWK22QD4BAKF8jQ4q+pLnp6 oSE3cndKosa7MXpbl7Udm0Ao7pKEGrKrVFOP2INnByrUk8ta/7uv6jnwXthOnbH2 AjNyvn42j1Iptt3wpzMoSU1jOcbnvG3izByHwbuYrogrqgkJIQa+N0RjxW3qd/sK EXNAsHX/e9FhV3pALYIrtFJaBKs/myeEA4ZOxUxNzBRvsguY7jgDONS1xzSGWhlu jjC/f2cheA5B2oboky5VJgqzDza9xIERvM5HGzLca3Sz/cJL8ifNPSoyw== From: jrossi@linux.ibm.com To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org, thuth@redhat.com Cc: frankja@linux.ibm.com, jrossi@linux.ibm.com Subject: [PATCH v3 10/19] pc-bios/s390-ccw: Remove panics from DASD IPL path Date: Mon, 7 Oct 2024 21:15:43 -0400 Message-ID: <20241008011552.2645520-11-jrossi@linux.ibm.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241008011552.2645520-1-jrossi@linux.ibm.com> References: <20241008011552.2645520-1-jrossi@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: KTEfx9HVmMX1j-oasCHXz_QbMq6jlFJt X-Proofpoint-GUID: uX891nM0c3uQWMTYMRTNJ2ieAtyl0xvL X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-07_16,2024-10-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 adultscore=0 spamscore=0 mlxscore=0 impostorscore=0 phishscore=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0 bulkscore=0 mlxlogscore=776 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410080006 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=148.163.156.1; envelope-from=jrossi@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1728350242381116600 Content-Type: text/plain; charset="utf-8" From: Jared Rossi Remove panic-on-error from DASD IPL specific functions so that error recove= ry may be possible in the future. Functions that would previously panic now provide a return code. Signed-off-by: Jared Rossi Reviewed-by: Thomas Huth --- pc-bios/s390-ccw/dasd-ipl.h | 2 +- pc-bios/s390-ccw/dasd-ipl.c | 66 ++++++++++++++++++++----------------- 2 files changed, 37 insertions(+), 31 deletions(-) diff --git a/pc-bios/s390-ccw/dasd-ipl.h b/pc-bios/s390-ccw/dasd-ipl.h index c394828906..eb1898c84a 100644 --- a/pc-bios/s390-ccw/dasd-ipl.h +++ b/pc-bios/s390-ccw/dasd-ipl.h @@ -11,6 +11,6 @@ #ifndef DASD_IPL_H #define DASD_IPL_H =20 -void dasd_ipl(SubChannelId schid, uint16_t cutype); +int dasd_ipl(SubChannelId schid, uint16_t cutype); =20 #endif /* DASD_IPL_H */ diff --git a/pc-bios/s390-ccw/dasd-ipl.c b/pc-bios/s390-ccw/dasd-ipl.c index 99c0b93083..cd4fb884d6 100644 --- a/pc-bios/s390-ccw/dasd-ipl.c +++ b/pc-bios/s390-ccw/dasd-ipl.c @@ -111,38 +111,29 @@ static void make_readipl(void) ccwIplRead->count =3D 0x18; /* Read 0x18 bytes of data */ } =20 -static void run_readipl(SubChannelId schid, uint16_t cutype) +static int run_readipl(SubChannelId schid, uint16_t cutype) { - if (do_cio(schid, cutype, 0x00, CCW_FMT0)) { - panic("dasd-ipl: Failed to run Read IPL channel program\n"); - } + return do_cio(schid, cutype, 0x00, CCW_FMT0); } =20 /* * The architecture states that IPL1 data should consist of a psw followed= by * format-0 READ and TIC CCWs. Let's sanity check. */ -static void check_ipl1(void) +static bool check_ipl1(void) { Ccw0 *ccwread =3D (Ccw0 *)0x08; Ccw0 *ccwtic =3D (Ccw0 *)0x10; =20 - if (ccwread->cmd_code !=3D CCW_CMD_DASD_READ || - ccwtic->cmd_code !=3D CCW_CMD_TIC) { - panic("dasd-ipl: IPL1 data invalid. Is this disk really bootable?\= n"); - } + return (ccwread->cmd_code =3D=3D CCW_CMD_DASD_READ && + ccwtic->cmd_code =3D=3D CCW_CMD_TIC); } =20 -static void check_ipl2(uint32_t ipl2_addr) +static bool check_ipl2(uint32_t ipl2_addr) { Ccw0 *ccw =3D u32toptr(ipl2_addr); =20 - if (ipl2_addr =3D=3D 0x00) { - panic("IPL2 address invalid. Is this disk really bootable?\n"); - } - if (ccw->cmd_code =3D=3D 0x00) { - panic("IPL2 ccw data invalid. Is this disk really bootable?\n"); - } + return (ipl2_addr !=3D 0x00 && ccw->cmd_code !=3D 0x00); } =20 static uint32_t read_ipl2_addr(void) @@ -188,52 +179,67 @@ static void ipl1_fixup(void) ccwSearchTic->cda =3D ptr2u32(ccwSearchID); } =20 -static void run_ipl1(SubChannelId schid, uint16_t cutype) +static int run_ipl1(SubChannelId schid, uint16_t cutype) { uint32_t startAddr =3D 0x08; =20 - if (do_cio(schid, cutype, startAddr, CCW_FMT0)) { - panic("dasd-ipl: Failed to run IPL1 channel program\n"); - } + return do_cio(schid, cutype, startAddr, CCW_FMT0); } =20 -static void run_ipl2(SubChannelId schid, uint16_t cutype, uint32_t addr) +static int run_ipl2(SubChannelId schid, uint16_t cutype, uint32_t addr) { - if (run_dynamic_ccw_program(schid, cutype, addr)) { - panic("dasd-ipl: Failed to run IPL2 channel program\n"); - } + return run_dynamic_ccw_program(schid, cutype, addr); } =20 /* * Limitations in vfio-ccw support complicate the IPL process. Details can * be found in docs/devel/s390-dasd-ipl.rst */ -void dasd_ipl(SubChannelId schid, uint16_t cutype) +int dasd_ipl(SubChannelId schid, uint16_t cutype) { PSWLegacy *pswl =3D (PSWLegacy *) 0x00; uint32_t ipl2_addr; =20 /* Construct Read IPL CCW and run it to read IPL1 from boot disk */ make_readipl(); - run_readipl(schid, cutype); + if (run_readipl(schid, cutype)) { + puts("Failed to run Read IPL channel program"); + return -EIO; + } + ipl2_addr =3D read_ipl2_addr(); - check_ipl1(); + + if (!check_ipl1()) { + puts("IPL1 invalid for DASD-IPL"); + return -EINVAL; + } =20 /* * Fixup IPL1 channel program to account for vfio-ccw limitations, the= n run * it to read IPL2 channel program from boot disk. */ ipl1_fixup(); - run_ipl1(schid, cutype); - check_ipl2(ipl2_addr); + if (run_ipl1(schid, cutype)) { + puts("Failed to run IPL1 channel program"); + return -EIO; + } + + if (!check_ipl2(ipl2_addr)) { + puts("IPL2 invalid for DASD-IPL"); + return -EINVAL; + } =20 /* * Run IPL2 channel program to read operating system code from boot di= sk */ - run_ipl2(schid, cutype, ipl2_addr); + if (run_ipl2(schid, cutype, ipl2_addr)) { + puts("Failed to run IPL2 channel program"); + return -EIO; + } =20 /* Transfer control to the guest operating system */ pswl->mask |=3D PSW_MASK_EAMODE; /* Force z-mode */ pswl->addr |=3D PSW_MASK_BAMODE; /* ... */ jump_to_low_kernel(); + return 1; } --=20 2.45.1 From nobody Sat Nov 23 21:59:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1728350398; cv=none; d=zohomail.com; s=zohoarc; b=KU65CZ4Ej0B1adv9UDs0jXAaOMgc02FDZ5SJuvMMQVdIpZjdS8ZIkxPrdBzFDY3JjJJVTYc5R+wfUsE6kIjTAjqPGtkI/SP9R8PIG4Zb9HrBTP28sowVBCs7On0BeisLhGkky5HRCEn3pGMNGCjRIvB/+lKmRc4HAaKhSvQK5qU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728350398; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=xrqYhGsRfzkIgI7UJhFw6xZfDl5QI7dFuNb11Xf9od4=; b=NBhSnJ/8el7A9AQ/cUGXQ2WTdd1OlJfGewm5wjEygLgKHh5ne/UDxmQn7dqgQikSG4pZiS4QIRf7HjmUF3UbP3mv4pTP6xFMSfumBx50r+PPjBpLrcXgO5qpN3mIh2LdioWeFJGIHX3EQ+JA57axQOGS5aOi8LAqeIBrwuAGxV0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1728350398569533.9634371868876; Mon, 7 Oct 2024 18:19:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxyq5-0004Ft-Bl; Mon, 07 Oct 2024 21:16:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypk-000475-TZ; Mon, 07 Oct 2024 21:16:17 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypj-0008J9-AZ; Mon, 07 Oct 2024 21:16:16 -0400 Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4980oLYQ008829; Tue, 8 Oct 2024 01:16:14 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424thq02ke-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:13 +0000 (GMT) Received: from m0356516.ppops.net (m0356516.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4981GDPW026912; Tue, 8 Oct 2024 01:16:13 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424thq02kb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:13 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 497N6YTp022835; Tue, 8 Oct 2024 01:16:12 GMT Received: from smtprelay05.dal12v.mail.ibm.com ([172.16.1.7]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 423jg0s7p7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:12 +0000 Received: from smtpav06.dal12v.mail.ibm.com (smtpav06.dal12v.mail.ibm.com [10.241.53.105]) by smtprelay05.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4981GBdf38863230 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Oct 2024 01:16:12 GMT Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D2FD358043; Tue, 8 Oct 2024 01:16:11 +0000 (GMT) Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5E0BE58055; Tue, 8 Oct 2024 01:16:11 +0000 (GMT) Received: from localhost.localdomain (unknown [9.61.51.58]) by smtpav06.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 8 Oct 2024 01:16:11 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=pp1; bh=xrqYhGsRfzkIg I7UJhFw6xZfDl5QI7dFuNb11Xf9od4=; b=ilfNX6GMQV5YszhSb7WoT2i0vZG6L uHLglsDFoh8V42ua7B6c8/doCZTRM9G5lAqPkA6knpg3iwruLoqUXSjkzYH5P/52 +VEIXBzWpts/lO5QzY3DuoEbqnzdBSjCI2FXBm+E/5tI7VboTvCo1u0HA9mqLNL4 WpKWsnItPI0m0JuOvq9P0KRWDi4NcXu2KDgVGTtsJ+HUwxA6JyJywP3zaJn6h4b4 qTWMVhww+ebRq6voO8wm1GdEkwQG2HLw8GCLnN6zbJXxBx+UO0MM5xp94w3uUK0p yvMFulAHQEW1HTZfq1vcbTuvpN7PJ9H0MV2NAHf4C8LSkMZofHkrOYs2w== From: jrossi@linux.ibm.com To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org, thuth@redhat.com Cc: frankja@linux.ibm.com, jrossi@linux.ibm.com Subject: [PATCH v3 11/19] pc-bios/s390-ccw: Remove panics from Netboot IPL path Date: Mon, 7 Oct 2024 21:15:44 -0400 Message-ID: <20241008011552.2645520-12-jrossi@linux.ibm.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241008011552.2645520-1-jrossi@linux.ibm.com> References: <20241008011552.2645520-1-jrossi@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: _0AVYJyGP-7hVnUWVHxvIuTOh_hxPFD5 X-Proofpoint-GUID: MqcmMynhp5Pj7M9suwlgoPjLMCa_846q X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-07_16,2024-10-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 phishscore=0 adultscore=0 malwarescore=0 priorityscore=1501 suspectscore=0 lowpriorityscore=0 mlxlogscore=999 bulkscore=0 clxscore=1015 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410080006 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=148.163.158.5; envelope-from=jrossi@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1728350399513116600 Content-Type: text/plain; charset="utf-8" From: Jared Rossi Remove panic-on-error from Netboot specific functions so that error recovery may be possible in the future. Functions that would previously panic now provide a return code. Signed-off-by: Jared Rossi --- pc-bios/s390-ccw/s390-ccw.h | 2 +- pc-bios/s390-ccw/bootmap.c | 1 + pc-bios/s390-ccw/netmain.c | 17 +++++++++++------ pc-bios/s390-ccw/virtio-net.c | 7 +++++-- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h index 7516e96a14..496dccb2aa 100644 --- a/pc-bios/s390-ccw/s390-ccw.h +++ b/pc-bios/s390-ccw/s390-ccw.h @@ -58,7 +58,7 @@ unsigned int get_loadparm_index(void); void main(void); =20 /* netmain.c */ -void netmain(void); +int netmain(void); =20 /* sclp.c */ void sclp_print(const char *string); diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c index 534d900f9e..1874d4bf5e 100644 --- a/pc-bios/s390-ccw/bootmap.c +++ b/pc-bios/s390-ccw/bootmap.c @@ -1065,6 +1065,7 @@ void zipl_load(void) =20 if (virtio_get_device_type() =3D=3D VIRTIO_ID_NET) { netmain(); + panic("\n! Cannot IPL from this network !\n"); } =20 if (ipl_scsi()) { diff --git a/pc-bios/s390-ccw/netmain.c b/pc-bios/s390-ccw/netmain.c index bc6ad8695f..0c2329c752 100644 --- a/pc-bios/s390-ccw/netmain.c +++ b/pc-bios/s390-ccw/netmain.c @@ -464,7 +464,7 @@ static bool find_net_dev(Schib *schib, int dev_no) return false; } =20 -static void virtio_setup(void) +static int virtio_setup(void) { Schib schib; int ssid; @@ -495,10 +495,10 @@ static void virtio_setup(void) } } =20 - IPL_assert(found, "No virtio net device found"); + return found; } =20 -void netmain(void) +int netmain(void) { filename_ip_t fn_ip; int rc, fnlen; @@ -506,11 +506,15 @@ void netmain(void) sclp_setup(); puts("Network boot starting..."); =20 - virtio_setup(); + if (!virtio_setup()) { + puts("No virtio net device found."); + return 1; + } =20 rc =3D net_init(&fn_ip); if (rc) { - panic("Network initialization failed. Halting."); + puts("Network initialization failed."); + return 1; } =20 fnlen =3D strlen(fn_ip.filename); @@ -528,5 +532,6 @@ void netmain(void) jump_to_low_kernel(); } =20 - panic("Failed to load OS from network."); + puts("Failed to load OS from network."); + return 1; } diff --git a/pc-bios/s390-ccw/virtio-net.c b/pc-bios/s390-ccw/virtio-net.c index 2fcb0a58c5..f9854a22c3 100644 --- a/pc-bios/s390-ccw/virtio-net.c +++ b/pc-bios/s390-ccw/virtio-net.c @@ -54,8 +54,11 @@ int virtio_net_init(void *mac_addr) vdev->guest_features[0] =3D VIRTIO_NET_F_MAC_BIT; virtio_setup_ccw(vdev); =20 - IPL_assert(vdev->guest_features[0] & VIRTIO_NET_F_MAC_BIT, - "virtio-net device does not support the MAC address feature= "); + if (!(vdev->guest_features[0] & VIRTIO_NET_F_MAC_BIT)) { + puts("virtio-net device does not support the MAC address feature"); + return -1; + } + memcpy(mac_addr, vdev->config.net.mac, ETH_ALEN); =20 for (i =3D 0; i < 64; i++) { --=20 2.45.1 From nobody Sat Nov 23 21:59:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1728350680; cv=none; d=zohomail.com; s=zohoarc; b=DossfMZZY5grR12JCUQqTLrWYzR5xlds2I0QbDaeQQmGgZGrzasKe8MjgRcXx/2kRYEmsbOdZYzoRHDaOL2AYqsKe7yWnxl1XUG9KDulazcTSepreil7H1Dj+lSbg9gcu/JaF39A5dxG+ktXQYgNIMymTliAf7oXijarfSD9tiI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728350680; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=makpDwUvlh3dqljBNVAsth6a0r4pZ+82htafiNgsa9s=; b=b8RkMj6yk9R0pMTnWOEPXas3A+4BDbEhNWp7hA3PgaN5hgK/nGyfgZINqWjtc+STC7rZ9qaLV5n5mp6PkXwTffEQPfZWmbXrhZuLyYMpI+jNlkHrQkk6ujHvFWnqOS7X6zlZ0KLMEd9LVLrYhUtgB6jKFXFagDiXqX7LtwRKLYU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1728350680494793.6091259140577; Mon, 7 Oct 2024 18:24:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxyq4-0004Fj-N2; Mon, 07 Oct 2024 21:16:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypn-000483-04; Mon, 07 Oct 2024 21:16:19 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypk-0008Jo-C6; Mon, 07 Oct 2024 21:16:18 -0400 Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 497Nt3N9026100; Tue, 8 Oct 2024 01:16:15 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424sr4g7hb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:15 +0000 (GMT) Received: from m0360072.ppops.net (m0360072.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4981G8nF017417; Tue, 8 Oct 2024 01:16:14 GMT Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424sr4g7h9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:14 +0000 (GMT) Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 4980wm1f013804; Tue, 8 Oct 2024 01:16:13 GMT Received: from smtprelay07.dal12v.mail.ibm.com ([172.16.1.9]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 423fss1r3u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:13 +0000 Received: from smtpav06.dal12v.mail.ibm.com (smtpav06.dal12v.mail.ibm.com [10.241.53.105]) by smtprelay07.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4981GDlP43712988 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Oct 2024 01:16:13 GMT Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F077758043; Tue, 8 Oct 2024 01:16:12 +0000 (GMT) Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7A7CD58059; Tue, 8 Oct 2024 01:16:12 +0000 (GMT) Received: from localhost.localdomain (unknown [9.61.51.58]) by smtpav06.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 8 Oct 2024 01:16:12 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=pp1; bh=makpDwUvlh3dq ljBNVAsth6a0r4pZ+82htafiNgsa9s=; b=aOMaVhRRTmdpqOqYkEHwQNeQ72xaz TFxHg8g1I3jjvNLdQk2H1aBSjzow94fKlXXzqtQNxaPdlAZVOLGYD58asHX+5KLI DMpN8ph+hO8hOCgds0jleDomVCHYig1kXJuLDOzlmXlEfX6Z77ctwtKFyhHaLRk/ zNL11rSPmaDwbWbLhTsqvauIpJFFLJi6LGLZuRUi1Jd66r+PVVZ6hXZ/554rixg6 F6kwmnqEmp3iyIvPFxr24Dc7Wi5jKcHdVWWkvNeKcwfpgv1bMh8HHPEa2JgPf7Io 1ZnZSVnZ8VfsXdNhYuye9/FxiBMUYmyR5ayYU8axB1hxGuEoWoJa0NGwQ== From: jrossi@linux.ibm.com To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org, thuth@redhat.com Cc: frankja@linux.ibm.com, jrossi@linux.ibm.com Subject: [PATCH v3 12/19] pc-bios/s390-ccw: Enable failed IPL to return after error Date: Mon, 7 Oct 2024 21:15:45 -0400 Message-ID: <20241008011552.2645520-13-jrossi@linux.ibm.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241008011552.2645520-1-jrossi@linux.ibm.com> References: <20241008011552.2645520-1-jrossi@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: Dj_vaQIG5cUacCdVInkQdzQ6P-IAjoce X-Proofpoint-GUID: nKdhjMmV5PDB6IR5MMk3esnji9tSEPfr X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-07_16,2024-10-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 bulkscore=0 clxscore=1015 spamscore=0 mlxscore=0 lowpriorityscore=0 phishscore=0 malwarescore=0 suspectscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410080003 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=148.163.158.5; envelope-from=jrossi@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1728350682704116600 Content-Type: text/plain; charset="utf-8" From: Jared Rossi Remove panic-on-error from IPL functions such that a return code is propaga= ted back to the main IPL calling function (rather than terminating immediately), which facilitates possible error recovery in the future. A select few panics remain, which indicate fatal non-devices errors that mu= st result in termination. Signed-off-by: Jared Rossi Reviewed-by: Thomas Huth --- pc-bios/s390-ccw/s390-ccw.h | 2 +- pc-bios/s390-ccw/virtio.h | 2 +- pc-bios/s390-ccw/bootmap.c | 53 ++++++++++++++++++-------- pc-bios/s390-ccw/cio.c | 3 +- pc-bios/s390-ccw/jump2ipl.c | 5 ++- pc-bios/s390-ccw/main.c | 35 +++++++++-------- pc-bios/s390-ccw/virtio-blkdev.c | 4 +- pc-bios/s390-ccw/virtio.c | 65 +++++++++++++++++++++----------- 8 files changed, 111 insertions(+), 58 deletions(-) diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h index 496dccb2aa..cdf998868c 100644 --- a/pc-bios/s390-ccw/s390-ccw.h +++ b/pc-bios/s390-ccw/s390-ccw.h @@ -79,7 +79,7 @@ void zipl_load(void); =20 /* jump2ipl.c */ void write_reset_psw(uint64_t psw); -void jump_to_IPL_code(uint64_t address); +int jump_to_IPL_code(uint64_t address); void jump_to_low_kernel(void); =20 /* menu.c */ diff --git a/pc-bios/s390-ccw/virtio.h b/pc-bios/s390-ccw/virtio.h index 6f9a558ff5..9faf3986b1 100644 --- a/pc-bios/s390-ccw/virtio.h +++ b/pc-bios/s390-ccw/virtio.h @@ -274,7 +274,7 @@ void vring_send_buf(VRing *vr, void *p, int len, int fl= ags); int vr_poll(VRing *vr); int vring_wait_reply(void); int virtio_run(VDev *vdev, int vqid, VirtioCmd *cmd); -void virtio_setup_ccw(VDev *vdev); +int virtio_setup_ccw(VDev *vdev); =20 int virtio_net_init(void *mac_addr); =20 diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c index 1874d4bf5e..c80fcd6f01 100644 --- a/pc-bios/s390-ccw/bootmap.c +++ b/pc-bios/s390-ccw/bootmap.c @@ -62,15 +62,34 @@ static void *s2_prev_blk =3D _s2; static void *s2_cur_blk =3D _s2 + MAX_SECTOR_SIZE; static void *s2_next_blk =3D _s2 + MAX_SECTOR_SIZE * 2; =20 -static inline void verify_boot_info(BootInfo *bip) +static inline int verify_boot_info(BootInfo *bip) { - IPL_assert(magic_match(bip->magic, ZIPL_MAGIC), "No zIPL sig in BootIn= fo"); - IPL_assert(bip->version =3D=3D BOOT_INFO_VERSION, "Wrong zIPL version"= ); - IPL_assert(bip->bp_type =3D=3D BOOT_INFO_BP_TYPE_IPL, "DASD is not for= IPL"); - IPL_assert(bip->dev_type =3D=3D BOOT_INFO_DEV_TYPE_ECKD, "DASD is not = ECKD"); - IPL_assert(bip->flags =3D=3D BOOT_INFO_FLAGS_ARCH, "Not for this arch"= ); - IPL_assert(block_size_ok(bip->bp.ipl.bm_ptr.eckd.bptr.size), - "Bad block size in zIPL section of the 1st record."); + if (!magic_match(bip->magic, ZIPL_MAGIC)) { + puts("No zIPL sig in BootInfo"); + return -EINVAL; + } + if (bip->version !=3D BOOT_INFO_VERSION) { + puts("Wrong zIPL version"); + return -EINVAL; + } + if (bip->bp_type !=3D BOOT_INFO_BP_TYPE_IPL) { + puts("DASD is not for IPL"); + return -ENODEV; + } + if (bip->dev_type !=3D BOOT_INFO_DEV_TYPE_ECKD) { + puts("DASD is not ECKD"); + return -ENODEV; + } + if (bip->flags !=3D BOOT_INFO_FLAGS_ARCH) { + puts("Not for this arch"); + return -EINVAL; + } + if (!block_size_ok(bip->bp.ipl.bm_ptr.eckd.bptr.size)) { + puts("Bad block size in zIPL section of 1st record"); + return -EINVAL; + } + + return 0; } =20 static void eckd_format_chs(ExtEckdBlockPtr *ptr, bool ldipl, @@ -368,8 +387,8 @@ static int run_eckd_boot_script(block_number_t bmt_bloc= k_nr, puts("Unknown script entry type"); return -EINVAL; } - write_reset_psw(bms->entry[i].address.load_address); /* no return */ - jump_to_IPL_code(0); /* no return */ + write_reset_psw(bms->entry[i].address.load_address); + jump_to_IPL_code(0); return 1; } =20 @@ -1060,16 +1079,19 @@ void zipl_load(void) =20 if (vdev->is_cdrom) { ipl_iso_el_torito(); - panic("\n! Cannot IPL this ISO image !\n"); + puts("Failed to IPL this ISO image!"); + return; } =20 if (virtio_get_device_type() =3D=3D VIRTIO_ID_NET) { netmain(); - panic("\n! Cannot IPL from this network !\n"); + puts("Failed to IPL from this network!"); + return; } =20 if (ipl_scsi()) { - panic("\n! Cannot IPL this SCSI device !\n"); + puts("Failed to IPL from this SCSI device!"); + return; } =20 switch (virtio_get_device_type()) { @@ -1080,8 +1102,9 @@ void zipl_load(void) zipl_load_vscsi(); break; default: - panic("\n! Unknown IPL device type !\n"); + puts("Unknown IPL device type!"); + return; } =20 - puts("zIPL load failed."); + puts("zIPL load failed!"); } diff --git a/pc-bios/s390-ccw/cio.c b/pc-bios/s390-ccw/cio.c index 758e74965e..35b08ba7c1 100644 --- a/pc-bios/s390-ccw/cio.c +++ b/pc-bios/s390-ccw/cio.c @@ -59,7 +59,8 @@ uint16_t cu_type(SubChannelId schid) }; =20 if (do_cio(schid, CU_TYPE_UNKNOWN, ptr2u32(&sense_id_ccw), CCW_FMT1)) { - panic("Failed to run SenseID CCw\n"); + puts("Failed to run SenseID CCW"); + return CU_TYPE_UNKNOWN; } =20 return sense_data.cu_type; diff --git a/pc-bios/s390-ccw/jump2ipl.c b/pc-bios/s390-ccw/jump2ipl.c index 6671e4fe5c..92627b56c6 100644 --- a/pc-bios/s390-ccw/jump2ipl.c +++ b/pc-bios/s390-ccw/jump2ipl.c @@ -34,7 +34,7 @@ static void jump_to_IPL_addr(void) /* should not return */ } =20 -void jump_to_IPL_code(uint64_t address) +int jump_to_IPL_code(uint64_t address) { /* store the subsystem information _after_ the bootmap was loaded */ write_subsystem_identification(); @@ -69,7 +69,8 @@ void jump_to_IPL_code(uint64_t address) asm volatile("lghi %%r1,1\n\t" "diag %%r1,%%r1,0x308\n\t" : : : "1", "memory"); - panic("\n! IPL returns !\n"); + puts("IPL code jump failed"); + return 1; } =20 void jump_to_low_kernel(void) diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c index 2345432abb..f818bd7210 100644 --- a/pc-bios/s390-ccw/main.c +++ b/pc-bios/s390-ccw/main.c @@ -77,6 +77,9 @@ static int is_dev_possibly_bootable(int dev_no, int sch_n= o) =20 enable_subchannel(blk_schid); cutype =3D cu_type(blk_schid); + if (cutype =3D=3D CU_TYPE_UNKNOWN) { + return -EIO; + } =20 /* * Note: we always have to run virtio_is_supported() here to make @@ -194,10 +197,10 @@ static void boot_setup(void) have_iplb =3D store_iplb(&iplb); } =20 -static void find_boot_device(void) +static bool find_boot_device(void) { VDev *vdev =3D virtio_get_device(); - bool found; + bool found =3D false; =20 switch (iplb.pbt) { case S390_IPL_TYPE_CCW: @@ -215,10 +218,10 @@ static void find_boot_device(void) found =3D find_subch(iplb.scsi.devno); break; default: - panic("List-directed IPL not supported yet!\n"); + puts("Unsupported IPLB"); } =20 - IPL_assert(found, "Boot device not found\n"); + return found; } =20 static int virtio_setup(void) @@ -244,11 +247,13 @@ static int virtio_setup(void) ret =3D virtio_scsi_setup_device(blk_schid); break; default: - panic("\n! No IPL device available !\n"); + puts("\n! No IPL device available !\n"); + return 1; } =20 - if (!ret) { - IPL_assert(virtio_ipl_disk_is_valid(), "No valid IPL device detect= ed"); + if (!ret && !virtio_ipl_disk_is_valid()) { + puts("No valid IPL device detected"); + return -ENODEV; } =20 return ret; @@ -259,16 +264,16 @@ static void ipl_boot_device(void) switch (cutype) { case CU_TYPE_DASD_3990: case CU_TYPE_DASD_2107: - dasd_ipl(blk_schid, cutype); /* no return */ + dasd_ipl(blk_schid, cutype); break; case CU_TYPE_VIRTIO: - if (virtio_setup() =3D=3D 0) { - zipl_load(); /* Only returns in case of errors */ + if (virtio_setup()) { + return; /* Only returns in case of errors */ } + zipl_load(); break; default: printf("Attempting to boot from unexpected device type 0x%X", cuty= pe); - panic("\nBoot failed.\n"); } } =20 @@ -288,7 +293,8 @@ static void probe_boot_device(void) break; } if (ret =3D=3D true) { - ipl_boot_device(); /* Only returns if unsuccessful */ + ipl_boot_device(); /* Only returns if unsuccessful */ + return; } } } @@ -301,12 +307,11 @@ void main(void) sclp_setup(); css_setup(); boot_setup(); - if (have_iplb) { - find_boot_device(); + if (have_iplb && find_boot_device()) { ipl_boot_device(); } else { probe_boot_device(); } =20 - panic("Failed to load OS from hard disk\n"); + panic("Failed to IPL. Halting..."); } diff --git a/pc-bios/s390-ccw/virtio-blkdev.c b/pc-bios/s390-ccw/virtio-blk= dev.c index 1c585f034b..5ef273bdc0 100644 --- a/pc-bios/s390-ccw/virtio-blkdev.c +++ b/pc-bios/s390-ccw/virtio-blkdev.c @@ -59,8 +59,8 @@ int virtio_read_many(unsigned long sector, void *load_add= r, int sec_num) case VIRTIO_ID_SCSI: return virtio_scsi_read_many(vdev, sector, load_addr, sec_num); } - panic("\n! No readable IPL device !\n"); - return -1; + + return 1; } =20 unsigned long virtio_load_direct(unsigned long rec_list1, unsigned long re= c_list2, diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c index 8c6b0a8a92..8b5a370bb3 100644 --- a/pc-bios/s390-ccw/virtio.c +++ b/pc-bios/s390-ccw/virtio.c @@ -217,16 +217,19 @@ int virtio_run(VDev *vdev, int vqid, VirtioCmd *cmd) return 0; } =20 -void virtio_setup_ccw(VDev *vdev) +int virtio_setup_ccw(VDev *vdev) { - int i, rc, cfg_size =3D 0; + int i, cfg_size =3D 0; uint8_t status; struct VirtioFeatureDesc { uint32_t features; uint8_t index; } __attribute__((packed)) feats; =20 - IPL_assert(virtio_is_supported(vdev->schid), "PE"); + if (!virtio_is_supported(vdev->schid)) { + puts("Virtio unsupported for this device ID"); + return -ENODEV; + } /* device ID has been established now */ =20 vdev->config.blk.blk_size =3D 0; /* mark "illegal" - setup started... = */ @@ -235,8 +238,10 @@ void virtio_setup_ccw(VDev *vdev) run_ccw(vdev, CCW_CMD_VDEV_RESET, NULL, 0, false); =20 status =3D VIRTIO_CONFIG_S_ACKNOWLEDGE; - rc =3D run_ccw(vdev, CCW_CMD_WRITE_STATUS, &status, sizeof(status), fa= lse); - IPL_assert(rc =3D=3D 0, "Could not write ACKNOWLEDGE status to host"); + if (run_ccw(vdev, CCW_CMD_WRITE_STATUS, &status, sizeof(status), false= )) { + puts("Could not write ACKNOWLEDGE status to host"); + return -EIO; + } =20 switch (vdev->senseid.cu_model) { case VIRTIO_ID_NET: @@ -255,27 +260,37 @@ void virtio_setup_ccw(VDev *vdev) cfg_size =3D sizeof(vdev->config.scsi); break; default: - panic("Unsupported virtio device\n"); + puts("Unsupported virtio device"); + return -ENODEV; } =20 status |=3D VIRTIO_CONFIG_S_DRIVER; - rc =3D run_ccw(vdev, CCW_CMD_WRITE_STATUS, &status, sizeof(status), fa= lse); - IPL_assert(rc =3D=3D 0, "Could not write DRIVER status to host"); + if (run_ccw(vdev, CCW_CMD_WRITE_STATUS, &status, sizeof(status), false= )) { + puts("Could not write DRIVER status to host"); + return -EIO; + } =20 /* Feature negotiation */ for (i =3D 0; i < ARRAY_SIZE(vdev->guest_features); i++) { feats.features =3D 0; feats.index =3D i; - rc =3D run_ccw(vdev, CCW_CMD_READ_FEAT, &feats, sizeof(feats), fal= se); - IPL_assert(rc =3D=3D 0, "Could not get features bits"); + if (run_ccw(vdev, CCW_CMD_READ_FEAT, &feats, sizeof(feats), false)= ) { + puts("Could not get features bits"); + return -EIO; + } + vdev->guest_features[i] &=3D bswap32(feats.features); feats.features =3D bswap32(vdev->guest_features[i]); - rc =3D run_ccw(vdev, CCW_CMD_WRITE_FEAT, &feats, sizeof(feats), fa= lse); - IPL_assert(rc =3D=3D 0, "Could not set features bits"); + if (run_ccw(vdev, CCW_CMD_WRITE_FEAT, &feats, sizeof(feats), false= )) { + puts("Could not set features bits"); + return -EIO; + } } =20 - rc =3D run_ccw(vdev, CCW_CMD_READ_CONF, &vdev->config, cfg_size, false= ); - IPL_assert(rc =3D=3D 0, "Could not get virtio device configuration"); + if (run_ccw(vdev, CCW_CMD_READ_CONF, &vdev->config, cfg_size, false)) { + puts("Could not get virtio device configuration"); + return -EIO; + } =20 for (i =3D 0; i < vdev->nr_vqs; i++) { VqInfo info =3D { @@ -289,19 +304,27 @@ void virtio_setup_ccw(VDev *vdev) .num =3D 0, }; =20 - rc =3D run_ccw(vdev, CCW_CMD_READ_VQ_CONF, &config, sizeof(config)= , false); - IPL_assert(rc =3D=3D 0, "Could not get virtio device VQ configurat= ion"); + if (run_ccw(vdev, CCW_CMD_READ_VQ_CONF, &config, sizeof(config), + false)) { + puts("Could not get virtio device VQ config"); + return -EIO; + } info.num =3D config.num; vring_init(&vdev->vrings[i], &info); vdev->vrings[i].schid =3D vdev->schid; - IPL_assert( - run_ccw(vdev, CCW_CMD_SET_VQ, &info, sizeof(info), false) =3D= =3D 0, - "Cannot set VQ info"); + if (run_ccw(vdev, CCW_CMD_SET_VQ, &info, sizeof(info), false)) { + puts("Cannot set VQ info"); + return -EIO; + } } =20 status |=3D VIRTIO_CONFIG_S_DRIVER_OK; - rc =3D run_ccw(vdev, CCW_CMD_WRITE_STATUS, &status, sizeof(status), fa= lse); - IPL_assert(rc =3D=3D 0, "Could not write DRIVER_OK status to host"); + if (run_ccw(vdev, CCW_CMD_WRITE_STATUS, &status, sizeof(status), false= )) { + puts("Could not write DRIVER_OK status to host"); + return -EIO; + } + + return 0; } =20 bool virtio_is_supported(SubChannelId schid) --=20 2.45.1 From nobody Sat Nov 23 21:59:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1728350546; cv=none; d=zohomail.com; s=zohoarc; b=mfWVHwl1sqDSfx62x1VYoFg674UoZqXZCarfytBwke3PtiNuJdUC7z78hm4q7mHqYt6q+YvA2bCqvAoBltuvUs+4t7Cq1CNTaWYSxEFQf1BbNboa2r+rL+j2G/gRJKxRRt32OxDEs3K4XI6a8RQeVsOUv1NQi7FpqxtghPvBz6c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728350546; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=FE2kBH2KVAs0bEoEkeM9AWo8BWkBeyGKzMjsgfo91+E=; b=jAbZFJpqK3NGR2EdKZFJohEv7xli/iB0hOTHehiJXlQbJB9GCHfCgT8f//sVwpSk+CZri5i/cV/md9fu11wLMJuJ9TLKto+38E6SeXt90NDron5Bopcef/XhT9kAwCMAFn5XbtHru9y8Irx5HVWL0gvrTHbEjNeiM03DXsY27Iw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1728350546970759.8178562425783; Mon, 7 Oct 2024 18:22:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxyq7-0004HV-Ac; Mon, 07 Oct 2024 21:16:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypp-00048i-H3; Mon, 07 Oct 2024 21:16:22 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypn-0008LD-9b; Mon, 07 Oct 2024 21:16:21 -0400 Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 497Ljfer022273; Tue, 8 Oct 2024 01:16:17 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424qu78m4t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:17 +0000 (GMT) Received: from m0356517.ppops.net (m0356517.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4981GH18027304; Tue, 8 Oct 2024 01:16:17 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424qu78m4r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:16 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 497Mk1I9022848; Tue, 8 Oct 2024 01:16:16 GMT Received: from smtprelay01.wdc07v.mail.ibm.com ([172.16.1.68]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 423jg0s7pc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:16 +0000 Received: from smtpav06.dal12v.mail.ibm.com (smtpav06.dal12v.mail.ibm.com [10.241.53.105]) by smtprelay01.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4981GExq41681288 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Oct 2024 01:16:14 GMT Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4039058059; Tue, 8 Oct 2024 01:16:14 +0000 (GMT) Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BCC8C58043; Tue, 8 Oct 2024 01:16:13 +0000 (GMT) Received: from localhost.localdomain (unknown [9.61.51.58]) by smtpav06.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 8 Oct 2024 01:16:13 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=pp1; bh=FE2kBH2KVAs0b EoEkeM9AWo8BWkBeyGKzMjsgfo91+E=; b=M5In7poQWrZ6dRtpYUguE5bebsa3h G4jJE2uqHl2lym+DB6fIW5AFQihbqouhl37rDkH1tKghxnWx4mQO2mAl3TZB4wBS 8DZJ9lCfoM21566HDI4nVGC/VfbuLOGxTGqJH9zwQoh0Q4DtarhIL2b9BOrKXQ4M pgnSRAXfplwXB57gtGI0WKEj1NcZ1iiLNUORszcIAdlxi/oB1Z50HgggyKVeKBem UiJ3n21I6XY58f04cm0Z+Rdn8nabeP9zgQZzVl/Igh1v9oNJSYq6sD2cok/EMnXc 4+gjKLRj7T0fpatRqfLe/E5noaFOkCRwGxqGYDMNjlxgqLmfnwkULU5LQ== From: jrossi@linux.ibm.com To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org, thuth@redhat.com Cc: frankja@linux.ibm.com, jrossi@linux.ibm.com Subject: [PATCH v3 13/19] include/hw/s390x: Add include files for common IPL structs Date: Mon, 7 Oct 2024 21:15:46 -0400 Message-ID: <20241008011552.2645520-14-jrossi@linux.ibm.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241008011552.2645520-1-jrossi@linux.ibm.com> References: <20241008011552.2645520-1-jrossi@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: OUr4i7SjtHxXEnMjq50VU1qamCbyBLW0 X-Proofpoint-GUID: 9PYGbMYJlHadACB6CNKgb-Tfz_4Fiu8t X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-07_16,2024-10-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 lowpriorityscore=0 adultscore=0 malwarescore=0 phishscore=0 spamscore=0 mlxlogscore=999 clxscore=1015 priorityscore=1501 mlxscore=0 impostorscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410080006 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=148.163.156.1; envelope-from=jrossi@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1728350548509116600 Content-Type: text/plain; charset="utf-8" From: Jared Rossi Currently, structures defined in both hw/s390x/ipl.h and pc-bios/s390-ccw/i= plb.h must be kept in sync, which is prone to error. Instead, create a new direct= ory at include/hw/s390x/ipl/ to contain the definitions that must be shared. Signed-off-by: Jared Rossi Reviewed-by: Thomas Huth --- hw/s390x/ipl.h | 104 +----------------------------- include/hw/s390x/ipl/qipl.h | 123 ++++++++++++++++++++++++++++++++++++ pc-bios/s390-ccw/iplb.h | 84 ++---------------------- pc-bios/s390-ccw/Makefile | 2 +- 4 files changed, 130 insertions(+), 183 deletions(-) create mode 100644 include/hw/s390x/ipl/qipl.h diff --git a/hw/s390x/ipl.h b/hw/s390x/ipl.h index b2105b616a..fa394c339d 100644 --- a/hw/s390x/ipl.h +++ b/hw/s390x/ipl.h @@ -16,95 +16,11 @@ #include "cpu.h" #include "exec/address-spaces.h" #include "hw/qdev-core.h" +#include "hw/s390x/ipl/qipl.h" #include "qom/object.h" =20 -struct IPLBlockPVComp { - uint64_t tweak_pref; - uint64_t addr; - uint64_t size; -} QEMU_PACKED; -typedef struct IPLBlockPVComp IPLBlockPVComp; - -struct IPLBlockPV { - uint8_t reserved18[87]; /* 0x18 */ - uint8_t version; /* 0x6f */ - uint32_t reserved70; /* 0x70 */ - uint32_t num_comp; /* 0x74 */ - uint64_t pv_header_addr; /* 0x78 */ - uint64_t pv_header_len; /* 0x80 */ - struct IPLBlockPVComp components[0]; -} QEMU_PACKED; -typedef struct IPLBlockPV IPLBlockPV; - -struct IplBlockCcw { - uint8_t reserved0[85]; - uint8_t ssid; - uint16_t devno; - uint8_t vm_flags; - uint8_t reserved3[3]; - uint32_t vm_parm_len; - uint8_t nss_name[8]; - uint8_t vm_parm[64]; - uint8_t reserved4[8]; -} QEMU_PACKED; -typedef struct IplBlockCcw IplBlockCcw; - -struct IplBlockFcp { - uint8_t reserved1[305 - 1]; - uint8_t opt; - uint8_t reserved2[3]; - uint16_t reserved3; - uint16_t devno; - uint8_t reserved4[4]; - uint64_t wwpn; - uint64_t lun; - uint32_t bootprog; - uint8_t reserved5[12]; - uint64_t br_lba; - uint32_t scp_data_len; - uint8_t reserved6[260]; - uint8_t scp_data[0]; -} QEMU_PACKED; -typedef struct IplBlockFcp IplBlockFcp; - -struct IplBlockQemuScsi { - uint32_t lun; - uint16_t target; - uint16_t channel; - uint8_t reserved0[77]; - uint8_t ssid; - uint16_t devno; -} QEMU_PACKED; -typedef struct IplBlockQemuScsi IplBlockQemuScsi; - #define DIAG308_FLAGS_LP_VALID 0x80 =20 -union IplParameterBlock { - struct { - uint32_t len; - uint8_t reserved0[3]; - uint8_t version; - uint32_t blk0_len; - uint8_t pbt; - uint8_t flags; - uint16_t reserved01; - uint8_t loadparm[8]; - union { - IplBlockCcw ccw; - IplBlockFcp fcp; - IPLBlockPV pv; - IplBlockQemuScsi scsi; - }; - } QEMU_PACKED; - struct { - uint8_t reserved1[110]; - uint16_t devno; - uint8_t reserved2[88]; - uint8_t reserved_ext[4096 - 200]; - } QEMU_PACKED; -} QEMU_PACKED; -typedef union IplParameterBlock IplParameterBlock; - int s390_ipl_set_loadparm(uint8_t *loadparm); void s390_ipl_update_diag308(IplParameterBlock *iplb); int s390_ipl_prepare_pv_header(Error **errp); @@ -131,24 +47,6 @@ void s390_ipl_clear_reset_request(void); #define QIPL_FLAG_BM_OPTS_CMD 0x80 #define QIPL_FLAG_BM_OPTS_ZIPL 0x40 =20 -/* - * The QEMU IPL Parameters will be stored at absolute address - * 204 (0xcc) which means it is 32-bit word aligned but not - * double-word aligned. Placement of 64-bit data fields in this - * area must account for their alignment needs. - * The total size of the struct must never exceed 28 bytes. - * This definition must be kept in sync with the definition - * in pc-bios/s390-ccw/iplb.h. - */ -struct QemuIplParameters { - uint8_t qipl_flags; - uint8_t reserved1[3]; - uint64_t reserved2; - uint32_t boot_menu_timeout; - uint8_t reserved3[12]; -} QEMU_PACKED; -typedef struct QemuIplParameters QemuIplParameters; - #define TYPE_S390_IPL "s390-ipl" OBJECT_DECLARE_SIMPLE_TYPE(S390IPLState, S390_IPL) =20 diff --git a/include/hw/s390x/ipl/qipl.h b/include/hw/s390x/ipl/qipl.h new file mode 100644 index 0000000000..0ef04af027 --- /dev/null +++ b/include/hw/s390x/ipl/qipl.h @@ -0,0 +1,123 @@ +/* + * S/390 boot structures + * + * Copyright 2024 IBM Corp. + * Author(s): Jared Rossi + * + * This work is licensed under the terms of the GNU GPL, version 2 or (at + * your option) any later version. See the COPYING file in the top-level + * directory. + */ + +#ifndef S390X_QIPL_H +#define S390X_QIPL_H + +/* Boot Menu flags */ +#define QIPL_FLAG_BM_OPTS_CMD 0x80 +#define QIPL_FLAG_BM_OPTS_ZIPL 0x40 + +#define QIPL_ADDRESS 0xcc +#define LOADPARM_LEN 8 + +/* + * The QEMU IPL Parameters will be stored at absolute address + * 204 (0xcc) which means it is 32-bit word aligned but not + * double-word aligned. Placement of 64-bit data fields in this + * area must account for their alignment needs. + * The total size of the struct must never exceed 28 bytes. + */ +struct QemuIplParameters { + uint8_t qipl_flags; + uint8_t reserved1[3]; + uint64_t reserved2; + uint32_t boot_menu_timeout; + uint8_t reserved3[12]; +} QEMU_PACKED; +typedef struct QemuIplParameters QemuIplParameters; + +struct IPLBlockPVComp { + uint64_t tweak_pref; + uint64_t addr; + uint64_t size; +} QEMU_PACKED; +typedef struct IPLBlockPVComp IPLBlockPVComp; + +struct IPLBlockPV { + uint8_t reserved18[87]; /* 0x18 */ + uint8_t version; /* 0x6f */ + uint32_t reserved70; /* 0x70 */ + uint32_t num_comp; /* 0x74 */ + uint64_t pv_header_addr; /* 0x78 */ + uint64_t pv_header_len; /* 0x80 */ + struct IPLBlockPVComp components[0]; +} QEMU_PACKED; +typedef struct IPLBlockPV IPLBlockPV; + +struct IplBlockCcw { + uint8_t reserved0[85]; + uint8_t ssid; + uint16_t devno; + uint8_t vm_flags; + uint8_t reserved3[3]; + uint32_t vm_parm_len; + uint8_t nss_name[8]; + uint8_t vm_parm[64]; + uint8_t reserved4[8]; +} QEMU_PACKED; +typedef struct IplBlockCcw IplBlockCcw; + +struct IplBlockFcp { + uint8_t reserved1[305 - 1]; + uint8_t opt; + uint8_t reserved2[3]; + uint16_t reserved3; + uint16_t devno; + uint8_t reserved4[4]; + uint64_t wwpn; + uint64_t lun; + uint32_t bootprog; + uint8_t reserved5[12]; + uint64_t br_lba; + uint32_t scp_data_len; + uint8_t reserved6[260]; + uint8_t scp_data[0]; +} QEMU_PACKED; +typedef struct IplBlockFcp IplBlockFcp; + +struct IplBlockQemuScsi { + uint32_t lun; + uint16_t target; + uint16_t channel; + uint8_t reserved0[77]; + uint8_t ssid; + uint16_t devno; +} QEMU_PACKED; +typedef struct IplBlockQemuScsi IplBlockQemuScsi; + +union IplParameterBlock { + struct { + uint32_t len; + uint8_t reserved0[3]; + uint8_t version; + uint32_t blk0_len; + uint8_t pbt; + uint8_t flags; + uint16_t reserved01; + uint8_t loadparm[LOADPARM_LEN]; + union { + IplBlockCcw ccw; + IplBlockFcp fcp; + IPLBlockPV pv; + IplBlockQemuScsi scsi; + }; + } QEMU_PACKED; + struct { + uint8_t reserved1[110]; + uint16_t devno; + uint8_t reserved2[88]; + uint8_t reserved_ext[4096 - 200]; + } QEMU_PACKED; +} QEMU_PACKED; +typedef union IplParameterBlock IplParameterBlock; + +#endif diff --git a/pc-bios/s390-ccw/iplb.h b/pc-bios/s390-ccw/iplb.h index 3758698468..16643f5879 100644 --- a/pc-bios/s390-ccw/iplb.h +++ b/pc-bios/s390-ccw/iplb.h @@ -12,88 +12,14 @@ #ifndef IPLB_H #define IPLB_H =20 -#define LOADPARM_LEN 8 +#ifndef QEMU_PACKED +#define QEMU_PACKED __attribute__((packed)) +#endif =20 -struct IplBlockCcw { - uint8_t reserved0[85]; - uint8_t ssid; - uint16_t devno; - uint8_t vm_flags; - uint8_t reserved3[3]; - uint32_t vm_parm_len; - uint8_t nss_name[8]; - uint8_t vm_parm[64]; - uint8_t reserved4[8]; -} __attribute__ ((packed)); -typedef struct IplBlockCcw IplBlockCcw; - -struct IplBlockFcp { - uint8_t reserved1[305 - 1]; - uint8_t opt; - uint8_t reserved2[3]; - uint16_t reserved3; - uint16_t devno; - uint8_t reserved4[4]; - uint64_t wwpn; - uint64_t lun; - uint32_t bootprog; - uint8_t reserved5[12]; - uint64_t br_lba; - uint32_t scp_data_len; - uint8_t reserved6[260]; - uint8_t scp_data[]; -} __attribute__ ((packed)); -typedef struct IplBlockFcp IplBlockFcp; - -struct IplBlockQemuScsi { - uint32_t lun; - uint16_t target; - uint16_t channel; - uint8_t reserved0[77]; - uint8_t ssid; - uint16_t devno; -} __attribute__ ((packed)); -typedef struct IplBlockQemuScsi IplBlockQemuScsi; - -struct IplParameterBlock { - uint32_t len; - uint8_t reserved0[3]; - uint8_t version; - uint32_t blk0_len; - uint8_t pbt; - uint8_t flags; - uint16_t reserved01; - uint8_t loadparm[LOADPARM_LEN]; - union { - IplBlockCcw ccw; - IplBlockFcp fcp; - IplBlockQemuScsi scsi; - }; -} __attribute__ ((packed)); -typedef struct IplParameterBlock IplParameterBlock; - -extern IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE))); - -#define QIPL_ADDRESS 0xcc - -/* Boot Menu flags */ -#define QIPL_FLAG_BM_OPTS_CMD 0x80 -#define QIPL_FLAG_BM_OPTS_ZIPL 0x40 - -/* - * This definition must be kept in sync with the definition - * in hw/s390x/ipl.h - */ -struct QemuIplParameters { - uint8_t qipl_flags; - uint8_t reserved1[3]; - uint64_t reserved2; - uint32_t boot_menu_timeout; - uint8_t reserved3[12]; -} __attribute__ ((packed)); -typedef struct QemuIplParameters QemuIplParameters; +#include =20 extern QemuIplParameters qipl; +extern IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE))); =20 #define S390_IPL_TYPE_FCP 0x00 #define S390_IPL_TYPE_CCW 0x02 diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile index 27cbb354af..db9e8f0892 100644 --- a/pc-bios/s390-ccw/Makefile +++ b/pc-bios/s390-ccw/Makefile @@ -3,7 +3,7 @@ all: build-all @true =20 include config-host.mak -CFLAGS =3D -O2 -g +CFLAGS =3D -O2 -g -I $(SRC_PATH)/../../include/hw/s390x/ipl MAKEFLAGS +=3D -rR =20 GIT_SUBMODULES =3D roms/SLOF --=20 2.45.1 From nobody Sat Nov 23 21:59:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1728350294; cv=none; d=zohomail.com; s=zohoarc; b=KSU7D+G0vN2lxZG34VgQqPttcdSW1rNtY2UGvd0VSmR/kbiAapjS3x+PDeuge+uKc/gIMbFtsfGX8N6dl6yTDir50af7cbSNsUcOHN3U9IfBXvXzH+PFUSRYimfrHmhAqTqUU9dJTaN8inq22sQw6Z3VnUDfmM9mlivRlzPFf9k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728350294; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=DEFEPPwca8cbUrn5c+Sf8o9VCEUuCEQCcf30CbCJe1Y=; b=gk9VXNZ6Qr5eO6d8cwZcDZQVHxQc4q/ElIOF1jn1zO9wlegetlEVUTY0wHapxU4+jVcWTe+UsjiYToVc6gzLYSW1uqbmGVmGhwPz9nlVtl+PLruIOBiWa9Eo5TpgZZOJFRU2l/MsFWSG6D7U13FtiUdsNmRyMsg2azWlxHYeVzw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1728350294299106.89050327928851; Mon, 7 Oct 2024 18:18:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxyq8-0004IN-9p; Mon, 07 Oct 2024 21:16:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypo-00048f-Vt; Mon, 07 Oct 2024 21:16:22 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypn-0008LG-4o; Mon, 07 Oct 2024 21:16:20 -0400 Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 497NvUax029225; Tue, 8 Oct 2024 01:16:18 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424sr4g7hk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:17 +0000 (GMT) Received: from m0360072.ppops.net (m0360072.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4981GH23017715; Tue, 8 Oct 2024 01:16:17 GMT Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424sr4g7he-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:17 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 497LNald022844; Tue, 8 Oct 2024 01:16:16 GMT Received: from smtprelay02.dal12v.mail.ibm.com ([172.16.1.4]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 423h9jsfjq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:16 +0000 Received: from smtpav06.dal12v.mail.ibm.com (smtpav06.dal12v.mail.ibm.com [10.241.53.105]) by smtprelay02.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4981GF4p49676784 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Oct 2024 01:16:15 GMT Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7113958055; Tue, 8 Oct 2024 01:16:15 +0000 (GMT) Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E973058043; Tue, 8 Oct 2024 01:16:14 +0000 (GMT) Received: from localhost.localdomain (unknown [9.61.51.58]) by smtpav06.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 8 Oct 2024 01:16:14 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=pp1; bh=DEFEPPwca8cbU rn5c+Sf8o9VCEUuCEQCcf30CbCJe1Y=; b=JkYLk7ekKyyTFsyuaMqGHXCIN5bKZ ZuDWzVeYKNGxkGJhqbioD1Y7o8igJtBoyKKyrQiPgWiAkdf4jJwKP/+F2dx64xAv y2fdByL9FdZhmuj3rrVxQ4eXlbLpwmWV4yfXIZSFbFgLapKP1mCqVEi9rguGRZDL icuOOG7lCcx4++4SwerGFLtoIASgwx+ENCZ7uZNjQ8+0wsbMDCQSPy0WXuI/omH2 6c0h9gA2oAiv4RfP+H+rjFeW66HEygD6HFIOy2BC8gTu4EvwUPdWkYCJluhy1FLz 3KAZYtrWUVtz/n29JboiOA1S5mU9rueZ+NnVw0R7omq82LTtN4+4U2Seg== From: jrossi@linux.ibm.com To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org, thuth@redhat.com Cc: frankja@linux.ibm.com, jrossi@linux.ibm.com Subject: [PATCH v3 14/19] s390x: Add individual loadparm assignment to CCW device Date: Mon, 7 Oct 2024 21:15:47 -0400 Message-ID: <20241008011552.2645520-15-jrossi@linux.ibm.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241008011552.2645520-1-jrossi@linux.ibm.com> References: <20241008011552.2645520-1-jrossi@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: Fh-BN6dAaSQtFOrmu2wl_VMzVGTrksWL X-Proofpoint-GUID: FpRlehbUfgDSYag91MvHy7TIPUOP-xi6 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-07_16,2024-10-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 bulkscore=0 clxscore=1015 spamscore=0 mlxscore=0 lowpriorityscore=0 phishscore=0 malwarescore=0 suspectscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410080003 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=148.163.158.5; envelope-from=jrossi@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1728350296431116600 Content-Type: text/plain; charset="utf-8" From: Jared Rossi Add a loadparm property to the VirtioCcwDevice object so that different loadparms can be defined on a per-device basis for CCW boot devices. The machine/global loadparm is still supported. If both a global and per-de= vice loadparm are defined, the per-device value will override the global value f= or that device, but any other devices that do not specify a per-device loadparm will still use the global loadparm. It is invalid to assign a loadparm to a non-boot device. Signed-off-by: Jared Rossi Reviewed-by: Thomas Huth --- hw/s390x/ccw-device.h | 2 ++ hw/s390x/ipl.h | 3 +- hw/s390x/ccw-device.c | 46 ++++++++++++++++++++++++++ hw/s390x/ipl.c | 66 +++++++++++++++++++++++--------------- hw/s390x/s390-virtio-ccw.c | 18 +---------- hw/s390x/sclp.c | 3 +- pc-bios/s390-ccw/main.c | 10 ++++-- 7 files changed, 100 insertions(+), 48 deletions(-) diff --git a/hw/s390x/ccw-device.h b/hw/s390x/ccw-device.h index 5feeb0ee7a..1e1737c0f3 100644 --- a/hw/s390x/ccw-device.h +++ b/hw/s390x/ccw-device.h @@ -26,6 +26,8 @@ struct CcwDevice { CssDevId dev_id; /* The actual busid of the virtual subchannel. */ CssDevId subch_id; + /* If set, use this loadparm value when device is boot target */ + uint8_t loadparm[8]; }; typedef struct CcwDevice CcwDevice; =20 diff --git a/hw/s390x/ipl.h b/hw/s390x/ipl.h index fa394c339d..b670bad551 100644 --- a/hw/s390x/ipl.h +++ b/hw/s390x/ipl.h @@ -21,7 +21,8 @@ =20 #define DIAG308_FLAGS_LP_VALID 0x80 =20 -int s390_ipl_set_loadparm(uint8_t *loadparm); +void s390_ipl_convert_loadparm(char *ascii_lp, uint8_t *ebcdic_lp); +void s390_ipl_fmt_loadparm(uint8_t *loadparm, char *str, Error **errp); void s390_ipl_update_diag308(IplParameterBlock *iplb); int s390_ipl_prepare_pv_header(Error **errp); int s390_ipl_pv_unpack(void); diff --git a/hw/s390x/ccw-device.c b/hw/s390x/ccw-device.c index 14c24e3890..230cc09e03 100644 --- a/hw/s390x/ccw-device.c +++ b/hw/s390x/ccw-device.c @@ -13,6 +13,10 @@ #include "ccw-device.h" #include "hw/qdev-properties.h" #include "qemu/module.h" +#include "ipl.h" +#include "qapi/visitor.h" +#include "qemu/ctype.h" +#include "qapi/error.h" =20 static void ccw_device_refill_ids(CcwDevice *dev) { @@ -37,10 +41,52 @@ static bool ccw_device_realize(CcwDevice *dev, Error **= errp) return true; } =20 +static void ccw_device_get_loadparm(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) +{ + CcwDevice *dev =3D CCW_DEVICE(obj); + char *str =3D g_strndup((char *) dev->loadparm, sizeof(dev->loadparm)); + + visit_type_str(v, name, &str, errp); + g_free(str); +} + +static void ccw_device_set_loadparm(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) +{ + CcwDevice *dev =3D CCW_DEVICE(obj); + char *val; + int index; + + index =3D object_property_get_int(obj, "bootindex", NULL); + + if (index < 0) { + error_setg(errp, "LOADPARM is only valid for boot devices!"); + } + + if (!visit_type_str(v, name, &val, errp)) { + return; + } + + s390_ipl_fmt_loadparm(dev->loadparm, val, errp); +} + +static const PropertyInfo ccw_loadparm =3D { + .name =3D "ccw_loadparm", + .description =3D "Up to 8 chars in set of [A-Za-z0-9. ] to pass" + " to the guest loader/kernel", + .get =3D ccw_device_get_loadparm, + .set =3D ccw_device_set_loadparm, +}; + static Property ccw_device_properties[] =3D { DEFINE_PROP_CSS_DEV_ID("devno", CcwDevice, devno), DEFINE_PROP_CSS_DEV_ID_RO("dev_id", CcwDevice, dev_id), DEFINE_PROP_CSS_DEV_ID_RO("subch_id", CcwDevice, subch_id), + DEFINE_PROP("loadparm", CcwDevice, loadparm, ccw_loadparm, + typeof(uint8_t[8])), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c index 8c490eeb52..55a83bb836 100644 --- a/hw/s390x/ipl.c +++ b/hw/s390x/ipl.c @@ -34,6 +34,7 @@ #include "qemu/config-file.h" #include "qemu/cutils.h" #include "qemu/option.h" +#include "qemu/ctype.h" #include "standard-headers/linux/virtio_ids.h" =20 #define KERN_IMAGE_START 0x010000UL @@ -397,12 +398,43 @@ static CcwDevice *s390_get_ccw_device(DeviceState *de= v_st, int *devtype) return ccw_dev; } =20 +void s390_ipl_fmt_loadparm(uint8_t *loadparm, char *str, Error **errp) +{ + int i; + + /* Initialize the loadparm with spaces */ + memset(loadparm, ' ', LOADPARM_LEN); + for (i =3D 0; i < LOADPARM_LEN && str[i]; i++) { + uint8_t c =3D qemu_toupper(str[i]); /* mimic HMC */ + + if (qemu_isalnum(c) || c =3D=3D '.' || c =3D=3D ' ') { + loadparm[i] =3D c; + } else { + error_setg(errp, "LOADPARM: invalid character '%c' (ASCII 0x%0= 2x)", + c, c); + return; + } + } +} + +void s390_ipl_convert_loadparm(char *ascii_lp, uint8_t *ebcdic_lp) +{ + int i; + + /* Initialize the loadparm with EBCDIC spaces (0x40) */ + memset(ebcdic_lp, '@', LOADPARM_LEN); + for (i =3D 0; i < LOADPARM_LEN && ascii_lp[i]; i++) { + ebcdic_lp[i] =3D ascii2ebcdic[(uint8_t) ascii_lp[i]]; + } +} + static bool s390_gen_initial_iplb(S390IPLState *ipl) { DeviceState *dev_st; CcwDevice *ccw_dev =3D NULL; SCSIDevice *sd; int devtype; + uint8_t *lp; =20 dev_st =3D get_boot_device(0); if (dev_st) { @@ -413,6 +445,8 @@ static bool s390_gen_initial_iplb(S390IPLState *ipl) * Currently allow IPL only from CCW devices. */ if (ccw_dev) { + lp =3D ccw_dev->loadparm; + switch (devtype) { case CCW_DEVTYPE_SCSI: sd =3D SCSI_DEVICE(dev_st); @@ -445,40 +479,20 @@ static bool s390_gen_initial_iplb(S390IPLState *ipl) break; } =20 - if (!s390_ipl_set_loadparm(ipl->iplb.loadparm)) { - ipl->iplb.flags |=3D DIAG308_FLAGS_LP_VALID; + /* If the device loadparm is empty use the global machine loadparm= */ + if (memcmp(lp, "\0\0\0\0\0\0\0\0", 8) =3D=3D 0) { + lp =3D S390_CCW_MACHINE(qdev_get_machine())->loadparm; } =20 + s390_ipl_convert_loadparm((char *)lp, ipl->iplb.loadparm); + ipl->iplb.flags |=3D DIAG308_FLAGS_LP_VALID; + return true; } =20 return false; } =20 -int s390_ipl_set_loadparm(uint8_t *loadparm) -{ - MachineState *machine =3D MACHINE(qdev_get_machine()); - char *lp =3D object_property_get_str(OBJECT(machine), "loadparm", NULL= ); - - if (lp) { - int i; - - /* lp is an uppercase string without leading/embedded spaces */ - for (i =3D 0; i < 8 && lp[i]; i++) { - loadparm[i] =3D ascii2ebcdic[(uint8_t) lp[i]]; - } - - if (i < 8) { - memset(loadparm + i, 0x40, 8 - i); /* fill with EBCDIC spaces = */ - } - - g_free(lp); - return 0; - } - - return -1; -} - static bool is_virtio_ccw_device_of_type(IplParameterBlock *iplb, int virtio_id) { diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 529e53f308..fe03f716f3 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -722,28 +722,12 @@ static void machine_set_loadparm(Object *obj, Visitor= *v, { S390CcwMachineState *ms =3D S390_CCW_MACHINE(obj); char *val; - int i; =20 if (!visit_type_str(v, name, &val, errp)) { return; } =20 - for (i =3D 0; i < sizeof(ms->loadparm) && val[i]; i++) { - uint8_t c =3D qemu_toupper(val[i]); /* mimic HMC */ - - if (('A' <=3D c && c <=3D 'Z') || ('0' <=3D c && c <=3D '9') || (c= =3D=3D '.') || - (c =3D=3D ' ')) { - ms->loadparm[i] =3D c; - } else { - error_setg(errp, "LOADPARM: invalid character '%c' (ASCII 0x%0= 2x)", - c, c); - return; - } - } - - for (; i < sizeof(ms->loadparm); i++) { - ms->loadparm[i] =3D ' '; /* pad right with spaces */ - } + s390_ipl_fmt_loadparm(ms->loadparm, val, errp); } =20 static void ccw_machine_class_init(ObjectClass *oc, void *data) diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c index e725dcd5fd..8b2d7a88bd 100644 --- a/hw/s390x/sclp.c +++ b/hw/s390x/sclp.c @@ -175,7 +175,8 @@ static void read_SCP_info(SCLPDevice *sclp, SCCB *sccb) memcpy(&read_info->loadparm, &ipib->loadparm, sizeof(read_info->loadparm)); } else { - s390_ipl_set_loadparm(read_info->loadparm); + s390_ipl_convert_loadparm((char *)S390_CCW_MACHINE(machine)->loadp= arm, + read_info->loadparm); } =20 sccb->h.response_code =3D cpu_to_be16(SCLP_RC_NORMAL_READ_COMPLETION); diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c index f818bd7210..d7c457e0ed 100644 --- a/pc-bios/s390-ccw/main.c +++ b/pc-bios/s390-ccw/main.c @@ -183,8 +183,14 @@ static void css_setup(void) static void boot_setup(void) { char lpmsg[] =3D "LOADPARM=3D[________]\n"; + have_iplb =3D store_iplb(&iplb); + + if (memcmp(iplb.loadparm, "@@@@@@@@", LOADPARM_LEN) !=3D 0) { + ebcdic_to_ascii((char *) iplb.loadparm, loadparm_str, LOADPARM_LEN= ); + } else { + sclp_get_loadparm_ascii(loadparm_str); + } =20 - sclp_get_loadparm_ascii(loadparm_str); memcpy(lpmsg + 10, loadparm_str, 8); puts(lpmsg); =20 @@ -193,8 +199,6 @@ static void boot_setup(void) * so we don't taint our decision-making process during a reboot. */ memset((char *)S390EP, 0, 6); - - have_iplb =3D store_iplb(&iplb); } =20 static bool find_boot_device(void) --=20 2.45.1 From nobody Sat Nov 23 21:59:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1728350335; cv=none; d=zohomail.com; s=zohoarc; b=KUOVs3bZ9oNEVkiQzMKz4cFNEB1pFNU+9P42FxftTxx4QNTMkIorrIrRYGN4iM+YmwENPBE2ma52VHih8bxjR0zhokA/2wV+Nus74sE/X/7dyvUX/SGXyJ4jBSkAubQVRrO2MfoG/QMPlqfD+mf0BjkxrwLVFKi7HdPpyk8+ARo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728350335; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=qvbKGfft7U2kO/sOU+7bLGIa+fNsHtYsZyugYA+8ddo=; b=a9DEiEB/RBwii3lrXAbz1Fl//JSQGnvbNDuBC0AZOi6WtA6+PxrBPp3eRICoKZBdGYHdSlyCFgoWDNRLJVV7MOcQeQvbXk0MR1WFC5fGypmw+4lfKdkx7w8KTnkHrT3IIIxSzJKXSgGueG8YG5xP7bNjFIrTP+9d+PjWOCrBQqw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1728350335113685.2142404809358; Mon, 7 Oct 2024 18:18:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxyq6-0004GF-1l; Mon, 07 Oct 2024 21:16:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypt-00049e-5C; Mon, 07 Oct 2024 21:16:25 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypp-0008M2-Jo; Mon, 07 Oct 2024 21:16:23 -0400 Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4980Odsf001808; Tue, 8 Oct 2024 01:16:20 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424t5tg5e1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:19 +0000 (GMT) Received: from m0360083.ppops.net (m0360083.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4981GJtf001027; Tue, 8 Oct 2024 01:16:19 GMT Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424t5tg5dx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:19 +0000 (GMT) Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 4980vB4Q013838; Tue, 8 Oct 2024 01:16:18 GMT Received: from smtprelay02.wdc07v.mail.ibm.com ([172.16.1.69]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 423fss1r41-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:18 +0000 Received: from smtpav06.dal12v.mail.ibm.com (smtpav06.dal12v.mail.ibm.com [10.241.53.105]) by smtprelay02.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4981GGOY28836368 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Oct 2024 01:16:17 GMT Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9833B58059; Tue, 8 Oct 2024 01:16:16 +0000 (GMT) Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 24AFF5805D; Tue, 8 Oct 2024 01:16:16 +0000 (GMT) Received: from localhost.localdomain (unknown [9.61.51.58]) by smtpav06.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 8 Oct 2024 01:16:16 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=pp1; bh=qvbKGfft7U2kO /sOU+7bLGIa+fNsHtYsZyugYA+8ddo=; b=nqtH/cFLwRz6uioETL0NFOd2vHF1p TALldOqUVj5IvlH/ScPC7RzBnlzAtwDnsyB4G3dAArx75OLKyb75S8NqkrxXlWvB PeBy2S0suGJmrH1P/tlTEk/H90adVmtEyYXkYA2y0u50X9H7z8rFI2xb3lHmSPKS tqTu1CslabOR4WtErM3PHV72P8E9cu93NlXUl96R/HuzIelyx+dFnmopbe1OGIUl CncJltaurzrWsWeHXl0yDQJ0jIfenwwtV89etmMu2aA5EzxWDc7QYr8+X7ZB4Y/A TGJ1+B6A6GetHUJw746+s/YE5Io+E3lkmlzsa1b1JmYTwBuVleOf+jSFg== From: jrossi@linux.ibm.com To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org, thuth@redhat.com Cc: frankja@linux.ibm.com, jrossi@linux.ibm.com Subject: [PATCH v3 15/19] hw/s390x: Build an IPLB for each boot device Date: Mon, 7 Oct 2024 21:15:48 -0400 Message-ID: <20241008011552.2645520-16-jrossi@linux.ibm.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241008011552.2645520-1-jrossi@linux.ibm.com> References: <20241008011552.2645520-1-jrossi@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: aNsOIutThkVku3wvQAsMJm-G_fsLBh0N X-Proofpoint-GUID: l4w2JUqHlmPbPgedcJAnEoCaFs0rfcxu X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-07_16,2024-10-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 mlxscore=0 lowpriorityscore=0 clxscore=1015 mlxlogscore=999 adultscore=0 spamscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410080006 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=148.163.156.1; envelope-from=jrossi@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1728350336579116600 Content-Type: text/plain; charset="utf-8" From: Jared Rossi 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 remaini= ng boot devices is stored in the QIPL global variable for possible later acces= s by the guest during IPL. Signed-off-by: Jared Rossi Reviewed-by: Thomas Huth --- hw/s390x/ipl.h | 1 + include/hw/s390x/ipl/qipl.h | 4 +- hw/s390x/ipl.c | 123 ++++++++++++++++++++++++++++-------- 3 files changed, 99 insertions(+), 29 deletions(-) diff --git a/hw/s390x/ipl.h b/hw/s390x/ipl.h index b670bad551..54eb48fd6e 100644 --- a/hw/s390x/ipl.h +++ b/hw/s390x/ipl.h @@ -20,6 +20,7 @@ #include "qom/object.h" =20 #define DIAG308_FLAGS_LP_VALID 0x80 +#define MAX_BOOT_DEVS 8 /* Max number of devices that may have a bootindex= */ =20 void s390_ipl_convert_loadparm(char *ascii_lp, uint8_t *ebcdic_lp); void s390_ipl_fmt_loadparm(uint8_t *loadparm, char *str, Error **errp); diff --git a/include/hw/s390x/ipl/qipl.h b/include/hw/s390x/ipl/qipl.h index 0ef04af027..e56b181298 100644 --- a/include/hw/s390x/ipl/qipl.h +++ b/include/hw/s390x/ipl/qipl.h @@ -31,7 +31,9 @@ struct QemuIplParameters { uint8_t reserved1[3]; uint64_t reserved2; uint32_t boot_menu_timeout; - uint8_t reserved3[12]; + uint8_t reserved3[2]; + uint16_t chain_len; + uint64_t next_iplb; } QEMU_PACKED; typedef struct QemuIplParameters QemuIplParameters; =20 diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c index 55a83bb836..aec79f41a8 100644 --- a/hw/s390x/ipl.c +++ b/hw/s390x/ipl.c @@ -56,6 +56,13 @@ static bool iplb_extended_needed(void *opaque) return ipl->iplbext_migration; } =20 +/* Place the IPLB chain immediately before the BIOS in memory */ +static uint64_t find_iplb_chain_addr(uint64_t bios_addr, uint16_t count) +{ + return (bios_addr & TARGET_PAGE_MASK) + - (count * sizeof(IplParameterBlock)); +} + static const VMStateDescription vmstate_iplb_extended =3D { .name =3D "ipl/iplb_extended", .version_id =3D 0, @@ -398,6 +405,17 @@ static CcwDevice *s390_get_ccw_device(DeviceState *dev= _st, int *devtype) return ccw_dev; } =20 +static uint64_t s390_ipl_map_iplb_chain(IplParameterBlock *iplb_chain) +{ + S390IPLState *ipl =3D get_ipl_device(); + uint16_t count =3D ipl->qipl.chain_len; + uint64_t len =3D sizeof(IplParameterBlock) * count; + uint64_t chain_addr =3D find_iplb_chain_addr(ipl->bios_start_addr, cou= nt); + + cpu_physical_memory_write(chain_addr, iplb_chain, len); + return chain_addr; +} + void s390_ipl_fmt_loadparm(uint8_t *loadparm, char *str, Error **errp) { int i; @@ -428,54 +446,51 @@ void s390_ipl_convert_loadparm(char *ascii_lp, uint8_= t *ebcdic_lp) } } =20 -static bool s390_gen_initial_iplb(S390IPLState *ipl) +static bool s390_build_iplb(DeviceState *dev_st, IplParameterBlock *iplb) { - DeviceState *dev_st; + S390IPLState *ipl =3D get_ipl_device(); CcwDevice *ccw_dev =3D NULL; SCSIDevice *sd; int devtype; uint8_t *lp; =20 - dev_st =3D get_boot_device(0); - if (dev_st) { - ccw_dev =3D s390_get_ccw_device(dev_st, &devtype); - } - /* * Currently allow IPL only from CCW devices. */ + ccw_dev =3D s390_get_ccw_device(dev_st, &devtype); if (ccw_dev) { lp =3D ccw_dev->loadparm; =20 switch (devtype) { case CCW_DEVTYPE_SCSI: sd =3D SCSI_DEVICE(dev_st); - ipl->iplb.len =3D cpu_to_be32(S390_IPLB_MIN_QEMU_SCSI_LEN); - ipl->iplb.blk0_len =3D + iplb->len =3D cpu_to_be32(S390_IPLB_MIN_QEMU_SCSI_LEN); + iplb->blk0_len =3D cpu_to_be32(S390_IPLB_MIN_QEMU_SCSI_LEN - S390_IPLB_HEADER= _LEN); - ipl->iplb.pbt =3D S390_IPL_TYPE_QEMU_SCSI; - ipl->iplb.scsi.lun =3D cpu_to_be32(sd->lun); - ipl->iplb.scsi.target =3D cpu_to_be16(sd->id); - ipl->iplb.scsi.channel =3D cpu_to_be16(sd->channel); - ipl->iplb.scsi.devno =3D cpu_to_be16(ccw_dev->sch->devno); - ipl->iplb.scsi.ssid =3D ccw_dev->sch->ssid & 3; + iplb->pbt =3D S390_IPL_TYPE_QEMU_SCSI; + iplb->scsi.lun =3D cpu_to_be32(sd->lun); + iplb->scsi.target =3D cpu_to_be16(sd->id); + iplb->scsi.channel =3D cpu_to_be16(sd->channel); + iplb->scsi.devno =3D cpu_to_be16(ccw_dev->sch->devno); + iplb->scsi.ssid =3D ccw_dev->sch->ssid & 3; break; case CCW_DEVTYPE_VFIO: - ipl->iplb.len =3D cpu_to_be32(S390_IPLB_MIN_CCW_LEN); - ipl->iplb.pbt =3D S390_IPL_TYPE_CCW; - ipl->iplb.ccw.devno =3D cpu_to_be16(ccw_dev->sch->devno); - ipl->iplb.ccw.ssid =3D ccw_dev->sch->ssid & 3; + iplb->len =3D cpu_to_be32(S390_IPLB_MIN_CCW_LEN); + iplb->pbt =3D S390_IPL_TYPE_CCW; + iplb->ccw.devno =3D cpu_to_be16(ccw_dev->sch->devno); + iplb->ccw.ssid =3D ccw_dev->sch->ssid & 3; break; case CCW_DEVTYPE_VIRTIO_NET: + /* The S390IPLState netboot is true if ANY IPLB may use netboo= t */ ipl->netboot =3D true; /* Fall through to CCW_DEVTYPE_VIRTIO case */ case CCW_DEVTYPE_VIRTIO: - ipl->iplb.len =3D cpu_to_be32(S390_IPLB_MIN_CCW_LEN); - ipl->iplb.blk0_len =3D + iplb->len =3D cpu_to_be32(S390_IPLB_MIN_CCW_LEN); + iplb->blk0_len =3D cpu_to_be32(S390_IPLB_MIN_CCW_LEN - S390_IPLB_HEADER_LEN); - ipl->iplb.pbt =3D S390_IPL_TYPE_CCW; - ipl->iplb.ccw.devno =3D cpu_to_be16(ccw_dev->sch->devno); - ipl->iplb.ccw.ssid =3D ccw_dev->sch->ssid & 3; + iplb->pbt =3D S390_IPL_TYPE_CCW; + iplb->ccw.devno =3D cpu_to_be16(ccw_dev->sch->devno); + iplb->ccw.ssid =3D ccw_dev->sch->ssid & 3; break; } =20 @@ -484,8 +499,8 @@ static bool s390_gen_initial_iplb(S390IPLState *ipl) lp =3D S390_CCW_MACHINE(qdev_get_machine())->loadparm; } =20 - s390_ipl_convert_loadparm((char *)lp, ipl->iplb.loadparm); - ipl->iplb.flags |=3D DIAG308_FLAGS_LP_VALID; + s390_ipl_convert_loadparm((char *)lp, iplb->loadparm); + iplb->flags |=3D DIAG308_FLAGS_LP_VALID; =20 return true; } @@ -493,6 +508,56 @@ static bool s390_gen_initial_iplb(S390IPLState *ipl) return false; } =20 +static bool s390_init_all_iplbs(S390IPLState *ipl) +{ + int iplb_num =3D 0; + IplParameterBlock iplb_chain[7]; + DeviceState *dev_st =3D get_boot_device(0); + + /* + * Parse the boot devices. Generate an IPLB for only the first boot d= evice + * which will later be set with DIAG308. + */ + if (!dev_st) { + ipl->qipl.chain_len =3D 0; + return false; + } + + iplb_num =3D 1; + s390_build_iplb(dev_st, &ipl->iplb); + + /* Index any fallback boot devices */ + while (get_boot_device(iplb_num)) { + iplb_num++; + } + + if (iplb_num > MAX_BOOT_DEVS) { + warn_report("Excess boot devices defined! %d boot devices found, " + "but only the first %d will be considered.", + iplb_num, MAX_BOOT_DEVS); + + iplb_num =3D MAX_BOOT_DEVS; + } + + ipl->qipl.chain_len =3D iplb_num - 1; + + /* + * Build fallback IPLBs for any boot devices above index 0, up to a + * maximum amount as defined in ipl.h + */ + if (iplb_num > 1) { + /* Start at 1 because the IPLB for boot index 0 is not chained */ + for (int i =3D 1; i < iplb_num; i++) { + dev_st =3D get_boot_device(i); + s390_build_iplb(dev_st, &iplb_chain[i - 1]); + } + + ipl->qipl.next_iplb =3D s390_ipl_map_iplb_chain(iplb_chain); + } + + return iplb_num; +} + static bool is_virtio_ccw_device_of_type(IplParameterBlock *iplb, int virtio_id) { @@ -620,7 +685,7 @@ void s390_ipl_reset_request(CPUState *cs, enum s390_res= et reset_type) * this is the original boot device's SCSI * so restore IPL parameter info from it */ - ipl->iplb_valid =3D s390_gen_initial_iplb(ipl); + ipl->iplb_valid =3D s390_build_iplb(get_boot_device(0), &ipl->= iplb); } } if (reset_type =3D=3D S390_RESET_MODIFIED_CLEAR || @@ -714,7 +779,9 @@ void s390_ipl_prepare_cpu(S390CPU *cpu) if (!ipl->kernel || ipl->iplb_valid) { cpu->env.psw.addr =3D ipl->bios_start_addr; if (!ipl->iplb_valid) { - ipl->iplb_valid =3D s390_gen_initial_iplb(ipl); + ipl->iplb_valid =3D s390_init_all_iplbs(ipl); + } else { + ipl->qipl.chain_len =3D 0; } } s390_ipl_set_boot_menu(ipl); --=20 2.45.1 From nobody Sat Nov 23 21:59:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1728350736; cv=none; d=zohomail.com; s=zohoarc; b=ar6jdNiiKDHoOn1e16oXIWxgs0/Rzo3gjiBZTTKNB3wg+fXL+/RUrwULFgrXhTxQxYcZGacbjWWXFacMjv7YCBj1994Qg7NQaFmFKPVJY+Msx7+KZavrdDbETqMa8jkmvb3k/nccqL7+aCHJ277IFFtooeZ1+76TNHFTsDKwsYU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728350736; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=M/5O55L4D9xLC32wTkb064/Yo3FwLmQOtumJQJUqbXo=; b=c+f7SM+85Js2Dl5qAqLMQf5yRRkJ7Idstqw3VW9oZhCSzljRXECPIBlDfbmJVeXHrrJxn7u/3tRVagsTVoPb90sw6F7g7I1kZ6/EfWOL/ZeiO2P5+ylluSD3qgjHvNY/6ATG5CXK0USB1FUN4uMH+ngvQBe0J7fWuUmJlsAIDrI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1728350736782544.5955131106017; Mon, 7 Oct 2024 18:25:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxyq3-0004Eg-Gu; Mon, 07 Oct 2024 21:16:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypv-0004AJ-1q; Mon, 07 Oct 2024 21:16:28 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypr-0008MF-3c; Mon, 07 Oct 2024 21:16:26 -0400 Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4980OvVv002125; Tue, 8 Oct 2024 01:16:21 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424t5tg5e5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:20 +0000 (GMT) Received: from m0360083.ppops.net (m0360083.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4981GK49001040; Tue, 8 Oct 2024 01:16:20 GMT Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424t5tg5e0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:20 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 497LU5a2022671; Tue, 8 Oct 2024 01:16:19 GMT Received: from smtprelay03.wdc07v.mail.ibm.com ([172.16.1.70]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 423h9jsfjv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:19 +0000 Received: from smtpav06.dal12v.mail.ibm.com (smtpav06.dal12v.mail.ibm.com [10.241.53.105]) by smtprelay03.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4981GHes19727096 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Oct 2024 01:16:18 GMT Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C4D9358055; Tue, 8 Oct 2024 01:16:17 +0000 (GMT) Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4582C58043; Tue, 8 Oct 2024 01:16:17 +0000 (GMT) Received: from localhost.localdomain (unknown [9.61.51.58]) by smtpav06.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 8 Oct 2024 01:16:17 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=pp1; bh=M/5O55L4D9xLC 32wTkb064/Yo3FwLmQOtumJQJUqbXo=; b=DmjG9nQAQmyaDVkwy/J4YdDDldZyV LJGBh6zsozVcxVFvAHSlMacgER7S+qqRkliNdv4vNmNJ8lL6dqTjpD0ffYBY5us1 EdjTYIUKdW7UoT5Bwfs32EP/XygWzigxI3dtJOX3UcsqFXKuoFPEaBGRyukBsM+a 4wqoCKjeSJIoH5gV6Ys2h8kCtBZCaJt22tymJXzc+Gacc9obamg1I6bRAFzknK/2 sj5zr2hgt4gqJaPr4SCZYp6BpCOf2s1snNXqhDfdR8I2KwJgGqkdZnehjkB+M/+I 9Mq08Zvpqq4K5GC6vk9zxa5iLevoy4wwhUrrH2KK5DhntUrv+POpmeGqg== From: jrossi@linux.ibm.com To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org, thuth@redhat.com Cc: frankja@linux.ibm.com, jrossi@linux.ibm.com Subject: [PATCH v3 16/19] s390x: Rebuild IPLB for SCSI device directly from DIAG308 Date: Mon, 7 Oct 2024 21:15:49 -0400 Message-ID: <20241008011552.2645520-17-jrossi@linux.ibm.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241008011552.2645520-1-jrossi@linux.ibm.com> References: <20241008011552.2645520-1-jrossi@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: wt_j9CsqOrungpBblkIk2QiXHORF3hed X-Proofpoint-GUID: CkLm7p3iuTjp1H40OInxvUdO3aX_Fd_R X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-07_16,2024-10-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 mlxscore=0 lowpriorityscore=0 clxscore=1015 mlxlogscore=999 adultscore=0 spamscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410080006 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=148.163.156.1; envelope-from=jrossi@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1728350738887116600 Content-Type: text/plain; charset="utf-8" From: Jared Rossi Because virtio-scsi type devices use a non-architected IPLB pbt code they c= annot be set and stored normally. Instead, the IPLB must be rebuilt during re-ipl. As s390x does not natively support multiple boot devices, the devno field is used to store the position in the boot order for the device. Handling the rebuild as part of DIAG308 removes the need to check the devic= es for invalid IPLBs later in the IPL. Signed-off-by: Jared Rossi --- hw/s390x/ipl.h | 11 ++++-- include/hw/s390x/ipl/qipl.h | 3 +- hw/s390x/ipl.c | 75 +++++++------------------------------ pc-bios/s390-ccw/jump2ipl.c | 11 ++++-- target/s390x/diag.c | 9 ++++- 5 files changed, 39 insertions(+), 70 deletions(-) diff --git a/hw/s390x/ipl.h b/hw/s390x/ipl.h index 54eb48fd6e..aead1d6ae5 100644 --- a/hw/s390x/ipl.h +++ b/hw/s390x/ipl.h @@ -24,6 +24,7 @@ =20 void s390_ipl_convert_loadparm(char *ascii_lp, uint8_t *ebcdic_lp); void s390_ipl_fmt_loadparm(uint8_t *loadparm, char *str, Error **errp); +void s390_rebuild_iplb(uint16_t index, IplParameterBlock *iplb); void s390_ipl_update_diag308(IplParameterBlock *iplb); int s390_ipl_prepare_pv_header(Error **errp); int s390_ipl_pv_unpack(void); @@ -65,7 +66,8 @@ struct S390IPLState { bool enforce_bios; bool iplb_valid; bool iplb_valid_pv; - bool netboot; + bool rebuilt_iplb; + uint16_t iplb_index; /* reset related properties don't have to be migrated or reset */ enum s390_reset reset_type; int reset_cpu_index; @@ -172,11 +174,14 @@ static inline bool iplb_valid_pv(IplParameterBlock *i= plb) =20 static inline bool iplb_valid(IplParameterBlock *iplb) { + uint32_t len =3D be32_to_cpu(iplb->len); + switch (iplb->pbt) { case S390_IPL_TYPE_FCP: - return be32_to_cpu(iplb->len) >=3D S390_IPLB_MIN_FCP_LEN; + return len >=3D S390_IPLB_MIN_FCP_LEN; case S390_IPL_TYPE_CCW: - return be32_to_cpu(iplb->len) >=3D S390_IPLB_MIN_CCW_LEN; + return (len >=3D S390_IPLB_MIN_CCW_LEN); + case S390_IPL_TYPE_QEMU_SCSI: default: return false; } diff --git a/include/hw/s390x/ipl/qipl.h b/include/hw/s390x/ipl/qipl.h index e56b181298..451f3b1684 100644 --- a/include/hw/s390x/ipl/qipl.h +++ b/include/hw/s390x/ipl/qipl.h @@ -28,7 +28,8 @@ */ struct QemuIplParameters { uint8_t qipl_flags; - uint8_t reserved1[3]; + uint8_t index; + uint8_t reserved1[2]; uint64_t reserved2; uint32_t boot_menu_timeout; uint8_t reserved3[2]; diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c index aec79f41a8..50fde05b67 100644 --- a/hw/s390x/ipl.c +++ b/hw/s390x/ipl.c @@ -448,7 +448,6 @@ void s390_ipl_convert_loadparm(char *ascii_lp, uint8_t = *ebcdic_lp) =20 static bool s390_build_iplb(DeviceState *dev_st, IplParameterBlock *iplb) { - S390IPLState *ipl =3D get_ipl_device(); CcwDevice *ccw_dev =3D NULL; SCSIDevice *sd; int devtype; @@ -481,9 +480,6 @@ static bool s390_build_iplb(DeviceState *dev_st, IplPar= ameterBlock *iplb) iplb->ccw.ssid =3D ccw_dev->sch->ssid & 3; break; case CCW_DEVTYPE_VIRTIO_NET: - /* The S390IPLState netboot is true if ANY IPLB may use netboo= t */ - ipl->netboot =3D true; - /* Fall through to CCW_DEVTYPE_VIRTIO case */ case CCW_DEVTYPE_VIRTIO: iplb->len =3D cpu_to_be32(S390_IPLB_MIN_CCW_LEN); iplb->blk0_len =3D @@ -508,6 +504,17 @@ static bool s390_build_iplb(DeviceState *dev_st, IplPa= rameterBlock *iplb) return false; } =20 + +void s390_rebuild_iplb(uint16_t dev_index, IplParameterBlock *iplb) +{ + S390IPLState *ipl =3D get_ipl_device(); + uint16_t index; + index =3D ipl->rebuilt_iplb ? ipl->iplb_index : dev_index; + + ipl->rebuilt_iplb =3D s390_build_iplb(get_boot_device(index), iplb); + ipl->iplb_index =3D index; +} + static bool s390_init_all_iplbs(S390IPLState *ipl) { int iplb_num =3D 0; @@ -558,44 +565,6 @@ static bool s390_init_all_iplbs(S390IPLState *ipl) return iplb_num; } =20 -static bool is_virtio_ccw_device_of_type(IplParameterBlock *iplb, - int virtio_id) -{ - uint8_t cssid; - uint8_t ssid; - uint16_t devno; - uint16_t schid; - SubchDev *sch =3D NULL; - - if (iplb->pbt !=3D S390_IPL_TYPE_CCW) { - return false; - } - - devno =3D be16_to_cpu(iplb->ccw.devno); - ssid =3D iplb->ccw.ssid & 3; - - for (schid =3D 0; schid < MAX_SCHID; schid++) { - for (cssid =3D 0; cssid < MAX_CSSID; cssid++) { - sch =3D css_find_subch(1, cssid, ssid, schid); - - if (sch && sch->devno =3D=3D devno) { - return sch->id.cu_model =3D=3D virtio_id; - } - } - } - return false; -} - -static bool is_virtio_net_device(IplParameterBlock *iplb) -{ - return is_virtio_ccw_device_of_type(iplb, VIRTIO_ID_NET); -} - -static bool is_virtio_scsi_device(IplParameterBlock *iplb) -{ - return is_virtio_ccw_device_of_type(iplb, VIRTIO_ID_SCSI); -} - static void update_machine_ipl_properties(IplParameterBlock *iplb) { Object *machine =3D qdev_get_machine(); @@ -635,7 +604,7 @@ void s390_ipl_update_diag308(IplParameterBlock *iplb) ipl->iplb =3D *iplb; ipl->iplb_valid =3D true; } - ipl->netboot =3D is_virtio_net_device(iplb); + update_machine_ipl_properties(iplb); } =20 @@ -662,32 +631,14 @@ IplParameterBlock *s390_ipl_get_iplb(void) void s390_ipl_reset_request(CPUState *cs, enum s390_reset reset_type) { S390IPLState *ipl =3D get_ipl_device(); - if (reset_type =3D=3D S390_RESET_EXTERNAL || reset_type =3D=3D S390_RE= SET_REIPL) { /* use CPU 0 for full resets */ ipl->reset_cpu_index =3D 0; } else { ipl->reset_cpu_index =3D cs->cpu_index; } - ipl->reset_type =3D reset_type; =20 - if (reset_type =3D=3D S390_RESET_REIPL && - ipl->iplb_valid && - !ipl->netboot && - ipl->iplb.pbt =3D=3D S390_IPL_TYPE_CCW && - is_virtio_scsi_device(&ipl->iplb)) { - CcwDevice *ccw_dev =3D s390_get_ccw_device(get_boot_device(0), NUL= L); - - if (ccw_dev && - cpu_to_be16(ccw_dev->sch->devno) =3D=3D ipl->iplb.ccw.devno && - (ccw_dev->sch->ssid & 3) =3D=3D ipl->iplb.ccw.ssid) { - /* - * this is the original boot device's SCSI - * so restore IPL parameter info from it - */ - ipl->iplb_valid =3D s390_build_iplb(get_boot_device(0), &ipl->= iplb); - } - } + ipl->reset_type =3D reset_type; if (reset_type =3D=3D S390_RESET_MODIFIED_CLEAR || reset_type =3D=3D S390_RESET_LOAD_NORMAL || reset_type =3D=3D S390_RESET_PV) { diff --git a/pc-bios/s390-ccw/jump2ipl.c b/pc-bios/s390-ccw/jump2ipl.c index 92627b56c6..711a69a206 100644 --- a/pc-bios/s390-ccw/jump2ipl.c +++ b/pc-bios/s390-ccw/jump2ipl.c @@ -40,10 +40,15 @@ int jump_to_IPL_code(uint64_t address) write_subsystem_identification(); write_iplb_location(); =20 - /* prevent unknown IPL types in the guest */ + /* + * The IPLB for QEMU SCSI type devices must be rebuilt during re-ipl. = The + * iplb.devno is set to the boot position of the target SCSI device. + */ if (iplb.pbt =3D=3D S390_IPL_TYPE_QEMU_SCSI) { - iplb.pbt =3D S390_IPL_TYPE_CCW; - set_iplb(&iplb); + iplb.devno =3D qipl.index; + if (!set_iplb(&iplb)) { + panic("Failed to set IPLB"); + } } =20 /* diff --git a/target/s390x/diag.c b/target/s390x/diag.c index 27ffd48576..a1fd54ddac 100644 --- a/target/s390x/diag.c +++ b/target/s390x/diag.c @@ -133,7 +133,14 @@ void handle_diag_308(CPUS390XState *env, uint64_t r1, = uint64_t r3, uintptr_t ra) =20 valid =3D subcode =3D=3D DIAG308_PV_SET ? iplb_valid_pv(iplb) : ip= lb_valid(iplb); if (!valid) { - env->regs[r1 + 1] =3D DIAG_308_RC_INVALID; + if (subcode =3D=3D DIAG308_SET && iplb->pbt =3D=3D S390_IPL_TY= PE_QEMU_SCSI) { + s390_rebuild_iplb(iplb->devno, iplb); + s390_ipl_update_diag308(iplb); + env->regs[r1 + 1] =3D DIAG_308_RC_OK; + } else { + env->regs[r1 + 1] =3D DIAG_308_RC_INVALID; + } + goto out; } =20 --=20 2.45.1 From nobody Sat Nov 23 21:59:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1728350791; cv=none; d=zohomail.com; s=zohoarc; b=QPeRtLHozHLE9Ki46z3v/uyYr5LfbK1+adOs1pOcMZbGzCPF9CEXz/p/RBfoC/2hrOpk/yVdUNX1ZdhuzcaUzwujBYVQdQUgFg3YBnH8yAp46kzcefloImfZpzxDB48szeCn8VU8gODkAwn+pzKjm2Dkfj65elw4OBKR0ZTNldg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728350791; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=euZloCm8a9GNEnfWZUg21vqw3h2rtbaczDvWkSYKM/w=; b=Lu2pI+L+YTXyAqzvDZO3DOThIBYDbPbnU+rcWsuEVFt9PkL6p4+LnFaApxglBLJmqW+oX5JZzKSqzPQxh7WRfC+WLETv71h3FxTG+Eb9biLdb7YsYyJOlXsT/aN0j45rK4W7ayFguu/XjnB+G8S/ooFsZEXwSJdWZdHLUXu/BTk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1728350791827986.5720917482394; Mon, 7 Oct 2024 18:26:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxyq3-0004Ec-GI; Mon, 07 Oct 2024 21:16:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypw-0004Ai-Ts; Mon, 07 Oct 2024 21:16:29 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypt-0008MQ-7m; Mon, 07 Oct 2024 21:16:28 -0400 Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4980Oilw001965; Tue, 8 Oct 2024 01:16:22 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424t5tg5e9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:22 +0000 (GMT) Received: from m0360083.ppops.net (m0360083.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4981GLrh001051; Tue, 8 Oct 2024 01:16:21 GMT Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424t5tg5e6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:21 +0000 (GMT) Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 49813fBp013790; Tue, 8 Oct 2024 01:16:20 GMT Received: from smtprelay05.wdc07v.mail.ibm.com ([172.16.1.72]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 423fss1r47-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:20 +0000 Received: from smtpav06.dal12v.mail.ibm.com (smtpav06.dal12v.mail.ibm.com [10.241.53.105]) by smtprelay05.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4981GJMs7340562 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Oct 2024 01:16:19 GMT Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 05BCE58055; Tue, 8 Oct 2024 01:16:19 +0000 (GMT) Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7D08C58043; Tue, 8 Oct 2024 01:16:18 +0000 (GMT) Received: from localhost.localdomain (unknown [9.61.51.58]) by smtpav06.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 8 Oct 2024 01:16:18 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=pp1; bh=euZloCm8a9GNE nfWZUg21vqw3h2rtbaczDvWkSYKM/w=; b=kKIdnzoeWgWbODQgz50+cEVCrdRgA KAA6UM23YB4P8l1K1ZBuYyksgJ8fMU2f8jMcqsa5xyYRICnReopIloJ+gNwjRjAp 24TiqeNQcdz7AilUSyJcQM03NSFT5ax1jo5wVZ6LEQmNcWU+ehq78jOyTbDkh4O6 6uChX4UbWuF/92mAG/Jem5HM6SICvXdHTTBxxt36eBfa3sAGP2vCFJPDWdwoNqGp jcxSEdRDzvNJRlfwn4+e3gHF3i7703p2PVmsQ32eW/wQKDfypCygGdXDwJXHZOQ6 FQ/t9OqpgJyXIXDpXlVfaUJLqEW68fSzohIoKgip/VpDeEq/EjaBP+a+Q== From: jrossi@linux.ibm.com To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org, thuth@redhat.com Cc: frankja@linux.ibm.com, jrossi@linux.ibm.com Subject: [PATCH v3 17/19] pc-bios/s390x: Enable multi-device boot loop Date: Mon, 7 Oct 2024 21:15:50 -0400 Message-ID: <20241008011552.2645520-18-jrossi@linux.ibm.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241008011552.2645520-1-jrossi@linux.ibm.com> References: <20241008011552.2645520-1-jrossi@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: ni67osOLnUd0oGxsjCI28xfB1UeGE7_f X-Proofpoint-GUID: cSwvwVh7_f_h9EELESTof0nsz0yqkxIP X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-07_16,2024-10-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 mlxscore=0 lowpriorityscore=0 clxscore=1015 mlxlogscore=999 adultscore=0 spamscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410080006 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=148.163.156.1; envelope-from=jrossi@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1728350793029116600 Content-Type: text/plain; charset="utf-8" From: Jared Rossi Allow attempts to boot from multiple IPL devices. If the first device fails= to IPL, select the pre-built IPLB for the next device in the boot order and at= tempt to IPL from it. Continue this process until IPL is successful or there are = no devices left to try. Signed-off-by: Jared Rossi pc-bios/s390-ccw/iplb.h | 23 ++++++++++++++++++ pc-bios/s390-ccw/jump2ipl.c | 7 +++--- pc-bios/s390-ccw/main.c | 47 ++++++++++++++++++++++--------------- pc-bios/s390-ccw/netmain.c | 3 ++- 4 files changed, 57 insertions(+), 23 deletions(-) --- pc-bios/s390-ccw/iplb.h | 23 ++++++++++++++++++ pc-bios/s390-ccw/jump2ipl.c | 7 +++--- pc-bios/s390-ccw/main.c | 47 ++++++++++++++++++++++--------------- pc-bios/s390-ccw/netmain.c | 3 ++- 4 files changed, 57 insertions(+), 23 deletions(-) diff --git a/pc-bios/s390-ccw/iplb.h b/pc-bios/s390-ccw/iplb.h index 16643f5879..d58fe71974 100644 --- a/pc-bios/s390-ccw/iplb.h +++ b/pc-bios/s390-ccw/iplb.h @@ -17,6 +17,7 @@ #endif =20 #include +#include =20 extern QemuIplParameters qipl; extern IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE))); @@ -49,4 +50,26 @@ static inline bool set_iplb(IplParameterBlock *iplb) return manage_iplb(iplb, false); } =20 +/* + * The IPL started on the device, but failed in some way. If the IPLB cha= in + * still has more devices left to try, use the next device in order. + */ +static inline bool load_next_iplb(void) +{ + IplParameterBlock *next_iplb; + + if (qipl.chain_len < 1) { + return false; + } + + qipl.index++; + next_iplb =3D (IplParameterBlock *) qipl.next_iplb; + memcpy(&iplb, next_iplb, sizeof(IplParameterBlock)); + + qipl.chain_len--; + qipl.next_iplb =3D qipl.next_iplb + sizeof(IplParameterBlock); + + return true; +} + #endif /* IPLB_H */ diff --git a/pc-bios/s390-ccw/jump2ipl.c b/pc-bios/s390-ccw/jump2ipl.c index 711a69a206..a3e5d55499 100644 --- a/pc-bios/s390-ccw/jump2ipl.c +++ b/pc-bios/s390-ccw/jump2ipl.c @@ -46,9 +46,10 @@ int jump_to_IPL_code(uint64_t address) */ if (iplb.pbt =3D=3D S390_IPL_TYPE_QEMU_SCSI) { iplb.devno =3D qipl.index; - if (!set_iplb(&iplb)) { - panic("Failed to set IPLB"); - } + } + + if (have_iplb && !set_iplb(&iplb)) { + panic("Failed to set IPLB"); } =20 /* diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c index d7c457e0ed..1b05174ace 100644 --- a/pc-bios/s390-ccw/main.c +++ b/pc-bios/s390-ccw/main.c @@ -23,7 +23,7 @@ static SubChannelId blk_schid =3D { .one =3D 1 }; static char loadparm_str[LOADPARM_LEN + 1]; QemuIplParameters qipl; IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE))); -static bool have_iplb; +bool have_iplb; static uint16_t cutype; LowCore *lowcore; /* Yes, this *is* a pointer to address 0 */ =20 @@ -55,6 +55,12 @@ void write_iplb_location(void) } } =20 +static void copy_qipl(void) +{ + QemuIplParameters *early_qipl =3D (QemuIplParameters *)QIPL_ADDRESS; + memcpy(&qipl, early_qipl, sizeof(QemuIplParameters)); +} + unsigned int get_loadparm_index(void) { return atoi(loadparm_str); @@ -152,6 +158,7 @@ static void menu_setup(void) =20 /* If loadparm was set to any other value, then do not enable menu */ if (memcmp(loadparm_str, LOADPARM_EMPTY, LOADPARM_LEN) !=3D 0) { + menu_set_parms(qipl.qipl_flags && ~BOOT_MENU_FLAG_MASK, 0); return; } =20 @@ -183,7 +190,6 @@ static void css_setup(void) static void boot_setup(void) { char lpmsg[] =3D "LOADPARM=3D[________]\n"; - have_iplb =3D store_iplb(&iplb); =20 if (memcmp(iplb.loadparm, "@@@@@@@@", LOADPARM_LEN) !=3D 0) { ebcdic_to_ascii((char *) iplb.loadparm, loadparm_str, LOADPARM_LEN= ); @@ -191,6 +197,10 @@ static void boot_setup(void) sclp_get_loadparm_ascii(loadparm_str); } =20 + if (have_iplb) { + menu_setup(); + } + memcpy(lpmsg + 10, loadparm_str, 8); puts(lpmsg); =20 @@ -208,6 +218,7 @@ static bool find_boot_device(void) =20 switch (iplb.pbt) { case S390_IPL_TYPE_CCW: + vdev->scsi_device_selected =3D false; debug_print_int("device no. ", iplb.ccw.devno); blk_schid.ssid =3D iplb.ccw.ssid & 0x3; debug_print_int("ssid ", blk_schid.ssid); @@ -231,15 +242,8 @@ static bool find_boot_device(void) static int virtio_setup(void) { VDev *vdev =3D virtio_get_device(); - QemuIplParameters *early_qipl =3D (QemuIplParameters *)QIPL_ADDRESS; int ret; =20 - memcpy(&qipl, early_qipl, sizeof(QemuIplParameters)); - - if (have_iplb) { - menu_setup(); - } - switch (vdev->senseid.cu_model) { case VIRTIO_ID_NET: puts("Network boot device detected"); @@ -271,11 +275,9 @@ static void ipl_boot_device(void) dasd_ipl(blk_schid, cutype); break; case CU_TYPE_VIRTIO: - if (virtio_setup()) { - return; /* Only returns in case of errors */ + if (virtio_setup() =3D=3D 0) { + zipl_load(); } - zipl_load(); - break; default: printf("Attempting to boot from unexpected device type 0x%X", cuty= pe); } @@ -298,7 +300,6 @@ static void probe_boot_device(void) } if (ret =3D=3D true) { ipl_boot_device(); /* Only returns if unsuccessful */ - return; } } } @@ -308,14 +309,22 @@ static void probe_boot_device(void) =20 void main(void) { + copy_qipl(); sclp_setup(); css_setup(); - boot_setup(); - if (have_iplb && find_boot_device()) { - ipl_boot_device(); - } else { + have_iplb =3D store_iplb(&iplb); + if (!have_iplb) { probe_boot_device(); } =20 - panic("Failed to IPL. Halting..."); + while (have_iplb) { + boot_setup(); + if (have_iplb && find_boot_device()) { + ipl_boot_device(); + } + have_iplb =3D load_next_iplb(); + } + + panic("No suitable device for IPL. Halting..."); + } diff --git a/pc-bios/s390-ccw/netmain.c b/pc-bios/s390-ccw/netmain.c index 0c2329c752..5e62ea2724 100644 --- a/pc-bios/s390-ccw/netmain.c +++ b/pc-bios/s390-ccw/netmain.c @@ -41,6 +41,7 @@ #define DEFAULT_TFTP_RETRIES 20 =20 extern char _start[]; +extern bool have_iplb; =20 #define KERNEL_ADDR ((void *)0L) #define KERNEL_MAX_SIZE ((long)_start) @@ -478,7 +479,7 @@ static int virtio_setup(void) */ enable_mss_facility(); =20 - if (store_iplb(&iplb)) { + if (have_iplb || store_iplb(&iplb)) { IPL_assert(iplb.pbt =3D=3D S390_IPL_TYPE_CCW, "IPL_TYPE_CCW expect= ed"); dev_no =3D iplb.ccw.devno; debug_print_int("device no. ", dev_no); --=20 2.45.1 From nobody Sat Nov 23 21:59:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1728350634; cv=none; d=zohomail.com; s=zohoarc; b=EK+kX+L8Iw8rLvx+NgMiYDmq+QueCgvBv1sOdQo3gNwyXQUqN0BxF2Y4ojN8SM253KR3d+UQYmF8ryvQvCvBv16g0pVeoNdgEIZe59/k9fT5otfEbTLbbf6LL+gUMPHdiNBAKc1Kz4pKefCk6cmFDv2Qa5s9dTy+KCV5A1wGrgE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728350634; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=kF5dPfxF8Y8gENUt8C3/z/Ntb9QSp63LYS6fH7P+zvM=; b=IVQulrLiH7H6nt5q3WvOCrzeKrKO5MXXfoe1v1bFLF7USy1tZ0APJDeeoDSiRhDuUMkx3B4PeanJhNbGZamSGZ7MRld4+FPUiLJk1b1317DVEC4hSopBoeNIbeo8QWqXviH/CY0KZLXy8TcrNy3W4EmJ1SdhE3XiD9qzqzfBk0M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1728350634074910.1213471980669; Mon, 7 Oct 2024 18:23:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxyq4-0004F3-7e; Mon, 07 Oct 2024 21:16:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypw-0004Ah-Tz; Mon, 07 Oct 2024 21:16:29 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypt-0008Mc-7f; Mon, 07 Oct 2024 21:16:27 -0400 Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 497Nt6Oh026136; Tue, 8 Oct 2024 01:16:23 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424sr4g7hx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:23 +0000 (GMT) Received: from m0360072.ppops.net (m0360072.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4981GMNv017880; Tue, 8 Oct 2024 01:16:22 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424sr4g7hv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:22 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 497NC6u3022840; Tue, 8 Oct 2024 01:16:21 GMT Received: from smtprelay06.wdc07v.mail.ibm.com ([172.16.1.73]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 423jg0s7pm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:21 +0000 Received: from smtpav06.dal12v.mail.ibm.com (smtpav06.dal12v.mail.ibm.com [10.241.53.105]) by smtprelay06.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4981GKPs24969830 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Oct 2024 01:16:20 GMT Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2A1B258043; Tue, 8 Oct 2024 01:16:20 +0000 (GMT) Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A9F7A58055; Tue, 8 Oct 2024 01:16:19 +0000 (GMT) Received: from localhost.localdomain (unknown [9.61.51.58]) by smtpav06.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 8 Oct 2024 01:16:19 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=pp1; bh=kF5dPfxF8Y8gE NUt8C3/z/Ntb9QSp63LYS6fH7P+zvM=; b=SJ57YM0+Zq4P65nknYchi+NtPLa7V MEtt2IQoYsTBR8nlhSTolgiC84OXH4J+dnA1V0nd2/b/MQS5kmWlXtqGu6TzUi1e gCq3QwtP2w900sZAD6SlXWEglw0QwVDTc0P4C93hSLXhn0URiTozj1gdnwILnjqh Dkve3QA2/BlkWPRy9FWzEJzsjl9MukjyredWOtfnr4NA2725x/ocIxxYsUlwK87i fAOAmRrhu6FAYJXQTl4f9TYEwxByqEssQWTizHVzBFqQHPXFUoQso5OnvzqCUtmy 0QpLnf4nbUyE6OKhZev3nahuktUxjLJYRcL0RsjwTKWyZ9n0v7z4VjQmw== From: jrossi@linux.ibm.com To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org, thuth@redhat.com Cc: frankja@linux.ibm.com, jrossi@linux.ibm.com Subject: [PATCH v3 18/19] docs/system: Update documentation for s390x IPL Date: Mon, 7 Oct 2024 21:15:51 -0400 Message-ID: <20241008011552.2645520-19-jrossi@linux.ibm.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241008011552.2645520-1-jrossi@linux.ibm.com> References: <20241008011552.2645520-1-jrossi@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: -uNYwC_waoNLXv66RvApjIu-ukA9TllH X-Proofpoint-GUID: NBP6MlgOsOiYyGrsSHhAmaIWt8UCo5Ol X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-07_16,2024-10-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 bulkscore=0 clxscore=1015 spamscore=0 mlxscore=0 lowpriorityscore=0 phishscore=0 malwarescore=0 suspectscore=0 mlxlogscore=756 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410080003 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=148.163.158.5; envelope-from=jrossi@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1728350634441116600 Content-Type: text/plain; charset="utf-8" From: Jared Rossi Update docs to show that s390x PC BIOS can support more than one boot devic= e. Signed-off-by: Jared Rossi Reviewed-by: Thomas Huth --- docs/system/bootindex.rst | 7 ++++--- docs/system/s390x/bootdevices.rst | 9 ++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/system/bootindex.rst b/docs/system/bootindex.rst index 8b057f812f..988f7b3beb 100644 --- a/docs/system/bootindex.rst +++ b/docs/system/bootindex.rst @@ -49,10 +49,11 @@ Limitations ----------- =20 Some firmware has limitations on which devices can be considered for -booting. For instance, the PC BIOS boot specification allows only one -disk to be bootable. If boot from disk fails for some reason, the BIOS +booting. For instance, the x86 PC BIOS boot specification allows only one +disk to be bootable. If boot from disk fails for some reason, the x86 BIOS won't retry booting from other disk. It can still try to boot from -floppy or net, though. +floppy or net, though. In the case of s390x BIOS, the BIOS will try up to +8 total devices, any number of which may be disks. =20 Sometimes, firmware cannot map the device path QEMU wants firmware to boot from to a boot method. It doesn't happen for devices the firmware diff --git a/docs/system/s390x/bootdevices.rst b/docs/system/s390x/bootdevi= ces.rst index c97efb8fc0..1a1a764c1c 100644 --- a/docs/system/s390x/bootdevices.rst +++ b/docs/system/s390x/bootdevices.rst @@ -6,9 +6,7 @@ Booting with bootindex parameter =20 For classical mainframe guests (i.e. LPAR or z/VM installations), you alwa= ys have to explicitly specify the disk where you want to boot from (or "IPL" = from, -in s390x-speak -- IPL means "Initial Program Load"). In particular, there = can -also be only one boot device according to the architecture specification, = thus -specifying multiple boot devices is not possible (yet). +in s390x-speak -- IPL means "Initial Program Load"). =20 So for booting an s390x guest in QEMU, you should always mark the device where you want to boot from with the ``bootindex`` property, for @@ -17,6 +15,11 @@ example:: qemu-system-s390x -drive if=3Dnone,id=3Ddr1,file=3Dguest.qcow2 \ -device virtio-blk,drive=3Ddr1,bootindex=3D1 =20 +Multiple devices may have a bootindex. The lowest bootindex is assigned to= the +device to IPL first. If the IPL fails for the first, the device with the = second +lowest bootindex will be tried and so on until IPL is successful or there = are no +remaining boot devices to try. + For booting from a CD-ROM ISO image (which needs to include El-Torito boot information in order to be bootable), it is recommended to specify a ``scs= i-cd`` device, for example like this:: --=20 2.45.1 From nobody Sat Nov 23 21:59:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1728350220; cv=none; d=zohomail.com; s=zohoarc; b=OKxa+4VDFp/AoIQIw39Q8wfS1mK0eaBGaR8EdUikJLA+OtXrStwstk9spzaDEibNY8wGQfnMRh7I2yLIu+flu2DFGf16zPbjo937q1mFmWfocd0PVhwI4q/sQNNol/rBQhmMYmtdJwAzkvZ1fJuqDaxwHRUjmIoF4YDotaVTiy0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728350220; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=FDktUuboDI+n1AFaAgMdhRADb14wBWBDQNpa+o9LXrY=; b=A0bEkzf9kU4o7UeDrKTGTRW8OWex0QVwPAxcTvxyXYfITEu2nEBJiH8Sdk5xWS/oEzC4iQpw8o2WMvOWYSs4wJSlgHC8En7hNqJ7AErBnwUDfE8duwVGTUqAap66qf0QnPl1etLp9d8zMMzbC3h8zar/mgsqv5h2J95I7nwVG8M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1728350220147961.0951172138087; Mon, 7 Oct 2024 18:17:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxyq7-0004Gj-3x; Mon, 07 Oct 2024 21:16:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypx-0004Av-EG; Mon, 07 Oct 2024 21:16:30 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypv-0008Mi-3C; Mon, 07 Oct 2024 21:16:29 -0400 Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 497Nt1WY026081; Tue, 8 Oct 2024 01:16:24 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424sr4g7j2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:24 +0000 (GMT) Received: from m0360072.ppops.net (m0360072.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4981GNl5017889; Tue, 8 Oct 2024 01:16:23 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424sr4g7hy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:23 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 497MEwQK010727; Tue, 8 Oct 2024 01:16:23 GMT Received: from smtprelay07.wdc07v.mail.ibm.com ([172.16.1.74]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 423j0j9baw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:23 +0000 Received: from smtpav06.dal12v.mail.ibm.com (smtpav06.dal12v.mail.ibm.com [10.241.53.105]) by smtprelay07.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4981GLOl19005992 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Oct 2024 01:16:21 GMT Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 59F7358055; Tue, 8 Oct 2024 01:16:21 +0000 (GMT) Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D47B158043; Tue, 8 Oct 2024 01:16:20 +0000 (GMT) Received: from localhost.localdomain (unknown [9.61.51.58]) by smtpav06.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 8 Oct 2024 01:16:20 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=pp1; bh=FDktUuboDI+n1 AFaAgMdhRADb14wBWBDQNpa+o9LXrY=; b=R0G/E/PxkHhF4ABDKVpYTakmyhmY5 LfjD01bf7A4Xg1KU4r8lrEbUvEmY7dhcsyZG91Rzk0my1ERHICOMYOLCVJO+4XJL zTti/G5gqhuAo2AVOK1/6/+nQ1G/DpRg1QuC5QKdCFkdQQ7QkG4vWKnjztDIXrba jcHWpJL4FPAMuYWgGM3jHfLV47w4FBWAq4xanVk+LZN0qOAFx8u0kcIm6MO69xU2 RBC1E3IULEMi+YN3yUSml/qAf0m3hFtaYsnQSRy7YDmaVxH0zx8vzhIzoo/bNaMP aJsmKC6wfxnQvCZrcjFzaRkAsU+H5ySgpBtAK4h+AWcYTD+cYyT7mqkXQ== From: jrossi@linux.ibm.com To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org, thuth@redhat.com Cc: frankja@linux.ibm.com, jrossi@linux.ibm.com Subject: [PATCH v3 19/19] tests/qtest: Add s390x boot order tests to cdrom-test.c Date: Mon, 7 Oct 2024 21:15:52 -0400 Message-ID: <20241008011552.2645520-20-jrossi@linux.ibm.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241008011552.2645520-1-jrossi@linux.ibm.com> References: <20241008011552.2645520-1-jrossi@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: YHENZLcXuGpMAR25SlfNgy9wxotmDDAd X-Proofpoint-GUID: 5sC-AWwAksOQLOd6KvIMJjBPhMmU_8A6 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-07_16,2024-10-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 bulkscore=0 clxscore=1015 spamscore=0 mlxscore=0 lowpriorityscore=0 phishscore=0 malwarescore=0 suspectscore=0 mlxlogscore=933 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410080003 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=148.163.158.5; envelope-from=jrossi@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1728350222331116600 Content-Type: text/plain; charset="utf-8" From: Jared Rossi Add two new qtests to verify that a valid IPL device can successfully boot = after failed IPL attempts from one or more invalid devices. cdrom-test/as-fallback-device: Defines the primary boot target as a device = that is invalid for IPL and a second boot target that is valid for IPL. Ensures = that the valid device will be selected after the initial failed IPL. cdrom-test/as-last-option: Defines the maximum number of boot devices (8) where only the final entry in the boot order is valid. Ensures that a valid device will be selected even after multiple failed IPL attempts from both virtio-blk and virtio-scsi device types. Signed-off-by: Jared Rossi --- tests/qtest/cdrom-test.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/qtest/cdrom-test.c b/tests/qtest/cdrom-test.c index 9d72b24e4b..123c067589 100644 --- a/tests/qtest/cdrom-test.c +++ b/tests/qtest/cdrom-test.c @@ -213,6 +213,30 @@ static void add_s390x_tests(void) "-drive driver=3Dnull-co,read-zeroes=3Don,if=3Dnon= e,id=3Dd1 " "-device virtio-blk,drive=3Dd2,bootindex=3D1 " "-drive if=3Dnone,id=3Dd2,media=3Dcdrom,file=3D", = test_cdboot); + qtest_add_data_func("cdrom/boot/as-fallback-device", + "-device virtio-serial -device virtio-scsi " + "-device virtio-blk,drive=3Dd1,bootindex=3D1 " + "-drive driver=3Dnull-co,read-zeroes=3Don,if=3Dnon= e,id=3Dd1 " + "-device virtio-blk,drive=3Dd2,bootindex=3D2 " + "-drive if=3Dnone,id=3Dd2,media=3Dcdrom,file=3D", = test_cdboot); + qtest_add_data_func("cdrom/boot/as-last-option", + "-device virtio-serial -device virtio-scsi " + "-device virtio-blk,drive=3Dd1,bootindex=3D1 " + "-drive driver=3Dnull-co,read-zeroes=3Don,if=3Dnon= e,id=3Dd1 " + "-device virtio-blk,drive=3Dd2,bootindex=3D2 " + "-drive driver=3Dnull-co,read-zeroes=3Don,if=3Dnon= e,id=3Dd2 " + "-device virtio-blk,drive=3Dd3,bootindex=3D3 " + "-drive driver=3Dnull-co,read-zeroes=3Don,if=3Dnon= e,id=3Dd3 " + "-device scsi-hd,drive=3Dd4,bootindex=3D4 " + "-drive driver=3Dnull-co,read-zeroes=3Don,if=3Dnon= e,id=3Dd4 " + "-device scsi-hd,drive=3Dd5,bootindex=3D5 " + "-drive driver=3Dnull-co,read-zeroes=3Don,if=3Dnon= e,id=3Dd5 " + "-device virtio-blk,drive=3Dd6,bootindex=3D6 " + "-drive driver=3Dnull-co,read-zeroes=3Don,if=3Dnon= e,id=3Dd6 " + "-device scsi-hd,drive=3Dd7,bootindex=3D7 " + "-drive driver=3Dnull-co,read-zeroes=3Don,if=3Dnon= e,id=3Dd7 " + "-device virtio-blk,drive=3Dd8,bootindex=3D8 " + "-drive if=3Dnone,id=3Dd8,media=3Dcdrom,file=3D", = test_cdboot); if (qtest_has_device("x-terminal3270")) { qtest_add_data_func("cdrom/boot/without-bootindex", "-device virtio-scsi -device virtio-serial " --=20 2.45.1