From nobody Sat Sep 26 22:15:44 2026 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=1789414552; cv=none; d=zohomail.com; s=zohoarc; b=cAWC0fxA8mU/yVqEpCgJ/iVpP1rYhMn8LxiN+ovT620fVTyNhnBR8B4GwjeLL11QcdvzJ1a1MrMUX4asmBCbUkfTO6QmG2njl3ovkj1DYpaJ7z4t+Hx96uGCjGL8LGiw4WIzQGUeSSv6wItEA+cEilV3OwXEJgFA3O6iUhVD2TE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789414552; 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=w83zkwm/0a2Z6Q4GF2R5NDH6xjXFt0klZ73W3gyuc/8=; b=OC/4bSGMoXaTyuotrKnXmb00qdwFfyqmIZGgL8DGqVvmtVxAVhi/BV1ewCsTM8mUiXsDpDSCuYqftf8YBPt7ngkESKjVcjZZn2I53BgS6QRE/x3o4xAP+aPOhElW/BB43ZY0VGrtzpcu+uv4u+734rQrQQ74z6z0ITYGP+L9yCw= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1789414552692629.5970686210077; Mon, 14 Sep 2026 12:35:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x6CSI-00072o-Lz; Mon, 14 Sep 2026 15:35:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6CS3-0006yI-7j; Mon, 14 Sep 2026 15:34:51 -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 1x6CS0-00046m-MB; Mon, 14 Sep 2026 15:34:50 -0400 Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68EJ1aTk1002278; Mon, 14 Sep 2026 19:34:46 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 4gmxdq3j8u-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 14 Sep 2026 19:34:46 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 68EIoutX2784311; Mon, 14 Sep 2026 19:34:45 GMT Received: from smtprelay02.dal12v.mail.ibm.com ([172.16.1.4]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 4gnkry7kdc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Sep 2026 19:34:45 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (smtpav02.wdc07v.mail.ibm.com [10.39.53.229]) by smtprelay02.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 68EJYi4r15205058 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 14 Sep 2026 19:34:44 GMT Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 12D0A58058; Mon, 14 Sep 2026 19:34:44 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5CCFC58059; Mon, 14 Sep 2026 19:34:42 +0000 (GMT) Received: from fedora-workstation.ibmuc.com (unknown [9.61.78.15]) by smtpav02.wdc07v.mail.ibm.com (Postfix) with ESMTP; Mon, 14 Sep 2026 19:34:42 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=w83zkwm/0a2Z6Q4GF 2R5NDH6xjXFt0klZ73W3gyuc/8=; b=jZKXKHequ3q9RAGDIG8+JU1y/mjwDJ1z6 x2tsH6OoHo/qmJq4IerKwbgqca1o+79VTGByEitIlb7lcOWtCkLWi2N8lRZBe8Eq 8ahxiCUX0VjDB5VLgUSSDBHEIQzL1dsHDSPPQrt87RyHgCSx+sw5h3rfnVNqnrhf pRGrAOo9PCwgrKuTkf7DDR9qOQC/lLL+/NN7ajdyCbBAvSTv4e5bMs9QCV4vtn3b QNjMOMJfh2hLkhzYhq2QsQshzkDzlFD0PDpZgFiBgYgrliSua4jVs4oui7Np4jo4 H+FFQmtsh2yjSfIg3GO/NegmVcAns+s7KYgg0Kvb6OPFM+VPYsrnQ== From: Zhuoying Cai To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org Cc: mst@redhat.com, jrossi@linux.ibm.com, zycai@linux.ibm.com, borntraeger@linux.ibm.com, jjherne@linux.ibm.com, cohuck@redhat.com, farman@linux.ibm.com, mjrosato@linux.ibm.com, pasic@linux.ibm.com, farosas@suse.de, lvivier@redhat.com, pbonzini@redhat.com, jdaley@linux.ibm.com Subject: [PATCH v3 1/8] pc-bios/s390-ccw: Move CCW net setup to virtio-ccw Date: Mon, 14 Sep 2026 15:34:31 -0400 Message-ID: <20260914193438.526407-2-zycai@linux.ibm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260914193438.526407-1-zycai@linux.ibm.com> References: <20260914193438.526407-1-zycai@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE0MDI3OCBTYWx0ZWRfX46ALXrl2JpSr D+Qv+ieZ4k85Qst0q3RB7Ic5Q+ovSPxQlon6IS+KshVF8jPEGu/K33sj9xxv1Gg89posC74e389 i+wDeZoU4PO8Jkr/uxBpao0dv3Ea7ZmvShouUJf+NCusJwB9bPnMyZDvE6cm3abxHVLr886eqqQ ESPditsakPhWd6XGHa0whmg6XlvZ4BQRIn+4olzTc84aD+Jp77T+OCYFsZS49jX5LBcZH7jPeLG 4kPM4rFsnQH3CYs50TMfsmJ6+I/KF92uOoLKz9GLKyGCONfZbyEW1iDLSyJ9yUb8Jy0zortC+y+ Ag8Xow2Ettt4GQ/X93AbLGHYOk9q+FyD9YPMrRQmohvAdtNsMEe2dEhj6rndgVxFTs2OytPAkdW FdofXAa4HIsx1N+36DKFLjcCt2lg1FZBj1rrjAH1le37HAiNIpHt5J7LxQVvyWuy3SFbPQvfGlW 3zQ5zzM2KJMBgG8m5mg== X-Proofpoint-GUID: bIjbG3OmA4iUrIJcOgespCXUmwVSLI5G X-Authority-Analysis: v=2.4 cv=DobDa2/+ c=1 sm=1 tr=0 ts=6aa84c56 cx=c_pps a=aDMHemPKRhS1OARIsFnwRA==:117 a=aDMHemPKRhS1OARIsFnwRA==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=uAbxVGIbfxUO_5tXvNgY:22 a=VnNF1IyMAAAA:8 a=Aak0X9c2SgglYLKd_28A:9 X-Proofpoint-ORIG-GUID: bIjbG3OmA4iUrIJcOgespCXUmwVSLI5G X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE0MDI3OCBTYWx0ZWRfXxEBaPw54H9cg 6HrERiZfmLuvITumj0gtJtK8t/+ppPmkBlQUIGZ5FzuQat7U5PisarCnefphCevanYKbX0lfgcR Qx3Tr7aWT2duMkVZaegY1ulMba/hccI= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-14_03,2026-09-14_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 malwarescore=0 priorityscore=1501 suspectscore=0 impostorscore=0 spamscore=0 clxscore=1015 adultscore=0 bulkscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609140278 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=lists1p.gnu.org; Received-SPF: pass client-ip=148.163.156.1; envelope-from=zycai@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_H4=0.001, RCVD_IN_MSPIKE_WL=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: qemu development 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: 1789414553630158500 Content-Type: text/plain; charset="utf-8" Move CCW-specific virtio_setup() and find_net_dev() to virtio-ccw.c to decouple the generic net boot logic from the CCW transport. Also update the error message on failure to specify "ccw net device". Signed-off-by: Zhuoying Cai Reviewed-by: Jared Rossi Reviewed-by: Jason J. Herne Reviewed-by: Matthew Rosato --- pc-bios/s390-ccw/netmain.c | 67 ++--------------------------------- pc-bios/s390-ccw/virtio-ccw.c | 62 ++++++++++++++++++++++++++++++++ pc-bios/s390-ccw/virtio-ccw.h | 1 + 3 files changed, 66 insertions(+), 64 deletions(-) diff --git a/pc-bios/s390-ccw/netmain.c b/pc-bios/s390-ccw/netmain.c index ccd1c30013..bcb62bf6ca 100644 --- a/pc-bios/s390-ccw/netmain.c +++ b/pc-bios/s390-ccw/netmain.c @@ -35,6 +35,7 @@ #include "s390-ccw.h" #include "cio.h" #include "virtio.h" +#include "virtio-ccw.h" #include "s390-time.h" =20 #define DEFAULT_BOOT_RETRIES 10 @@ -489,68 +490,6 @@ static int net_try_direct_tftp_load(filename_ip_t *fn_= ip) return rc; } =20 -static bool find_net_dev(Schib *schib, int dev_no) -{ - int i, r; - - for (i =3D 0; i < 0x10000; i++) { - net_schid.sch_no =3D i; - r =3D stsch_err(net_schid, schib); - if (r =3D=3D 3 || r =3D=3D -EIO) { - break; - } - if (!schib->pmcw.dnv) { - continue; - } - enable_subchannel(net_schid); - if (!virtio_is_supported(virtio_get_device())) { - continue; - } - if (virtio_get_device_type() !=3D VIRTIO_ID_NET) { - continue; - } - if (dev_no < 0 || schib->pmcw.dev =3D=3D dev_no) { - return true; - } - } - - return false; -} - -static bool virtio_setup(void) -{ - Schib schib; - int ssid; - bool found =3D false; - uint16_t dev_no; - - /* - * We unconditionally enable mss support. In every sane configuration, - * this will succeed; and even if it doesn't, stsch_err() can deal - * with the consequences. - */ - enable_mss_facility(); - - if (have_iplb || store_iplb(iplb)) { - IPL_assert(iplb->pbt =3D=3D S390_IPL_TYPE_CCW, "IPL_TYPE_CCW expec= ted"); - dev_no =3D iplb->ccw.devno; - debug_print_int("device no. ", dev_no); - net_schid.ssid =3D iplb->ccw.ssid & 0x3; - debug_print_int("ssid ", net_schid.ssid); - found =3D find_net_dev(&schib, dev_no); - } else { - for (ssid =3D 0; ssid < 0x3; ssid++) { - net_schid.ssid =3D ssid; - found =3D find_net_dev(&schib, -1); - if (found) { - break; - } - } - } - - return found; -} - int netmain(void) { filename_ip_t fn_ip; @@ -559,8 +498,8 @@ int netmain(void) sclp_setup(); puts("Network boot starting..."); =20 - if (!virtio_setup()) { - puts("No virtio net device found."); + if (!virtio_ccw_net_setup()) { + puts("No valid virtio ccw net device found."); return -1; } =20 diff --git a/pc-bios/s390-ccw/virtio-ccw.c b/pc-bios/s390-ccw/virtio-ccw.c index 5cb2158ed2..5bf67738e4 100644 --- a/pc-bios/s390-ccw/virtio-ccw.c +++ b/pc-bios/s390-ccw/virtio-ccw.c @@ -237,3 +237,65 @@ int virtio_ccw_setup(VDev *vdev) =20 return 0; } + +static bool find_ccw_net_dev(Schib *schib, int dev_no) +{ + int i, r; + + for (i =3D 0; i < 0x10000; i++) { + net_schid.sch_no =3D i; + r =3D stsch_err(net_schid, schib); + if (r =3D=3D 3 || r =3D=3D -EIO) { + break; + } + if (!schib->pmcw.dnv) { + continue; + } + enable_subchannel(net_schid); + if (!virtio_is_supported(virtio_get_device())) { + continue; + } + if (virtio_get_device_type() !=3D VIRTIO_ID_NET) { + continue; + } + if (dev_no < 0 || schib->pmcw.dev =3D=3D dev_no) { + return true; + } + } + + return false; +} + +bool virtio_ccw_net_setup(void) +{ + Schib schib; + int ssid; + bool found =3D false; + uint16_t dev_no; + + /* + * We unconditionally enable mss support. In every sane configuration, + * this will succeed; and even if it doesn't, stsch_err() can deal + * with the consequences. + */ + enable_mss_facility(); + + if (have_iplb || store_iplb(iplb)) { + IPL_assert(iplb->pbt =3D=3D S390_IPL_TYPE_CCW, "IPL_TYPE_CCW expec= ted"); + dev_no =3D iplb->ccw.devno; + debug_print_int("device no. ", dev_no); + net_schid.ssid =3D iplb->ccw.ssid & 0x3; + debug_print_int("ssid ", net_schid.ssid); + found =3D find_ccw_net_dev(&schib, dev_no); + } else { + for (ssid =3D 0; ssid < 0x3; ssid++) { + net_schid.ssid =3D ssid; + found =3D find_ccw_net_dev(&schib, -1); + if (found) { + break; + } + } + } + + return found; +} diff --git a/pc-bios/s390-ccw/virtio-ccw.h b/pc-bios/s390-ccw/virtio-ccw.h index a506767eaa..c330e02f99 100644 --- a/pc-bios/s390-ccw/virtio-ccw.h +++ b/pc-bios/s390-ccw/virtio-ccw.h @@ -20,5 +20,6 @@ int virtio_ccw_run(VDev *vdev, int vqid, VirtioCmd *cmd); long virtio_ccw_notify(SubChannelId schid, int vq_idx, long cookie); int virtio_ccw_setup(VDev *vdev); int virtio_ccw_reset(VDev *vdev); +bool virtio_ccw_net_setup(void); =20 #endif --=20 2.55.0 From nobody Sat Sep 26 22:15:44 2026 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=1789414552; cv=none; d=zohomail.com; s=zohoarc; b=IiJyba96YwunNrxX9fQNHtnsPWkkIgkc/rV8NMVJ+HX7/CgM+ElbEFhxIzfz3T/1siq09Y9wC7L5pxbRlPNN2qKes9KUnGX1o6KkheArEbsHZ9Qbleo4mmsSOH3cploxFWEMuLcom4hpAw46PQpubuYYHOCWZKyaZCjPqKfCCyk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789414552; 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=0ipHUG+aENh9ykJZCQoW5mB2rbgFXlUWCWrTNWYqfZM=; b=C+4cInqVY81VZyB3gwoc1peDtsTkWvLtuj3dfPItfUBhaPrvKaqPrPDzrdQUBO00XUrQlIF3PHoce8UtYg0pFdMhculBU7VVZd20F82MupkHrU9W7sJEVXmFlhx/P1qiyynpweKK3ozQGFjtuD4KQX9cdaQx7wNwnxLagE3b7F4= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1789414552073195.45531355880155; Mon, 14 Sep 2026 12:35:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x6CSW-0007E3-9u; Mon, 14 Sep 2026 15:35:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6CS4-0006yc-UN; Mon, 14 Sep 2026 15:34:53 -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 1x6CS1-00048e-Qh; Mon, 14 Sep 2026 15:34:52 -0400 Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68EJ1Ygb2739069; Mon, 14 Sep 2026 19:34:48 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 4gmv5hkp50-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 14 Sep 2026 19:34:48 +0000 (GMT) Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 68EIokXB2729126; Mon, 14 Sep 2026 19:34:47 GMT Received: from smtprelay04.dal12v.mail.ibm.com ([172.16.1.6]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4gnj2jyvuc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Sep 2026 19:34:47 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (smtpav02.wdc07v.mail.ibm.com [10.39.53.229]) by smtprelay04.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 68EJYkQF22020618 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 14 Sep 2026 19:34:46 GMT Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1936F58059; Mon, 14 Sep 2026 19:34:46 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3F2BA5805B; Mon, 14 Sep 2026 19:34:44 +0000 (GMT) Received: from fedora-workstation.ibmuc.com (unknown [9.61.78.15]) by smtpav02.wdc07v.mail.ibm.com (Postfix) with ESMTP; Mon, 14 Sep 2026 19:34:44 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=0ipHUG+aENh9ykJZC QoW5mB2rbgFXlUWCWrTNWYqfZM=; b=jCaRYsgGHKcJfCa0s1PuJI9FAPPXpu5Oo Po3xljF2/xwvANqkZrMwD2i6CFtKsgHeaiHbjQZOU6P6/+zmvBtMBRvSyr547Sfr 8+SHYrvvIuis5uSTmRQewJPj10D64cSRjSNpv7J2qnd9tC76yEZRXZIswrXqCO97 APZg9tpoD+cdZK9OoVhOoxosbfI2CgpNmelBJ+t00Hgrs4p1ibipxB/PNIWmLvAh Uph9ig3R+hbYbiJicMwLJMcGaadROBraa/jH+vPUWMAyFafoTkvrwFZSqCXK0lB0 PkeTwG5bput17s0ffJEqPswaHOmwTbpNBAYCqdCE23jk54Z8tZsVA== From: Zhuoying Cai To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org Cc: mst@redhat.com, jrossi@linux.ibm.com, zycai@linux.ibm.com, borntraeger@linux.ibm.com, jjherne@linux.ibm.com, cohuck@redhat.com, farman@linux.ibm.com, mjrosato@linux.ibm.com, pasic@linux.ibm.com, farosas@suse.de, lvivier@redhat.com, pbonzini@redhat.com, jdaley@linux.ibm.com Subject: [PATCH v3 2/8] pc-bios/s390-ccw: Add dynamic net header size handling Date: Mon, 14 Sep 2026 15:34:32 -0400 Message-ID: <20260914193438.526407-3-zycai@linux.ibm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260914193438.526407-1-zycai@linux.ibm.com> References: <20260914193438.526407-1-zycai@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE0MDI3OCBTYWx0ZWRfXx5nGbIcKhykH YXAozYWvCxoGdwYyBApMoIeBSwwPO21sn06JnVZTFkZVaZvmeC4vNS50VSZHbnFeKh+QpDLTIw0 wUkk2p32UERUkT/r5J11t5RRNX4WO52iIgKg6ZvsQDhSgRViyIt5NCYUuYz+Lwrw/wyDnbEMFm7 TvGHgVddSbno1rpCiPxMP/Ipn9oy3XSF0dhaOwA9jq9gWByGam0V2O0hQulUzA27YUIzCnObG+b N0+eqf1IYze6bo/4AuTKghKI2sCVx9q85xi/VGsFU/rXp73uJf0WyRaJokWOJ0d6aBfxlY4TDGJ hMuhz4p3PtbN+QEtljDijLZZ7gVB5e0SNtMnhVi1W6wwSgjHuidn/nxNIbQkYok0A6b6zmfq5Ay EBPIcwzJETQg4XkRZVYawJB/azONrDWCDj/YyVsg71sB6JxMe6z6QvTQ9dZ/Mx45ACh84eOteGB TmPrGa0c6U2+alv+vtw== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE0MDI3OCBTYWx0ZWRfX5dhSsK+S8TVC QF1LjcVLuwBWWBREBubdgTm4z1Iccq1tjjBW/3E941Nq3oDYryXiBzZRpNBp2vryN/CcAOJswLR sQ0rJrPcCWHClIxEWI9Q/dB5YNp66Ok= X-Authority-Analysis: v=2.4 cv=Zsx4uN7G c=1 sm=1 tr=0 ts=6aa84c58 cx=c_pps a=GFwsV6G8L6GxiO2Y/PsHdQ==:117 a=GFwsV6G8L6GxiO2Y/PsHdQ==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=Y2IxJ9c9Rs8Kov3niI8_:22 a=VnNF1IyMAAAA:8 a=b71jbalOAXEqY8vE3Q8A:9 X-Proofpoint-ORIG-GUID: XULnkh8LF7D1lkigL6IBPC4mrn87R46k X-Proofpoint-GUID: XULnkh8LF7D1lkigL6IBPC4mrn87R46k X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-14_03,2026-09-14_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 impostorscore=0 clxscore=1015 priorityscore=1501 lowpriorityscore=0 bulkscore=0 adultscore=0 phishscore=0 spamscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609140278 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=lists1p.gnu.org; Received-SPF: pass client-ip=148.163.158.5; envelope-from=zycai@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, 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: qemu development 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: 1789414553636158500 Content-Type: text/plain; charset="utf-8" The virtio-net device used a fixed header size that did not account for the num_buffers field used in VirtIO 1.0. Use dynamic header sizing: 10 bytes for legacy mode and 12 bytes for VirtIO 1.0. This ensures correct packet handling across different VirtIO configurations. The VirtioNetHdr and VirtioNetHdrMrgRxbuf structures replicate the same field layout as struct virtio_net_hdr and struct virtio_net_hdr_mrg_rxbuf defined in inux/uapi/linux/virtio_net.h. Signed-off-by: Zhuoying Cai Acked-by: Christian Borntraeger Reviewed-by: Jared Rossi Reviewed-by: Matthew Rosato --- pc-bios/s390-ccw/virtio-net.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/pc-bios/s390-ccw/virtio-net.c b/pc-bios/s390-ccw/virtio-net.c index f58f7ffc55..ffdf7ba831 100644 --- a/pc-bios/s390-ccw/virtio-net.c +++ b/pc-bios/s390-ccw/virtio-net.c @@ -20,6 +20,7 @@ #include "s390-ccw.h" #include "virtio.h" #include "virtio-ccw.h" +#include "virtio-pci.h" #include "s390-time.h" #include "helper.h" =20 @@ -43,7 +44,18 @@ struct VirtioNetHdr { }; typedef struct VirtioNetHdr VirtioNetHdr; =20 +struct VirtioNetHdrMrgRxbuf { + struct VirtioNetHdr hdr; + uint16_t num_buffers; /* Only with VIRTIO_NET_F_MRG_RXBUF or VIRTIO1 */ +}; +typedef struct VirtioNetHdrMrgRxbuf VirtioNetHdrMrgRxbuf; + +/* Header sizes for different modes */ +#define VIRTIO_NET_HDR_SIZE_LEGACY sizeof(VirtioNetHdr) +#define VIRTIO_NET_HDR_SIZE_V1 sizeof(VirtioNetHdrMrgRxbuf) + static uint16_t rx_last_idx; /* Last index in receive queue "used" ring */ +static int virtio_net_hdr_size; =20 int virtio_net_init(void *mac_addr) { @@ -62,12 +74,16 @@ int virtio_net_init(void *mac_addr) return -1; } =20 + virtio_net_hdr_size =3D vdev->guest_features[1] & VIRTIO_F_VERSION_1 + ? VIRTIO_NET_HDR_SIZE_V1 + : VIRTIO_NET_HDR_SIZE_LEGACY; + memcpy(mac_addr, vdev->config.net.mac, ETH_ALEN); =20 for (i =3D 0; i < 64; i++) { - buf =3D malloc(ETH_MTU_SIZE + sizeof(VirtioNetHdr)); + buf =3D malloc(ETH_MTU_SIZE + virtio_net_hdr_size); IPL_assert(buf !=3D NULL, "Can not allocate memory for receive buf= fers"); - vring_send_buf(rxvq, buf, ETH_MTU_SIZE + sizeof(VirtioNetHdr), + vring_send_buf(rxvq, buf, ETH_MTU_SIZE + virtio_net_hdr_size, VRING_DESC_F_WRITE); } vring_notify(rxvq); @@ -77,14 +93,14 @@ int virtio_net_init(void *mac_addr) =20 int send(int fd, const void *buf, int len, int flags) { - VirtioNetHdr tx_hdr; + VirtioNetHdrMrgRxbuf tx_hdr; VDev *vdev =3D virtio_get_device(); VRing *txvq =3D &vdev->vrings[VQ_TX]; =20 /* Set up header - we do not use anything special, so simply clear it = */ memset(&tx_hdr, 0, sizeof(tx_hdr)); =20 - vring_send_buf(txvq, &tx_hdr, sizeof(tx_hdr), VRING_DESC_F_NEXT); + vring_send_buf(txvq, &tx_hdr, virtio_net_hdr_size, VRING_DESC_F_NEXT); vring_send_buf(txvq, (void *)buf, len, VRING_HIDDEN_IS_CHAIN); while (!vr_poll(txvq)) { yield(); @@ -108,13 +124,13 @@ int recv(int fd, void *buf, int maxlen, int flags) return 0; } =20 - len =3D rxvq->used->ring[rx_last_idx % rxvq->num].len - sizeof(VirtioN= etHdr); + len =3D rxvq->used->ring[rx_last_idx % rxvq->num].len - virtio_net_hdr= _size; if (len > maxlen) { puts("virtio-net: Receive buffer too small"); len =3D maxlen; } id =3D rxvq->used->ring[rx_last_idx % rxvq->num].id % rxvq->num; - pkt =3D (uint8_t *)(rxvq->desc[id].addr + sizeof(VirtioNetHdr)); + pkt =3D (uint8_t *)(rxvq->desc[id].addr + virtio_net_hdr_size); =20 #if DEBUG_VIRTIO_NET /* Dump packet */ int i; --=20 2.55.0 From nobody Sat Sep 26 22:15:44 2026 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=1789414552; cv=none; d=zohomail.com; s=zohoarc; b=cXDcQESsHmJvoPwHRWVDvR6PH6m9npnEcmVusQQD/5xY0b1RkI8stiXeCCmlpiPd7U2jETF7nqpg95B5kDedG2uI4TbzHGzbH7xBGuMWe1aNiRN+uvzmgMmQ1PYHNIj+bTcEdsnYeYIUIXHRwe0vHQMHv9iZmzSadauEPj8TMO4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789414552; 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=MrWYKamixOVjBBCyBhcQU7l3Uq1Jwcjozg+vZsvAefU=; b=Jt75Ehw3bbp7R/ILZG1azqNQBYD65jEiKMSGI/SFTYhcRuDl8f8j2VGF0OxoKjKXt6hO617d+dA7HX4sI2JpdUXLeUBigrAmMgOmfWruI/uMCd/AxAI4J1xjYENzxd2U/6wMUP70WPdbPf9DR+5RSlW8jcnsB4AFYQeIxLcApZ8= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178941455220931.974737274565996; Mon, 14 Sep 2026 12:35:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x6CSW-0007Db-7E; Mon, 14 Sep 2026 15:35:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6CS9-000702-DW; Mon, 14 Sep 2026 15:34:59 -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 1x6CS4-00049r-Vl; Mon, 14 Sep 2026 15:34:57 -0400 Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68EJ1jtV2881717; Mon, 14 Sep 2026 19:34:50 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 4gmx83km2u-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 14 Sep 2026 19:34:49 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 68EIoutY2784311; Mon, 14 Sep 2026 19:34:48 GMT Received: from smtprelay05.dal12v.mail.ibm.com ([172.16.1.7]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 4gnkry7kdg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Sep 2026 19:34:48 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (smtpav02.wdc07v.mail.ibm.com [10.39.53.229]) by smtprelay05.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 68EJYl4W24576626 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 14 Sep 2026 19:34:48 GMT Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BDDE458058; Mon, 14 Sep 2026 19:34:47 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 48BB75805C; Mon, 14 Sep 2026 19:34:46 +0000 (GMT) Received: from fedora-workstation.ibmuc.com (unknown [9.61.78.15]) by smtpav02.wdc07v.mail.ibm.com (Postfix) with ESMTP; Mon, 14 Sep 2026 19:34:46 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=MrWYKamixOVjBBCyB hcQU7l3Uq1Jwcjozg+vZsvAefU=; b=FjWE8VQrQcKJQZU2xc+t0rydSvBh8GmAS Yx4/vFYMIfy0NrU7Ir5tINe228UIBL6XcVWngow6KXscDo3DcliwHJCPWXE0egKi 6Cr0NuZdDYvzuLFVxgGmd4a287eTSQAGM3GEO8PXFHXAAL0dArSAsp+RSzNKaAKZ 1DcELnnf/SE/9yDHx9sfTObf2Resh46TRUNGXucqyY059uqIuHpFC4Ved5M8AF1Y NaNcPWs9jEajFGg4jJ0efG+aQs6wk8GDDW9oOQCH5s6iFAoPEQCOdVW0Igg8pzLL jMwkGhhUHBQQbRmDCrv3OfwBi7BMwmlT3wNykD23ZxmN5Cv0sxgOA== From: Zhuoying Cai To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org Cc: mst@redhat.com, jrossi@linux.ibm.com, zycai@linux.ibm.com, borntraeger@linux.ibm.com, jjherne@linux.ibm.com, cohuck@redhat.com, farman@linux.ibm.com, mjrosato@linux.ibm.com, pasic@linux.ibm.com, farosas@suse.de, lvivier@redhat.com, pbonzini@redhat.com, jdaley@linux.ibm.com Subject: [PATCH v3 3/8] pc-bios/s390-ccw: Introduce virtio_tswap helpers Date: Mon, 14 Sep 2026 15:34:33 -0400 Message-ID: <20260914193438.526407-4-zycai@linux.ibm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260914193438.526407-1-zycai@linux.ibm.com> References: <20260914193438.526407-1-zycai@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE0MDI3OCBTYWx0ZWRfX1i9D0h2Rx9qo P3X5QDAoiS4JMf9GEHBQp4Y+fyb8MmvZVRJ9awXgDPB1rLl/CyEIgknPmH27dqBe+ew+tvFEaRd hKIlhXw39CGA0cGxrvB6a2nf+FZ7WSL3VDc0pstQEU5ylxh4HsL+L7UJrn3r3Pm2L2d/7gqnpmV YHVvXON6/13NnFuV+eWXA5bF+QruK0TjA8ScCB8+HYwblN3yQ3ta1j7gezjAY3SzMxgnKqQque2 Q22BY3DtEdFcB4lh7Lh75hU3CZhynAmK+78ts/KBhonvBbxHDsDD2TXMsEMj75E/CzKPq0goG7R vHC8Zf1Q6OMF5RAiHxEEvcPG4eO8GUO4nwTnETYy5nO9JXwiAji9VQJnywIS7Po89XcBwV/r+aD cLLLeDD0KhpRv1aPDq1iLuKnNlF3pudDpTncwSBMpHwbDxTmsctkLSocfZEHbr/BXKIcfPyqHlf cOkwQ3MOnEYV6ZQwpgA== X-Proofpoint-ORIG-GUID: P_V-QEAMWYLzRTWPjM0anYUcHfmIx3K3 X-Proofpoint-GUID: P_V-QEAMWYLzRTWPjM0anYUcHfmIx3K3 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE0MDI3OCBTYWx0ZWRfXytg44Pthp1df nP1cRSaAypRUgZ/0cxN8cxvQNAZZITX8tj9gk+jBBvVw/aChEn7EQAHV8sSMXl90dXLKfMyhYWM zeK52nmx8igvPRMNv1iUyIOVXO78CKU= X-Authority-Analysis: v=2.4 cv=cY9HPXDM c=1 sm=1 tr=0 ts=6aa84c59 cx=c_pps a=aDMHemPKRhS1OARIsFnwRA==:117 a=aDMHemPKRhS1OARIsFnwRA==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=iQ6ETzBq9ecOQQE5vZCe:22 a=VnNF1IyMAAAA:8 a=nmTm2IjeaI_QYA0BkewA:9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-14_03,2026-09-14_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 spamscore=0 bulkscore=0 clxscore=1015 suspectscore=0 impostorscore=0 malwarescore=0 phishscore=0 adultscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609140278 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=lists1p.gnu.org; Received-SPF: pass client-ip=148.163.156.1; envelope-from=zycai@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_H4=0.001, RCVD_IN_MSPIKE_WL=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: qemu development 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: 1789414553628158500 Content-Type: text/plain; charset="utf-8" Replace the repeated pattern: be_ipl() ? x : bswapN(x) with helpers that conditionally byte-swap based on the virtio transport endianness. While only the 16-bit helper is used immediately, the 32-bit and 64-bit variants are added here for later use. Signed-off-by: Zhuoying Cai Reviewed-by: Jared Rossi Reviewed-by: Jason J. Herne Reviewed-by: Matthew Rosato --- pc-bios/s390-ccw/virtio.c | 27 +++++++++++++++++++++------ pc-bios/s390-ccw/virtio.h | 4 ++++ 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c index a0d249db24..037c00a3e1 100644 --- a/pc-bios/s390-ccw/virtio.c +++ b/pc-bios/s390-ccw/virtio.c @@ -97,7 +97,7 @@ void vring_init(VRing *vr, VqInfo *info) vr->avail->idx =3D 0; =20 /* We're running with interrupts off anyways, so don't bother */ - vr->used->flags =3D be_ipl() ? VRING_USED_F_NO_NOTIFY : bswap16(VRING_= USED_F_NO_NOTIFY); + vr->used->flags =3D virtio_tswap16(VRING_USED_F_NO_NOTIFY); vr->used->idx =3D 0; vr->used_idx =3D 0; vr->next_idx =3D 0; @@ -140,6 +140,22 @@ bool be_ipl(void) } } =20 +/* Conditionally byte-swap between virtio-endian and s390x native big-endi= an. */ +uint16_t virtio_tswap16(uint16_t x) +{ + return be_ipl() ? x : bswap16(x); +} + +uint32_t virtio_tswap32(uint32_t x) +{ + return be_ipl() ? x : bswap32(x); +} + +uint64_t virtio_tswap64(uint64_t x) +{ + return be_ipl() ? x : bswap64(x); +} + /* * Format the virtio ring descriptor endianness * Return the available index increment in the appropriate endianness @@ -156,12 +172,11 @@ void vring_send_buf(VRing *vr, void *p, int len, int = flags) { uint16_t avail_idx; =20 - avail_idx =3D be_ipl() ? vr->avail->idx : bswap16(vr->avail->idx); + avail_idx =3D virtio_tswap16(vr->avail->idx); =20 /* For follow-up chains we need to keep the first entry point */ if (!(flags & VRING_HIDDEN_IS_CHAIN)) { - vr->avail->ring[avail_idx % vr->num] =3D be_ipl() ? vr->next_idx : - bswap16(vr->next= _idx); + vr->avail->ring[avail_idx % vr->num] =3D virtio_tswap16(vr->next_i= dx); } =20 vr->desc[vr->next_idx].addr =3D (unsigned long)p; @@ -179,7 +194,7 @@ void vring_send_buf(VRing *vr, void *p, int len, int fl= ags) /* Chains only have a single ID */ if (!(flags & VRING_DESC_F_NEXT)) { avail_idx++; - vr->avail->idx =3D be_ipl() ? avail_idx : bswap16(avail_idx); + vr->avail->idx =3D virtio_tswap16(avail_idx); } } =20 @@ -187,7 +202,7 @@ int vr_poll(VRing *vr) { uint16_t used_idx; =20 - used_idx =3D be_ipl() ? vr->used->idx : bswap16(vr->used->idx); + used_idx =3D virtio_tswap16(vr->used->idx); if (used_idx =3D=3D vr->used_idx) { vring_notify(vr); yield(); diff --git a/pc-bios/s390-ccw/virtio.h b/pc-bios/s390-ccw/virtio.h index aa307025e0..645dc288b1 100644 --- a/pc-bios/s390-ccw/virtio.h +++ b/pc-bios/s390-ccw/virtio.h @@ -287,6 +287,10 @@ int virtio_run(VDev *vdev, int vqid, VirtioCmd *cmd); int virtio_reset(VDev *vdev); int virtio_setup_ccw(VDev *vdev); =20 +uint16_t virtio_tswap16(uint16_t x); +uint32_t virtio_tswap32(uint32_t x); +uint64_t virtio_tswap64(uint64_t x); + /* virtio-net.c */ int virtio_net_init(void *mac_addr); void virtio_net_deinit(void); --=20 2.55.0 From nobody Sat Sep 26 22:15:44 2026 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=1789414582; cv=none; d=zohomail.com; s=zohoarc; b=D8NX7qjwf3LCB04fRlaYSFYBGrTAKRgncGDaU+5fLqy+/9xfEtSueSFuZEC/LAwbSl+T+kijfRcx7C1tdQPj08aHLa93JXq3XpFWY9dUMvQsOiRXF582UhBQ890uldPsZU0x7pYt2Ccj3r6XbVQdSxawVNd3I8mCmRAadcJ4SxI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789414582; 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=+QdhuJAeFJs5Gb9ayrydAYaknSpNNf7R835xFeVmxzE=; b=SBEc8sjLScwAVkWHZCdpeGjCk8jDabxczZXXpcWjl2r3kNechhAxkNHqK5Wh0FzQg1Upe4dEsgFxYBZxaH7UXCjBtFVrvt7PDjeq76azgPmvlah+E32fAqAtcM2aWrIL2UQ0tC092VzG+SqZsvf/Ott3QgnDShyhMUiK97u0Qo0= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1789414582884873.0489638423006; Mon, 14 Sep 2026 12:36:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x6CSc-0007H5-Ls; Mon, 14 Sep 2026 15:35:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6CSA-000703-BJ; Mon, 14 Sep 2026 15:34:59 -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 1x6CS5-0004AC-3m; Mon, 14 Sep 2026 15:34:57 -0400 Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68EJ1Xnk1714381; Mon, 14 Sep 2026 19:34:51 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 4gmw5dugh1-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 14 Sep 2026 19:34:51 +0000 (GMT) Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 68EIom8x2752505; Mon, 14 Sep 2026 19:34:51 GMT Received: from smtprelay07.dal12v.mail.ibm.com ([172.16.1.9]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4gnhevyxt7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Sep 2026 19:34:51 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (smtpav02.wdc07v.mail.ibm.com [10.39.53.229]) by smtprelay07.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 68EJYnIm18088628 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 14 Sep 2026 19:34:49 GMT Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6B7CB58058; Mon, 14 Sep 2026 19:34:49 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F1D4E58059; Mon, 14 Sep 2026 19:34:47 +0000 (GMT) Received: from fedora-workstation.ibmuc.com (unknown [9.61.78.15]) by smtpav02.wdc07v.mail.ibm.com (Postfix) with ESMTP; Mon, 14 Sep 2026 19:34:47 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=+QdhuJAeFJs5Gb9ay rydAYaknSpNNf7R835xFeVmxzE=; b=BNgaNw/RtyoDy1kr/nP6yHwnxed1cLVCP ws9wgNW9WmtLnK6K2sbqsi0uF8LiqD41KD1Jad4Pq+8Gxwf+ut6LRTET8BDIKxuX S9KxNey0zJDxRVT7tswTd097R7m1IqGrSZtEmrA7gL65nk6tvGiuL9/fkgdzz0pq 2bextHJm5LOeE8jA4HOE7wF8nyXsO+JaJRJ2qVxdEmwRkEpZti0+yfRkl0SeAEzg MWWq7YYkpOBNPDe82L/IlYfItQe+hGYEjhLzDj5Df+sqz7xWvttVzGefeUsTfvst QSnyHX1alNQF+P1pIydP86WkoeQbMsq5zim/kCx+YJY/fQL1aJRLw== From: Zhuoying Cai To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org Cc: mst@redhat.com, jrossi@linux.ibm.com, zycai@linux.ibm.com, borntraeger@linux.ibm.com, jjherne@linux.ibm.com, cohuck@redhat.com, farman@linux.ibm.com, mjrosato@linux.ibm.com, pasic@linux.ibm.com, farosas@suse.de, lvivier@redhat.com, pbonzini@redhat.com, jdaley@linux.ibm.com Subject: [PATCH v3 4/8] pc-bios/s390-ccw: Add support for virtio-net-pci IPL Date: Mon, 14 Sep 2026 15:34:34 -0400 Message-ID: <20260914193438.526407-5-zycai@linux.ibm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260914193438.526407-1-zycai@linux.ibm.com> References: <20260914193438.526407-1-zycai@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE0MDI3OCBTYWx0ZWRfX9oW9AsWjgRa1 /SX+whKuKwBM18yxTJPStnft/4B2nWJmsOSLtHVAzWen5pqZ6Tj/dNv4KC3H1kyFy9zkxuJWrE7 j7/5RPIq67dgIB9ssbqOAbxxOKgLneROmyU13SiJYdzs250bp3tWNX9VYKkqHsH/itYNogVj9Rd bCVxn/bJI2AehDPvv1/iT3Q7p9oqKH9b3AIAiEtRmrhmqPEzWgnqwZftry0IBOT9ELtsKJebCiI kDGe53VKhzUB+1qRQ4z2eeaLewkha/n3m6SvRycJXfHJSwJxgh5tymA3k/IQXsl65MCf6bsHSi9 gySN9ssaHQjgMJ/6iLKnu85F/lKrCq72OhBvsJmHdpRqim9PKmHPasRg+ErqzsjZxVzt0sfqfC8 UHNa7Mdug2L6W3bxW8C9B4kHvDYldvWOhg3W8jQrADxDsLOq8t9lprx8QLz+f6uD5TW+GZW8NrW esRAQNQyOamehU6kRSA== X-Authority-Analysis: v=2.4 cv=E/NYNqdl c=1 sm=1 tr=0 ts=6aa84c5b cx=c_pps a=5BHTudwdYE3Te8bg5FgnPg==:117 a=5BHTudwdYE3Te8bg5FgnPg==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=V8glGbnc2Ofi9Qvn3v5h:22 a=VnNF1IyMAAAA:8 a=ctsVLiZ_AAAA:8 a=Iu4lfvU6lRjo1WYjJIoA:9 a=3VCIHQLkQthbvTRuo98s:22 X-Proofpoint-ORIG-GUID: lso6K167DLS5f1OKgcE0se-WRr3NtlgP X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE0MDI3OCBTYWx0ZWRfX1YofO2+mLIVz 42ZlJKGq8QnXuQwb9iiIzwQbrPU4eoDu02qmcvooF4tlmIoBzfBVCHINE2amMsLVoh2ZZzq2npP rb8QbphDSvdyR8i24BLu6OkxNyqNKYk= X-Proofpoint-GUID: lso6K167DLS5f1OKgcE0se-WRr3NtlgP X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-14_03,2026-09-14_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 lowpriorityscore=0 priorityscore=1501 spamscore=0 adultscore=0 clxscore=1015 bulkscore=0 malwarescore=0 suspectscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609140278 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=lists1p.gnu.org; Received-SPF: pass client-ip=148.163.158.5; envelope-from=zycai@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, 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: qemu development 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: 1789414583553158500 Content-Type: text/plain; charset="utf-8" Enable network booting via virtio-net-pci by implementing PCI transport support for virtio-net. This patch also extends endianness handling for virtio PCI ring operations = in little-endian to ensure correct behavior on s390x. Signed-off-by: Zhuoying Cai Reviewed-by: Jared Rossi Reviewed-by: Matthew Rosato --- pc-bios/s390-ccw/main.c | 1 + pc-bios/s390-ccw/netmain.c | 9 +++++++- pc-bios/s390-ccw/virtio-net.c | 41 ++++++++++++++++++++++++++++------- pc-bios/s390-ccw/virtio-pci.c | 20 +++++++++++++++++ 4 files changed, 62 insertions(+), 9 deletions(-) diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c index 8fc1cbf653..28cab3b411 100644 --- a/pc-bios/s390-ccw/main.c +++ b/pc-bios/s390-ccw/main.c @@ -332,6 +332,7 @@ static void ipl_pci_device(void) } =20 switch (vdev->dev_type) { + case VIRTIO_ID_NET: case VIRTIO_ID_BLOCK: if (virtio_setup() =3D=3D 0) { zipl_load(); /* only return on error */ diff --git a/pc-bios/s390-ccw/netmain.c b/pc-bios/s390-ccw/netmain.c index bcb62bf6ca..e42e049063 100644 --- a/pc-bios/s390-ccw/netmain.c +++ b/pc-bios/s390-ccw/netmain.c @@ -498,7 +498,14 @@ int netmain(void) sclp_setup(); puts("Network boot starting..."); =20 - if (!virtio_ccw_net_setup()) { + /* + * CCW devices require subchannel enumeration here. + * PCI devices don't require specific setup: the transport is already + * initialized by ipl_pci_device(), and virtio_is_supported() is check= ed + * later in virtio_net_init(). + */ + if (virtio_get_device()->ipl_type =3D=3D S390_IPL_TYPE_CCW && + !virtio_ccw_net_setup()) { puts("No valid virtio ccw net device found."); return -1; } diff --git a/pc-bios/s390-ccw/virtio-net.c b/pc-bios/s390-ccw/virtio-net.c index ffdf7ba831..48ad6b5da8 100644 --- a/pc-bios/s390-ccw/virtio-net.c +++ b/pc-bios/s390-ccw/virtio-net.c @@ -67,7 +67,22 @@ int virtio_net_init(void *mac_addr) rx_last_idx =3D 0; =20 vdev->guest_features[0] =3D VIRTIO_NET_F_MAC_BIT; - virtio_ccw_setup(vdev); + switch (virtio_get_device()->ipl_type) { + case S390_IPL_TYPE_CCW: + if (virtio_ccw_setup(vdev)) { + puts("Setup failed for virtio-net-ccw"); + return -1; + } + break; + case S390_IPL_TYPE_PCI: + if (virtio_pci_setup(vdev)) { + puts("Setup failed for virtio-net-pci"); + return -1; + } + break; + default: + return -1; + } =20 if (!(vdev->guest_features[0] & VIRTIO_NET_F_MAC_BIT)) { puts("virtio-net device does not support the MAC address feature"); @@ -119,22 +134,30 @@ int recv(int fd, void *buf, int maxlen, int flags) VRing *rxvq =3D &vdev->vrings[VQ_RX]; int len, id; uint8_t *pkt; + uint16_t rx_used_idx, rx_avail_idx; + uint32_t rx_used_len, rx_used_id; + uint64_t rx_desc_addr; =20 - if (rx_last_idx =3D=3D rxvq->used->idx) { + rx_used_idx =3D virtio_tswap16(rxvq->used->idx); + if (rx_last_idx =3D=3D rx_used_idx) { return 0; } =20 - len =3D rxvq->used->ring[rx_last_idx % rxvq->num].len - virtio_net_hdr= _size; + rx_used_len =3D virtio_tswap32(rxvq->used->ring[rx_last_idx % rxvq->nu= m].len); + rx_used_id =3D virtio_tswap32(rxvq->used->ring[rx_last_idx % rxvq->num= ].id); + + len =3D rx_used_len - virtio_net_hdr_size; if (len > maxlen) { puts("virtio-net: Receive buffer too small"); len =3D maxlen; } - id =3D rxvq->used->ring[rx_last_idx % rxvq->num].id % rxvq->num; - pkt =3D (uint8_t *)(rxvq->desc[id].addr + virtio_net_hdr_size); + id =3D rx_used_id % rxvq->num; + rx_desc_addr =3D virtio_tswap64(rxvq->desc[id].addr); + pkt =3D (uint8_t *)(rx_desc_addr + virtio_net_hdr_size); =20 #if DEBUG_VIRTIO_NET /* Dump packet */ int i; - printf("\nbuf %p: len=3D%i\n", (void *)rxvq->desc[id].addr, len); + printf("\nbuf %p: len=3D%i\n", (void *)rx_desc_addr, len); for (i =3D 0; i < 64; i++) { printf(" %02x", pkt[i]); if ((i % 16) =3D=3D 15) { @@ -148,8 +171,10 @@ int recv(int fd, void *buf, int maxlen, int flags) memcpy(buf, pkt, len); =20 /* Mark buffer as available to the host again */ - rxvq->avail->ring[rxvq->avail->idx % rxvq->num] =3D id; - rxvq->avail->idx =3D rxvq->avail->idx + 1; + rx_avail_idx =3D virtio_tswap16(rxvq->avail->idx); + rxvq->avail->ring[rx_avail_idx % rxvq->num] =3D virtio_tswap16(id); + rx_avail_idx++; + rxvq->avail->idx =3D virtio_tswap16(rx_avail_idx); vring_notify(rxvq); =20 /* Move index to next entry */ diff --git a/pc-bios/s390-ccw/virtio-pci.c b/pc-bios/s390-ccw/virtio-pci.c index f501252c81..fd794bad8f 100644 --- a/pc-bios/s390-ccw/virtio-pci.c +++ b/pc-bios/s390-ccw/virtio-pci.c @@ -52,6 +52,10 @@ void virtio_pci_id2type(VDev *vdev, uint16_t device_id) case 0x1001: vdev->dev_type =3D VIRTIO_ID_BLOCK; break; + case 0x1041: + case 0x1000: + vdev->dev_type =3D VIRTIO_ID_NET; + break; default: vdev->dev_type =3D 0; } @@ -199,6 +203,17 @@ static int virtio_pci_get_blk_config(void) return rc; } =20 +static int virtio_pci_get_net_config(void) +{ + VirtioNetConfig *cfg =3D &virtio_get_device()->config.net; + + /* + * Byte-swapping is not needed as only the MAC address (byte array) + * is used here. Byte-swap if other fields are added. + */ + return vpci_read_flex(d_cap.off, d_cap.bar, cfg, sizeof(VirtioNetConfi= g)); +} + static int virtio_pci_negotiate(void) { int i, rc; @@ -330,6 +345,7 @@ bool virtio_pci_is_supported(VDev *vdev) if (vdev->vendor_id =3D=3D PCI_VENDOR_VIRTIO) { switch (vdev->dev_type) { case VIRTIO_ID_BLOCK: + case VIRTIO_ID_NET: return true; default: return false; @@ -384,6 +400,10 @@ int virtio_pci_setup(VDev *vdev) vdev->cmd_vr_idx =3D 0; virtio_pci_get_blk_config(); break; + case VIRTIO_ID_NET: + vdev->nr_vqs =3D 2; + virtio_pci_get_net_config(); + break; default: puts("Unsupported virtio device"); return -ENODEV; --=20 2.55.0 From nobody Sat Sep 26 22:15:44 2026 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=1789414585; cv=none; d=zohomail.com; s=zohoarc; b=CdJcK9oHCANRlSHJjUAHh9RlyG3peF9NEpEHaqGGyXFp51/UBv6lMqKiqqmBPxWoNl0+aZVNzD4LQ/F9Paxun5AuG3b4bzIeGqXKcIJIl59HiE5dJlSmzVshsemkCm5juDDNCic7VQg/S50ThW4csDqHTDtdIWwgZ5S9Mr077IY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789414585; 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=7q+k4TzO9NgZaGwpWBRuCqRB8crr5wFyZBBq/Fx6hTU=; b=hU2Js/Xr73H2QhLAFditee0WVM6vcTiuzYW36rt0ex7t2Lm0h2pVfSdnIP9O9a//lik/H2jWuYKVLPMZUH9clfDIvgbhgP3/FqMa72UR4mWo0ht9pC6kX+Vxmzs8ZHQuME+wN9KzTvk/4lYW3alsY5rHjmowEvlICcHwyX4pgec= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1789414585873253.1398684427021; Mon, 14 Sep 2026 12:36:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x6CSe-0007Iv-6Z; Mon, 14 Sep 2026 15:35:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6CSB-00070E-ET; Mon, 14 Sep 2026 15:34:59 -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 1x6CS8-0004Bz-41; Mon, 14 Sep 2026 15:34:58 -0400 Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68EJ1Rtc2880875; Mon, 14 Sep 2026 19:34:53 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 4gmx83km32-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 14 Sep 2026 19:34:53 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 68EIoqpt2764002; Mon, 14 Sep 2026 19:34:52 GMT Received: from smtprelay02.wdc07v.mail.ibm.com ([172.16.1.69]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4gnjjgqs01-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Sep 2026 19:34:52 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (smtpav02.wdc07v.mail.ibm.com [10.39.53.229]) by smtprelay02.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 68EJYpcD28836580 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 14 Sep 2026 19:34:51 GMT Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0DD3D58058; Mon, 14 Sep 2026 19:34:51 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 93C7958059; Mon, 14 Sep 2026 19:34:49 +0000 (GMT) Received: from fedora-workstation.ibmuc.com (unknown [9.61.78.15]) by smtpav02.wdc07v.mail.ibm.com (Postfix) with ESMTP; Mon, 14 Sep 2026 19:34:49 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=7q+k4TzO9NgZaGwpW BRuCqRB8crr5wFyZBBq/Fx6hTU=; b=XSRacRCKbiupsZGwBlsAmdCO51yfcnaOU mmkxopVj+fTQIxhUqexDYx4cucT+BhhuUvcKTewO/0Sjgf1z/gJzuVwOWTvdhbj4 gF9lEKz6NIN7aUnJhhGiJgMrEz+kD+fxpi5+tPquTGgDZvrmsNdk/cVUnB4/fOPT dnPUrNa+cXp7GiW4LS34y7oYHM6J66xy7TRitVhG035ByQzSTj8VjodxO4Vug9tI cwlnaUKukKIfno8Se1hXys3Ef8iFxEKUBP+KUli7tLLez7KCIIYnnq48cpEsYRTS WmN7thodWMkxNj8f4F0NecLh9GJLvzOlQO/ahTU2XZZSHkM/hQmig== From: Zhuoying Cai To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org Cc: mst@redhat.com, jrossi@linux.ibm.com, zycai@linux.ibm.com, borntraeger@linux.ibm.com, jjherne@linux.ibm.com, cohuck@redhat.com, farman@linux.ibm.com, mjrosato@linux.ibm.com, pasic@linux.ibm.com, farosas@suse.de, lvivier@redhat.com, pbonzini@redhat.com, jdaley@linux.ibm.com Subject: [PATCH v3 5/8] hw/virtio: Add "loadparm" property to virtio net PCI devices booting on s390x Date: Mon, 14 Sep 2026 15:34:35 -0400 Message-ID: <20260914193438.526407-6-zycai@linux.ibm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260914193438.526407-1-zycai@linux.ibm.com> References: <20260914193438.526407-1-zycai@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE0MDI3OCBTYWx0ZWRfX5I1s1qTbtKuu WRQWRlL6Ur1zcbNZszxGRN89lev9Oq33eWQHJ230WmmJy1rwmm+NrSGBLqB2eAzw0q1Ddqw76t9 KRn/QuH5pWN2FG9ifPbyYuzSqzrFjcZkMhPpYFQiVzRNmp03R/rGVxs3dZTPSYgX4mDiaNrr5Od Y1eNWaiNX4TDJuxzhgq89cBvKeS9GCxDLY8JvhRwE+tkj41lq2T7MX2xINBeVBKqOQMwvaqwiJm 8+j1OUGKJpSpqO6OoXP5wgTG3su3xIHtaMYZHMyDrb32dymqi3pM/DQUFKJhSgsZ8CuscJ2KB3R Jc1fCM+ILbrHOfHyeM3GrmlehHV+EbvEgC9fFfCncIdSGEQgOYesgoRtuxljB3Oe9zRLc+ywkUB sYlVOtQAXvzBwdSpEjfyHv0CDmjE4/6ngJYLtf48rHnO8o79x2q8jucD7atQLjCZZItcGo7gPDN cYsbmPYFnbCLUXZiu/w== X-Proofpoint-ORIG-GUID: cxa9pB2V6UKw77d2Ab1n_s4DZVzhKOhc X-Proofpoint-GUID: cxa9pB2V6UKw77d2Ab1n_s4DZVzhKOhc X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE0MDI3OCBTYWx0ZWRfXwqWBtd/RfFd3 Rr/DQ21C2apvNfKQV2jEMA+7Itt5DYsepqDwKZRAxqZUtk91EfZ7KgdlVKW11UA8rCvUZHmFVj8 dwMyf9z3JT1q5LdUoiENqhDonNDQE0I= X-Authority-Analysis: v=2.4 cv=cY9HPXDM c=1 sm=1 tr=0 ts=6aa84c5d cx=c_pps a=3Bg1Hr4SwmMryq2xdFQyZA==:117 a=3Bg1Hr4SwmMryq2xdFQyZA==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=iQ6ETzBq9ecOQQE5vZCe:22 a=VnNF1IyMAAAA:8 a=LEpY8eO1VcgwfWkpOzsA:9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-14_03,2026-09-14_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 spamscore=0 bulkscore=0 clxscore=1015 suspectscore=0 impostorscore=0 malwarescore=0 phishscore=0 adultscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609140278 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=lists1p.gnu.org; Received-SPF: pass client-ip=148.163.156.1; envelope-from=zycai@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_H4=0.001, RCVD_IN_MSPIKE_WL=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: qemu development 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: 1789414587434158501 Content-Type: text/plain; charset="utf-8" Add optional loadparm property to virtio-net-pci to allow boot entry selection on s390x, consistent with virtio-blk-pci. Signed-off-by: Zhuoying Cai Reviewed-by: Jared Rossi Reviewed-by: Jason J. Herne Reviewed-by: Matthew Rosato --- hw/virtio/virtio-net-pci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/virtio/virtio-net-pci.c b/hw/virtio/virtio-net-pci.c index fd3e0303f5..893d1905a9 100644 --- a/hw/virtio/virtio-net-pci.c +++ b/hw/virtio/virtio-net-pci.c @@ -77,6 +77,7 @@ static void virtio_net_pci_class_init(ObjectClass *klass,= const void *data) k->sriov_vf_user_creatable =3D true; set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); device_class_set_props(dc, virtio_net_properties); + pci_qdev_property_add_specifics(dc); vpciklass->realize =3D virtio_net_pci_realize; } =20 --=20 2.55.0 From nobody Sat Sep 26 22:15:44 2026 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=1789414585; cv=none; d=zohomail.com; s=zohoarc; b=jlnmjXvX0552eZI1tgeYlpzRlGXMTZp5tT05HEd4vRme9ntGu7CyCJGB0eWF7soYk0r7HAif3fOcmBQXYvnuGpp2swCCke4mBeC5nC4U0kqbj0RyUG7NdchqNQKtBD81qhSTKZiu2GFMKDGFcb+0Yh9IwTQeMrWxYUeJrhGNpn4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789414585; 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=8J+9cPWJAQac5N5XWcE/HEpv/XLGhHXhUXKaVXCo6AY=; b=Jew6obE1XtUZA29zNbLLgJ6b+ICFirhOgN5c61wXLA6YbpJfd51wJQ6YV7zXcXFfr8QPjFFWJGKikF8p0K3kbVKNolT89gkDM1N8u2JT8zQZVRDc2fR4YFg04uBWGAFif3nAf6OoH6jDelYJLFGpFOpBMPkJDSuA1AboOaj98Ik= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1789414585915964.7260290494744; Mon, 14 Sep 2026 12:36:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x6CSc-0007Go-Gz; Mon, 14 Sep 2026 15:35:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6CSB-00070D-ET; Mon, 14 Sep 2026 15:34:59 -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 1x6CS8-0004Cg-Jy; Mon, 14 Sep 2026 15:34:58 -0400 Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68EJ1Vda2880902; Mon, 14 Sep 2026 19:34:55 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 4gmx83km35-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 14 Sep 2026 19:34:54 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 68EIopC32763980; Mon, 14 Sep 2026 19:34:53 GMT Received: from smtprelay03.wdc07v.mail.ibm.com ([172.16.1.70]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4gnjjgqs04-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Sep 2026 19:34:53 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (smtpav02.wdc07v.mail.ibm.com [10.39.53.229]) by smtprelay03.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 68EJYAYw27460162 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 14 Sep 2026 19:34:10 GMT Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 97A9B58058; Mon, 14 Sep 2026 19:34:52 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3603B58059; Mon, 14 Sep 2026 19:34:51 +0000 (GMT) Received: from fedora-workstation.ibmuc.com (unknown [9.61.78.15]) by smtpav02.wdc07v.mail.ibm.com (Postfix) with ESMTP; Mon, 14 Sep 2026 19:34:51 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=8J+9cPWJAQac5N5XW cE/HEpv/XLGhHXhUXKaVXCo6AY=; b=SgeUxOJqT1oHKYE5d/JAFzITRFMxHopIo V3zr3HCcZ1gTXxDZwUNh2QJPiMrh2dCAbSbgdXabnKvO7IgjLMbb/YaFWfMBUEj7 ajsaDBIzTYQIw/PPbfO5gse5GySQA5MXOu4PRwQJXAxvXaRFwydH7/BMAF1RcNQx VUQgxEjthZLaBa2P501u2cd1oFRZQLCo3Ezbr8qP/rDA7OILG3YqmH7lSrQe7OEm to8apo9ANKwyrsY+Ktd5aUUr3wt7TTpwTNbRe0HHp+BonlUGFjt8E/FF1NR5WU/6 Zoels2CPrMhPZtie9HRUiahw5iFlYmrCtrA94ple+fHo9AV7P8oGw== From: Zhuoying Cai To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org Cc: mst@redhat.com, jrossi@linux.ibm.com, zycai@linux.ibm.com, borntraeger@linux.ibm.com, jjherne@linux.ibm.com, cohuck@redhat.com, farman@linux.ibm.com, mjrosato@linux.ibm.com, pasic@linux.ibm.com, farosas@suse.de, lvivier@redhat.com, pbonzini@redhat.com, jdaley@linux.ibm.com Subject: [PATCH v3 6/8] tests/qtest: Check s390x boot device support in pxe-test.c Date: Mon, 14 Sep 2026 15:34:36 -0400 Message-ID: <20260914193438.526407-7-zycai@linux.ibm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260914193438.526407-1-zycai@linux.ibm.com> References: <20260914193438.526407-1-zycai@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE0MDI3OCBTYWx0ZWRfXzKJburnWeS4v ciaC0+FHqC/Yvtwfg5T0H4SJGFQpKIq18IGvKwX/qiE1u8rUDlUPavo9pU+GnmE4RitEZmgQoh2 AVs2QQQgmDb2xbFIo7f32I9kYjNpSESJAA4nSsmK6OryZ4phg3l/R423IAQXApHhHQVmbltZYGe gM4nL0DHbIqpcyFHiDhyqBKxsX90RYmQ5GO2/wJezFi9+XlJnHRNQIWIJsPe4tKLAbXfL93VLpH h3LVEJulFN3M1fPfPySxicIxCqC26rxJiDm0JnqdKm7O5x1XHBwQ6Ku3ArA5s7dH1IsFtdK+ttQ 9QnN730xudyoUqBX2u3sC9u81MN0BH/lDca1zlRdTFMFU8Eow0RtvSKzTd09HyhkdO1eHEL3DoS lNTJQ0duIYTN8YHcAscr69JZlW97DXTTNWhpNFovz5FTu+k5RyhjmylD2NT2LQ2EHbFGMwFioqS gIGurEVnnLyl9krFOzw== X-Proofpoint-ORIG-GUID: oejRvPNufX5ZoQFf1_A0o9u-ULn1YGam X-Proofpoint-GUID: oejRvPNufX5ZoQFf1_A0o9u-ULn1YGam X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE0MDI3OCBTYWx0ZWRfX4FBHHwV8HHKi eBp1EJSVId6bfiqY6mOaCwBM//hKRV1J61YzuJiDvHT6V4u16ePYQxuQGEDQPB34RuymGty+z4G v+kA7CO6iTKEVwtnJPzyaP4bN4udixI= X-Authority-Analysis: v=2.4 cv=cY9HPXDM c=1 sm=1 tr=0 ts=6aa84c5e cx=c_pps a=3Bg1Hr4SwmMryq2xdFQyZA==:117 a=3Bg1Hr4SwmMryq2xdFQyZA==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=iQ6ETzBq9ecOQQE5vZCe:22 a=VnNF1IyMAAAA:8 a=uBPJ6fAX7Dlw_A6SEmQA:9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-14_03,2026-09-14_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 spamscore=0 bulkscore=0 clxscore=1015 suspectscore=0 impostorscore=0 malwarescore=0 phishscore=0 adultscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609140278 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=lists1p.gnu.org; Received-SPF: pass client-ip=148.163.156.1; envelope-from=zycai@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_H4=0.001, RCVD_IN_MSPIKE_WL=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: qemu development 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: 1789414587514158500 Content-Type: text/plain; charset="utf-8" The pxe test for a net device does not fail gracefully when the s390-ccw.img in use was built without support for booting that device. Add a boot_dev_support check that searches for a known string in the bios image to confirm boot support. If absent, the test is skipped gracefully instead of failing. Also re-enable pxe-test in qtests_s390x, which was accidentally removed by commit 973d97feca93. Signed-off-by: Zhuoying Cai Tested-by: Joshua Daley --- tests/qtest/meson.build | 1 + tests/qtest/pxe-test.c | 84 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 84 insertions(+), 1 deletion(-) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index c3593f7530..2cfbdf9b9f 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -292,6 +292,7 @@ qtests_aarch64 =3D \ 'migration-test'] =20 qtests_s390x =3D \ + (slirp.found() ? ['pxe-test'] : []) + \ qtests_filter + \ ['boot-serial-test', 'drive_del-test', diff --git a/tests/qtest/pxe-test.c b/tests/qtest/pxe-test.c index e85dec5a4e..8b6015b6cd 100644 --- a/tests/qtest/pxe-test.c +++ b/tests/qtest/pxe-test.c @@ -26,6 +26,7 @@ typedef struct testdef { const char *machine; /* Machine type */ const char *model; /* NIC device model */ const char *extra; /* Any additional parameters */ + bool (*boot_dev_support)(void); /* optional: boot device support check= */ } testdef_t; =20 static testdef_t x86_tests[] =3D { @@ -58,8 +59,79 @@ static testdef_t ppc64_tests_slow[] =3D { { NULL }, }; =20 +static const char *s390_bios_load(gsize *len) +{ + static char *cached_contents; + static gsize cached_len; + const char *qemu_bin; + g_autofree char *cmd =3D NULL; + char dir[PATH_MAX]; + char *found =3D NULL; + char *path =3D NULL; + FILE *fp; + + if (cached_contents) { + g_test_message("Using cached bios contents"); + goto out; + } + + /* search the qemu binary's data directories for s390-ccw.img */ + qemu_bin =3D qtest_qemu_binary(NULL); + cmd =3D g_strdup_printf("%s -L help", qemu_bin); + fp =3D popen(cmd, "r"); + + if (!fp) { + g_error("Failed to run '%s'", cmd); + } + + while (fgets(dir, sizeof(dir), fp) && !found) { + dir[strcspn(dir, "\n")] =3D '\0'; + path =3D g_build_filename(dir, "s390-ccw.img", NULL); + if (g_file_get_contents(path, &cached_contents, &cached_len, NULL)= ) { + found =3D path; + } else { + g_free(path); + } + } + pclose(fp); + + if (!found) { + g_error("s390-ccw.img not found"); + } + + g_test_message("Loaded %s", found); + g_free(found); + +out: + *len =3D cached_len; + return cached_contents; +} + +static bool s390_bios_has_string(const char *needle) +{ + const char *contents; + gsize len; + bool found; + + contents =3D s390_bios_load(&len); + found =3D memmem(contents, len, needle, strlen(needle)) !=3D NULL; + + g_test_message("%s %s", needle, found ? "found" : "not found"); + return found; +} + +static bool s390_bios_has_net_ccw(void) +{ + /* + * virtio-net-ccw has always been supported; + * probe for the string it always emits + */ + return s390_bios_has_string("Network boot starting..."); +} + static testdef_t s390x_tests[] =3D { - { "s390-ccw-virtio", "virtio-net-ccw" }, + { "s390-ccw-virtio", "virtio-net-ccw", + .boot_dev_support =3D s390_bios_has_net_ccw }, { NULL }, }; =20 @@ -90,6 +162,11 @@ static void test_pxe_ipv4(gconstpointer data) { const testdef_t *test =3D data; =20 + if (test->boot_dev_support && !test->boot_dev_support()) { + g_test_skip("The bios does not support booting this device"); + return; + } + test_pxe_one(test, false); } =20 @@ -97,6 +174,11 @@ static void test_pxe_ipv6(gconstpointer data) { const testdef_t *test =3D data; =20 + if (test->boot_dev_support && !test->boot_dev_support()) { + g_test_skip("The bios does not support booting this device"); + return; + } + test_pxe_one(test, true); } =20 --=20 2.55.0 From nobody Sat Sep 26 22:15:44 2026 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=1789414585; cv=none; d=zohomail.com; s=zohoarc; b=P6fNqv6IYPwRd3CJrTLUY9QsadyNkEXwlUKcwf4miWmVGAiAFrx4UGc9liiTt3BJZvNB2I6Muhe6zRKuy6vORhIcmK7di3uTzzIZM5b9fzXEwNyy6emfWMX/c+dBCcGwlo6b8qOIXDUSWO+c6+V4G3Mi9VUSRTOEd0/glTJMWQY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789414585; 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=YAMsQTb6rhmU3d06pgaPDi4Pf/RAqnYY1tnOu3bhyyk=; b=Ut4SqwI2SEIhVPH4nblvvJcocKWp2sht9TdBC38X59xSeBBxQN8VPpfFAe3h7GEef9SmJT11SIWLICYgIOaY1nIRzw4sVyQVtdgGLx27AmBIpXJyWOHzaT5nmc+NHQJOI+ADJyMao1LOwlk4CAPTvr6E+UHE53Funi7iBz6qTMc= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1789414585840687.7415816724044; Mon, 14 Sep 2026 12:36:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x6CSc-0007Gq-M8; Mon, 14 Sep 2026 15:35:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6CSE-00070e-2p; Mon, 14 Sep 2026 15:35:05 -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 1x6CSB-0004F4-8L; Mon, 14 Sep 2026 15:35:01 -0400 Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68EJ1Qcq2880868; Mon, 14 Sep 2026 19:34:56 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 4gmx83km38-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 14 Sep 2026 19:34:56 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 68EIoov72817784; Mon, 14 Sep 2026 19:34:55 GMT Received: from smtprelay05.wdc07v.mail.ibm.com ([172.16.1.72]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 4gnk9j7ny2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Sep 2026 19:34:55 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (smtpav02.wdc07v.mail.ibm.com [10.39.53.229]) by smtprelay05.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 68EJYsoh33096222 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 14 Sep 2026 19:34:54 GMT Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3770C5805B; Mon, 14 Sep 2026 19:34:54 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C060158058; Mon, 14 Sep 2026 19:34:52 +0000 (GMT) Received: from fedora-workstation.ibmuc.com (unknown [9.61.78.15]) by smtpav02.wdc07v.mail.ibm.com (Postfix) with ESMTP; Mon, 14 Sep 2026 19:34:52 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=YAMsQTb6rhmU3d06p gaPDi4Pf/RAqnYY1tnOu3bhyyk=; b=npv2km2gvLdNc4KsMGFuL0KyMMt1Nsi/r QplU4mO7v9eEXvHs3jNwNy7zTXpec3MQ8VFrzEttaEGZvHX3iks/LPycBi79dffZ 5jOoNWyHRDNcgXc1Vq6KzZPDvuW6YAqnxP4HvsNXkHkA3ghmBsXF812sYyHYlWj5 keAIOXGrqdi0Q13WgFo7F9dQg6hiiSyBkNvWJoMkRR1lpUqoHKAcaS8mfDoyyhSu Si869y97qhzFnbgAVEYjkbs5z/+fIlbclp3bhmYA9D8iR8hDapqeV4bg6g6QcMoC ljlGLTKmlzZ6nPypJaquRZ2MWx0aVKkxBvOccpRnj5mR3/I/b0hBw== From: Zhuoying Cai To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org Cc: mst@redhat.com, jrossi@linux.ibm.com, zycai@linux.ibm.com, borntraeger@linux.ibm.com, jjherne@linux.ibm.com, cohuck@redhat.com, farman@linux.ibm.com, mjrosato@linux.ibm.com, pasic@linux.ibm.com, farosas@suse.de, lvivier@redhat.com, pbonzini@redhat.com, jdaley@linux.ibm.com Subject: [PATCH v3 7/8] tests/qtest: Add s390x virtio net PCI test to pxe-test.c Date: Mon, 14 Sep 2026 15:34:37 -0400 Message-ID: <20260914193438.526407-8-zycai@linux.ibm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260914193438.526407-1-zycai@linux.ibm.com> References: <20260914193438.526407-1-zycai@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE0MDI3OCBTYWx0ZWRfX1oRtW2Z8ujqj erRAYi2gcqJOKMxSfJAsvB465eA3qenjf03IYsTw2QJXoHURabukUjFBp6/zv3K0tZGwNqSAVh+ jOJInNxLG4hbI4j6ILACmHwOad1tob90JwTEi3J9nPTbXA7D82aPv5DFUNAXelcrd5E3C/Ykbot HTl/Jf1byceergPRRold6jLnLYZXsJM6/gPSmkOF/3mZWec09EG/pIb62LkE0UXYlqt0d4DMwc0 ZdPP0221gx1xlpEWhvplZVHloKI/cQp4JZI0MH8A15r9pQea7J5t6wcc2M5eV10drF79NXRZtd5 MnNYf1NQefAs8+yPgpo8gkqd2CRB+6ns0nBKQuS6e8ZeFysuFMuU10Fg0cSarQ61qsP0cJFFkKO aGHg5NnEavq1w3FjwCuJLYxipr9CeNpRB8Uma9OarEBtARJ4+/2lWEJbGPq6sx2pgwz7CFnRssl gC30nRRkNJDDZCNdDcQ== X-Proofpoint-ORIG-GUID: 4o2zkpLxxXklrZvnP-j5GSWeqxUdrJ-k X-Proofpoint-GUID: 4o2zkpLxxXklrZvnP-j5GSWeqxUdrJ-k X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE0MDI3OCBTYWx0ZWRfX5qSzdeK3WPqp iJQ2KSF1YNyXsOhAOZLKnxiaNFHZwsStLM/6c2VzK9i5J1owF4k7cnY2M4wdILF+kAmRWP58uKY VBdbhx36Izqh8G8r7o7v1Iyx4lRwtn0= X-Authority-Analysis: v=2.4 cv=cY9HPXDM c=1 sm=1 tr=0 ts=6aa84c60 cx=c_pps a=AfN7/Ok6k8XGzOShvHwTGQ==:117 a=AfN7/Ok6k8XGzOShvHwTGQ==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=iQ6ETzBq9ecOQQE5vZCe:22 a=VnNF1IyMAAAA:8 a=dWYI0Se9NbB5ALU5aogA:9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-14_03,2026-09-14_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 spamscore=0 bulkscore=0 clxscore=1015 suspectscore=0 impostorscore=0 malwarescore=0 phishscore=0 adultscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609140278 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=lists1p.gnu.org; Received-SPF: pass client-ip=148.163.156.1; envelope-from=zycai@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_H4=0.001, RCVD_IN_MSPIKE_WL=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: qemu development 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: 1789414587452158500 Content-Type: text/plain; charset="utf-8" Add test coverage for virtio-net-pci network booting on s390x by including it in the PXE test suite. The test verifies that PXE network booting works correctly with virtio-net-pci devices. Signed-off-by: Zhuoying Cai Tested-by: Joshua Daley --- tests/qtest/pxe-test.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/qtest/pxe-test.c b/tests/qtest/pxe-test.c index 8b6015b6cd..c29386ed4b 100644 --- a/tests/qtest/pxe-test.c +++ b/tests/qtest/pxe-test.c @@ -129,9 +129,16 @@ static bool s390_bios_has_net_ccw(void) return s390_bios_has_string("Network boot starting..."); } =20 +static bool s390_bios_has_net_pci(void) +{ + return s390_bios_has_string("Setup failed for virtio-net-pci"); +} + static testdef_t s390x_tests[] =3D { { "s390-ccw-virtio", "virtio-net-ccw", .boot_dev_support =3D s390_bios_has_net_ccw }, + { "s390-ccw-virtio", "virtio-net-pci", + .boot_dev_support =3D s390_bios_has_net_pci }, { NULL }, }; =20 --=20 2.55.0 From nobody Sat Sep 26 22:15:44 2026 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=1789414552; cv=none; d=zohomail.com; s=zohoarc; b=V7Q4Ed9rGtxe1nCJoo5k6kHgzn1olbQHSsaXABkAJrsg76/lQy2fdF/ws8ygXqROeHAnju+sHrTz+JCuuf4fNWi7Rr5X53NEceZtaKFZNGRPCZ4XGo+2Apl9lUguzFetoZdP8ciM2ykNY1v6Yza9zNwZ3y14QWLo6SC7CZ6JZVk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789414552; 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=t/y/vTQBtlIWi2+w7VEwIBur1cVx13Tpa7RfgWXb4C4=; b=EpjLSH8cMPNITsFtIyoEbDr042nS9/0pbbmqdOaj20wjNYLLnOsoBtT5sAz9KtRn4l6z6grp7HA0YFtXVcDNc1hWYpBsqr1v1rXk1fGmtMJ8ybjzbyOqlP1fuZl26fOF7L/GLffo8+zQulfxdzOZoTjG6LgtfpkkF/PzdUXPUWU= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178941455213090.05679823536263; Mon, 14 Sep 2026 12:35:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x6CSf-0007K6-ID; Mon, 14 Sep 2026 15:35:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6CSE-00070f-3M; Mon, 14 Sep 2026 15:35:04 -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 1x6CSB-0004H1-JV; Mon, 14 Sep 2026 15:35:01 -0400 Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68EJ1dGK2739123; Mon, 14 Sep 2026 19:34:58 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 4gmv5hkp5g-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 14 Sep 2026 19:34:58 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 68EIoov92817784; Mon, 14 Sep 2026 19:34:57 GMT Received: from smtprelay06.wdc07v.mail.ibm.com ([172.16.1.73]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 4gnk9j7ny5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Sep 2026 19:34:57 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (smtpav02.wdc07v.mail.ibm.com [10.39.53.229]) by smtprelay06.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 68EJYthT20251338 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 14 Sep 2026 19:34:55 GMT Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CB33858059; Mon, 14 Sep 2026 19:34:55 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6273C58058; Mon, 14 Sep 2026 19:34:54 +0000 (GMT) Received: from fedora-workstation.ibmuc.com (unknown [9.61.78.15]) by smtpav02.wdc07v.mail.ibm.com (Postfix) with ESMTP; Mon, 14 Sep 2026 19:34:54 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=t/y/vTQBtlIWi2+w7 VEwIBur1cVx13Tpa7RfgWXb4C4=; b=naAVloSQKxa2qcglTXKK4WDp+xowBrsG+ /SXbKA5sYkEbRbZX9eoHx3pU9I9DLZQ2fErOHFIXtIr8hHofMGmLf5AIVDxN2Jkw /cI7ug7uu58GIL6qiLn47+mzpxNhTxY+hBB81T5gvQILSM0paN0oocVgXCZAWajG qIOW5sInLpygqztPsv1nOHKlISdI+wNsn9TdKpMFJZ+zLNFZR4QVb+dQ9Yn1t8Mr ahkMVRh6+y8wTqvlAuP5DFXvMVutD9UvRomU42CdLNfSl1TGmtpxpFvFJTnjQWWp JMc72uM36qAMbG0m2xlAZJpOMivYXpHK12GTAj6idBLcyvYHZImQw== From: Zhuoying Cai To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org Cc: mst@redhat.com, jrossi@linux.ibm.com, zycai@linux.ibm.com, borntraeger@linux.ibm.com, jjherne@linux.ibm.com, cohuck@redhat.com, farman@linux.ibm.com, mjrosato@linux.ibm.com, pasic@linux.ibm.com, farosas@suse.de, lvivier@redhat.com, pbonzini@redhat.com, jdaley@linux.ibm.com Subject: [PATCH v3 8/8] tests/functional/s390x: Add tests for virtio net PCI in test_pxelinux.py Date: Mon, 14 Sep 2026 15:34:38 -0400 Message-ID: <20260914193438.526407-9-zycai@linux.ibm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260914193438.526407-1-zycai@linux.ibm.com> References: <20260914193438.526407-1-zycai@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE0MDI3OCBTYWx0ZWRfX0FjatxyChID9 T2xpAZrZsbplI8YW7pODM93sQvuQOyf4pY79t+Bt39RNc/K3AQ92yyQS8gZYWyitsALGB8o4zn1 x8GBjOFUiUGkFmqstepouxXozcd/P8eMgdYuLsAeZ3HfzceQlVR9td2m2UVGP8ubKAySvRM3uNl s+JnFMjq9YSM2GBQ1slWBUgC1Lmg+Il3DbsswWxCSptwjpyhtnKu79j8n1sS2toJ29+PUjav5zu hWdaDuWck7pbPH4BQ292uQtzP+X+fDcO8TFg4qqs9+lLfxh+8tooW00XwW9kJ9S67zAaVdztAh0 KINqxpxX2meGgRihRTPSNbsHZPvrKR04hA/1S0aBfujgC7XuSjx6NNtAqIu/K9Diumfo+EYVc55 aLRPCWGujaSLj0Wxvtq//ZZDhZpyYhOr2a8I+6SINKbQFIWOu0O4vsQm163Ma9STdgm4GUu4C3I SH65AGrWzN0QkH82Fyw== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE0MDI3OCBTYWx0ZWRfX7ty612x0l7PN yb+gmi7bGr2qIRnjkfGj9JzRNf83urNsdIk1fV3z56/U5g5dhIHmkGiJ+S4Z7zvhgUV2XQlDqkf AKC/Ocu/qxrgFaAmsYxp6/75xDDHgdM= X-Authority-Analysis: v=2.4 cv=Zsx4uN7G c=1 sm=1 tr=0 ts=6aa84c62 cx=c_pps a=AfN7/Ok6k8XGzOShvHwTGQ==:117 a=AfN7/Ok6k8XGzOShvHwTGQ==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=Y2IxJ9c9Rs8Kov3niI8_:22 a=VnNF1IyMAAAA:8 a=Z6bpV0tWmYslb40Kif8A:9 X-Proofpoint-ORIG-GUID: P5W7KAmREs5HKvQDcrv-BafTm_lxcwrc X-Proofpoint-GUID: P5W7KAmREs5HKvQDcrv-BafTm_lxcwrc X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-14_03,2026-09-14_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 impostorscore=0 clxscore=1015 priorityscore=1501 lowpriorityscore=0 bulkscore=0 adultscore=0 phishscore=0 spamscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609140278 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=lists1p.gnu.org; Received-SPF: pass client-ip=148.163.158.5; envelope-from=zycai@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, 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: qemu development 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: 1789414553585158500 Content-Type: text/plain; charset="utf-8" Add test coverage for virtio-net-pci network booting on s390x by extending the pxelinux functional tests. This patch adds PCI variants of all existing pxelinux tests to verify that virtio-net-pci devices work correctly for network booting. Signed-off-by: Zhuoying Cai Tested-by: Joshua Daley Reviewed-by: Matthew Rosato --- tests/functional/s390x/test_pxelinux.py | 71 ++++++++++++++++++++----- 1 file changed, 59 insertions(+), 12 deletions(-) diff --git a/tests/functional/s390x/test_pxelinux.py b/tests/functional/s39= 0x/test_pxelinux.py index c00cce6a5a..7223364852 100755 --- a/tests/functional/s390x/test_pxelinux.py +++ b/tests/functional/s390x/test_pxelinux.py @@ -50,7 +50,8 @@ class S390PxeLinux(QemuSystemTest): '/images/kernel.img'), '480859574f3f44caa6cd35c62d70e1ac0609134e22ce2a954bbed9b110c06e0b') =20 - def pxelinux_launch(self, pl_name=3D'default', extra_opts=3DNone): + def pxelinux_launch(self, pl_name=3D'default', extra_opts=3DNone, + dev=3D'virtio-net-ccw'): '''Create a pxelinux.cfg file in the right location and launch QEM= U''' self.require_netdev('user') self.set_machine('s390-ccw-virtio') @@ -74,7 +75,7 @@ def pxelinux_launch(self, pl_name=3D'default', extra_opts= =3DNone): with open(cfg_fname, 'w', encoding=3D'utf-8') as f: f.write(PXELINUX_CFG_CONTENTS) =20 - virtio_net_dev =3D 'virtio-net-ccw,netdev=3Dn1,bootindex=3D1' + virtio_net_dev =3D f'{dev},netdev=3Dn1,bootindex=3D1' if extra_opts: virtio_net_dev +=3D ',' + extra_opts =20 @@ -85,9 +86,9 @@ def pxelinux_launch(self, pl_name=3D'default', extra_opts= =3DNone): self.vm.launch() =20 =20 - def test_default(self): + def do_test_default(self, dev): '''Check whether the guest uses the "default" file name''' - self.pxelinux_launch() + self.pxelinux_launch(dev=3Ddev) # The kernel prints its arguments to the console, so we can use # this to check whether the kernel parameters are correctly handle= d: wait_for_console_pattern(self, 'testoption=3Dteststring') @@ -95,36 +96,82 @@ def test_default(self): wait_for_console_pattern(self, 'Unpacking initramfs...') wait_for_console_pattern(self, 'Run /init as init process') =20 - def test_mac(self): + def do_test_mac(self, dev): '''Check whether the guest uses file name based on its MAC address= ''' self.pxelinux_launch(pl_name=3D'01-02-ca-fe-ba-be-42', - extra_opts=3D'mac=3D02:ca:fe:ba:be:42,loadpar= m=3D3') + extra_opts=3D'mac=3D02:ca:fe:ba:be:42,loadpar= m=3D3', + dev=3Ddev) wait_for_console_pattern(self, 'Linux version 5.3.7-301.fc31.s390x= ') =20 - def test_uuid(self): + def do_test_uuid(self, dev): '''Check whether the guest uses file name based on its UUID''' # Also add a non-bootable disk to check the fallback to network bo= ot: self.vm.add_args('-blockdev', 'null-co,size=3D65536,node-name=3Dd1= ', '-device', 'virtio-blk,drive=3Dd1,bootindex=3D0,l= oadparm=3D1', '-uuid', '550e8400-e29b-11d4-a716-446655441234') - self.pxelinux_launch(pl_name=3D'550e8400-e29b-11d4-a716-4466554412= 34') + self.pxelinux_launch(pl_name=3D'550e8400-e29b-11d4-a716-4466554412= 34', + dev=3Ddev) wait_for_console_pattern(self, 'Debian 4.19.146-1 (2020-09-17)') =20 - def test_ip(self): + def do_test_ip(self, dev): '''Check whether the guest uses file name based on its IP address'= '' self.vm.add_args('-M', 'loadparm=3D3') - self.pxelinux_launch(pl_name=3D'0A00020F') + self.pxelinux_launch(pl_name=3D'0A00020F', dev=3Ddev) wait_for_console_pattern(self, 'Linux version 5.3.7-301.fc31.s390x= ') =20 - def test_menu(self): + def do_test_menu(self, dev): '''Check whether the boot menu works for pxelinux.cfg booting''' self.vm.add_args('-boot', 'menu=3Don,splash-time=3D10') - self.pxelinux_launch(pl_name=3D'0A00') + self.pxelinux_launch(pl_name=3D'0A00', dev=3Ddev) wait_for_console_pattern(self, '[1] Nonexisting') wait_for_console_pattern(self, '[2] Debian') wait_for_console_pattern(self, '[3] Fedora') wait_for_console_pattern(self, 'Debian 4.19.146-1 (2020-09-17)') =20 + def test_default(self): + '''pxelinux.cfg "default" lookup via virtio-net-ccw''' + self.do_test_default('virtio-net-ccw') + + def test_default_pci(self): + '''pxelinux.cfg "default" lookup via virtio-net-pci''' + self.require_device('virtio-net-pci') + self.do_test_default('virtio-net-pci') + + def test_mac(self): + '''pxelinux.cfg MAC-address-based file lookup via virtio-net-ccw''' + self.do_test_mac('virtio-net-ccw') + + def test_mac_pci(self): + '''pxelinux.cfg MAC-address-based file lookup via virtio-net-pci''' + self.require_device('virtio-net-pci') + self.do_test_mac('virtio-net-pci') + + def test_uuid(self): + '''pxelinux.cfg UUID-based file lookup via virtio-net-ccw''' + self.do_test_uuid('virtio-net-ccw') + + def test_uuid_pci(self): + '''pxelinux.cfg UUID-based file lookup via virtio-net-pci''' + self.require_device('virtio-net-pci') + self.do_test_uuid('virtio-net-pci') + + def test_ip(self): + '''pxelinux.cfg IP-address-based file lookup via virtio-net-ccw''' + self.do_test_ip('virtio-net-ccw') + + def test_ip_pci(self): + '''pxelinux.cfg IP-address-based file lookup via virtio-net-pci''' + self.require_device('virtio-net-pci') + self.do_test_ip('virtio-net-pci') + + def test_menu(self): + '''pxelinux.cfg interactive boot menu via virtio-net-ccw''' + self.do_test_menu('virtio-net-ccw') + + def test_menu_pci(self): + '''pxelinux.cfg interactive boot menu via virtio-net-pci''' + self.require_device('virtio-net-pci') + self.do_test_menu('virtio-net-pci') =20 if __name__ =3D=3D '__main__': QemuSystemTest.main() --=20 2.55.0