From nobody Sat Sep 26 19:12:09 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=1790289043; cv=none; d=zohomail.com; s=zohoarc; b=bt5BJQeK7/X1Z3xhQ25/+HbjJMr7UIESd/Hg41Xye2nK0GY1FICxUfwSoDfVHYC2BgAs6WUKVjzyvnKCvJuVfr1N8zjTN9SefLIIESmx0VdIHBCi5VK6yUfJqWWMknWYPvlX1iNLt3+aXZ9mLIdiH8T8V6/g2EhyJ3psjsi0ooQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790289043; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=9mSq6xsBLquNSwtYkM6I7d/zmN6rHC7utExsMJJnObk=; b=W26vpUgQjR7TO9jJ9PvTIQoZ16F1zcVaxyyl/xQcCMlvfssIgmnZNpJ9WtAFBDnQq6l3KTCXLqD26UbQQfHXr1sIzKffRkbeqxuST4bkzEC/pycadU4l88gA+4+oqG+kCNKJP5m6ds/kTWsY/rcVtBACq+F6qdoqyYq5Mx0O4kY= 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 179028904364181.03858257203001; Thu, 24 Sep 2026 15:30:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9rx6-0000OX-4d; Thu, 24 Sep 2026 18:30:04 -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 1x9rx3-0000Mr-KT; Thu, 24 Sep 2026 18:30:01 -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 1x9rx1-0005EI-LT; Thu, 24 Sep 2026 18:30: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 68OJ5o7k2914735; Thu, 24 Sep 2026 22:29:58 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 4gske1u6x1-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 24 Sep 2026 22:29:57 +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 68OIlXLU2515971; Thu, 24 Sep 2026 22:29:57 GMT Received: from smtprelay03.dal12v.mail.ibm.com ([172.16.1.5]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4gvbu8ywa6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 24 Sep 2026 22:29:57 +0000 (GMT) Received: from smtpav04.wdc07v.mail.ibm.com (smtpav04.wdc07v.mail.ibm.com [10.39.53.231]) by smtprelay03.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 68OMTtG111534880 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Sep 2026 22:29:56 GMT Received: from smtpav04.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C180658045; Thu, 24 Sep 2026 22:29:55 +0000 (GMT) Received: from smtpav04.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4FABB58050; Thu, 24 Sep 2026 22:29:54 +0000 (GMT) Received: from fedora-workstation.ibmuc.com (unknown [9.61.83.151]) by smtpav04.wdc07v.mail.ibm.com (Postfix) with ESMTP; Thu, 24 Sep 2026 22:29: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=9mSq6xsBLquNSwtYk M6I7d/zmN6rHC7utExsMJJnObk=; b=p/Pa4OIf9hk3y8ZEhmXgAg1Bb17H01gbW sEpmI8NeIHLzgXSnPBpG9UqV2SzpU8AjH3X/LENvD89tyPlVrhBGkCaCPEzllKGS 70W6CLGHDDHdBkiCTSbiqM+7up4rXaw6KRFW8HHj/1RUSrrl40EmkJJx79wbUS9l 0MqDycj6KM/+q8QdQs86GktfoNyKMIYDcv6DBhHLNzUP+U5BST7uQJGjww+QWIi7 oGMGa2MXMRLO/xIfLYEei1hXAAKHaa4trEU/89i8JHr5RQOiW3qHZJwdVJw44jCX d2cHXK8vsypnTkL4G9l9ZlBwSvgXr2ddtwRipr+BIKij8lv5ROgUw== 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 v5 1/8] pc-bios/s390-ccw: Move CCW net setup to virtio-ccw Date: Thu, 24 Sep 2026 18:29:42 -0400 Message-ID: <20260924222949.147720-2-zycai@linux.ibm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260924222949.147720-1-zycai@linux.ibm.com> References: <20260924222949.147720-1-zycai@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: -vje_wqer_l7A4eBVHkMAq5fGpORCZpp X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTI0MDA5MCBTYWx0ZWRfX3AhuNz+p0Zbl pLLNXv4ia0wZ7gsqREY9EKd7kp6+0p/+oLJRiYR/nCmZk6ayXm+YYXlF4RCgnBc/Igv0NH3Jjin TV+Nhjx/aiIRc+c9luTeCsXd8GaaNak1Q3zKn3qFHDlToazD8QzCaPP8DgqL7b01t7zhM6VAbCN QXVUuE/J4sBVsFjEVvwzl+NSiCEO2zEfW/qZpPhLBervaLerIO9J0bBRZhbqLtiflEYTOOHQUeL w1VmeZrhXj9wpjMAecH8KhuTC845XcfP+Ma8QA14z0HnN63SDCnY+uuDp2ILorrX+3hb2bEqLuj OCr0xRCHG9y6uM4rRB0wTG3vdPVTKv6M7pLB1LYfDWRmIj+KXmQ731TwNiQ7gTfYi9bKx9pW2/q PqAU7wdGDkqOxoUMxmHrIbxSXE8REPXu/OLLcL5OVheMB1ebq/quvpcLh1L93Q87rAOFcaeT76P i+4GGRdlaCC/vMmhnXA== X-Authority-Analysis: v=2.4 cv=O/KsLx9W c=1 sm=1 tr=0 ts=6ab5a465 cx=c_pps a=5BHTudwdYE3Te8bg5FgnPg==:117 a=5BHTudwdYE3Te8bg5FgnPg==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=Y2IxJ9c9Rs8Kov3niI8_:22 a=VnNF1IyMAAAA:8 a=Aak0X9c2SgglYLKd_28A:9 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTI0MDA5MCBTYWx0ZWRfX07N5TM/b2Ydt EVU/BTciDgR9qgK+G4cS7aSUgJt/cB5Q7MXpFYEpI9oAOkymUaZOmQyHv9mRbCBiralN1iC6QfT 1t9dKySUDUq3PqbNiaxbOpJ+gDzDN/U= X-Proofpoint-GUID: -vje_wqer_l7A4eBVHkMAq5fGpORCZpp 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-24_05,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 phishscore=0 impostorscore=0 suspectscore=0 bulkscore=0 priorityscore=1501 lowpriorityscore=0 adultscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609240090 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: 1790289045611158500 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 ea5dbc2857..3c2c44529c 100644 --- a/pc-bios/s390-ccw/virtio-ccw.c +++ b/pc-bios/s390-ccw/virtio-ccw.c @@ -220,3 +220,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 43d21906e5..7768c152d0 100644 --- a/pc-bios/s390-ccw/virtio-ccw.h +++ b/pc-bios/s390-ccw/virtio-ccw.h @@ -19,5 +19,6 @@ bool virtio_ccw_is_supported(VDev *vdev); 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 19:12:09 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=1790289082; cv=none; d=zohomail.com; s=zohoarc; b=gG4s49ks2E6axr717pchXjq+wmTG41aBU/WhHSSGQ/0csgeDEv2SuChx7Br0FmtEaxQzRbpUe9BQBAUUqYCsrSnWrqJPJoAf4HgJOHzQXCsMfJgQ4VgwxyZDYCZPB8LUZ5r3VMnROpyjXFn6DU56UFZ4ZSlKM2zov2fxQBHjB8c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790289082; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=rK/0SNz/xNRIB8TKTK28NP04er4SUxDCeruO5YF/oVE=; b=RcGvWNiem88uoPKlan5EcQQqjolMlvg9NXQDyOaE7unwKAlzJlDnxRmRxdw+fqKkDTKRGShEsmp+RoDbW0rf+zDb0TfSz6I6R92TV2e8drJcwQHLl/9WlQlKqc4moEdM6mH8wBSe0SZzMjVB5rBDTLKwrN5Bsyizs/S5KY65LCM= 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 1790289082622875.9613769478069; Thu, 24 Sep 2026 15:31:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9rx7-0000PX-O2; Thu, 24 Sep 2026 18:30:05 -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 1x9rx4-0000Nh-Vf; Thu, 24 Sep 2026 18:30:02 -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 1x9rx3-0005ET-1V; Thu, 24 Sep 2026 18:30:02 -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 68OJ5o7l2914735; Thu, 24 Sep 2026 22:29:59 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 4gske1u6x3-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 24 Sep 2026 22:29:59 +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 68OIlZhM2515991; Thu, 24 Sep 2026 22:29:58 GMT Received: from smtprelay05.dal12v.mail.ibm.com ([172.16.1.7]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4gvbu8ywa8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 24 Sep 2026 22:29:58 +0000 (GMT) Received: from smtpav04.wdc07v.mail.ibm.com (smtpav04.wdc07v.mail.ibm.com [10.39.53.231]) by smtprelay05.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 68OMTvPt25559612 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Sep 2026 22:29:57 GMT Received: from smtpav04.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 63BF658056; Thu, 24 Sep 2026 22:29:57 +0000 (GMT) Received: from smtpav04.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E99F258050; Thu, 24 Sep 2026 22:29:55 +0000 (GMT) Received: from fedora-workstation.ibmuc.com (unknown [9.61.83.151]) by smtpav04.wdc07v.mail.ibm.com (Postfix) with ESMTP; Thu, 24 Sep 2026 22:29:55 +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=rK/0SNz/xNRIB8TKT K28NP04er4SUxDCeruO5YF/oVE=; b=pMS1HtaG3oa4aGcbjxyFXHJzluAlouR3o gE7BRnfJW6I67g0mlGYN2stk3mo/lyZWs8Pawkf2LK2hgs4tnLHsrdda0aZkd+LS LCsejjTrGksOoG7lNLZBkpF+izmm6Smockb9NzLa6wuzbTLUJJP2UwoMByjKT6jl nsPPyIBCYDlQxUpCwxsdAf13ANldc/uM96r6+ggX7mgWrT3NXdPK7mdoMgkDXFI2 dgy6eDKl0xVB1+pqgE8BvdsnDnP8REIjlbX2cFBUhipxBY5oUC3UOrg5yuuDx26i z0GAuIi+/tov5VJjeOppmS6UVCqkQvLdgw7/DTODd5DTLb4OxgMyA== 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 v5 2/8] pc-bios/s390-ccw: Add dynamic net header size handling Date: Thu, 24 Sep 2026 18:29:43 -0400 Message-ID: <20260924222949.147720-3-zycai@linux.ibm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260924222949.147720-1-zycai@linux.ibm.com> References: <20260924222949.147720-1-zycai@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: MOi0xBmXcam55ZjCTPOLB3sWAz01ykLO X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTI0MDA5MCBTYWx0ZWRfX89twY2DBrwYO zszmDn96CAmstaTQEMK4CKkMGfoeEgcmWvTwbZlGwDUCTzIgtrPsLOJj4YQ5F0DKK3bXSvAkz/N pHKdxsAXRWTKbqjVVi7iz8sjHTRW2QwmDRZTURa5qav/p6Ufm1LB5n82i1zzNbxX5fXZ2Y+7PO4 bA6ee9cHkRQN8tVauOmpy8eVmmW0Nxd2bXG6AocThYwNE7h3L4th0RwlJVoVYnzfjXGdFs4c0qj mOtZq1SCH2z3Ew2Ew/Nj4NtYZ/9NFFZLtQEot0Q+jM/dwKMqVDyXSFRgNIfzgDQqpqlZx8YIfgJ MJPGgozITqlkxlE4XSai6bCTAcNySkdbLrX/Y99hLcn+9WrLeYYi/dw/kyC29ad4S2lYm/9B0QX FRswXP/QL2kOwGqCmjVv2sXW+wwztYdt/9tuEa1ixrhds14G+cVx6i7atLsA2XEA+cDiKxJ3vPy JRA4ge7/J2z2Ky//t6w== X-Authority-Analysis: v=2.4 cv=O/KsLx9W c=1 sm=1 tr=0 ts=6ab5a467 cx=c_pps a=5BHTudwdYE3Te8bg5FgnPg==:117 a=5BHTudwdYE3Te8bg5FgnPg==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=Y2IxJ9c9Rs8Kov3niI8_:22 a=VnNF1IyMAAAA:8 a=b71jbalOAXEqY8vE3Q8A:9 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTI0MDA5MCBTYWx0ZWRfXz4PIvPLyqBLV loOtCJJN9X/NsMCBFDggl7w/Bmy4T5zwkGh+z/9FqKCnHzrydx9R+UH3WuGPlRdQ5KWPVeay01e rpXz02uhxZdESTa3kUJiQF+0r+7JgYk= X-Proofpoint-GUID: MOi0xBmXcam55ZjCTPOLB3sWAz01ykLO 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-24_05,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 phishscore=0 impostorscore=0 suspectscore=0 bulkscore=0 priorityscore=1501 lowpriorityscore=0 adultscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609240090 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: 1790289085014158500 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 include/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 | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/pc-bios/s390-ccw/virtio-net.c b/pc-bios/s390-ccw/virtio-net.c index f58f7ffc55..7bb3f8f551 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 @@ -39,11 +40,21 @@ struct VirtioNetHdr { uint16_t gso_size; uint16_t csum_start; uint16_t csum_offset; - /*uint16_t num_buffers;*/ /* Only with VIRTIO_NET_F_MRG_RXBUF or VIRTI= O1 */ }; 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 +73,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 +92,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 +123,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 19:12:09 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=1790289046; cv=none; d=zohomail.com; s=zohoarc; b=lnV+5q4B4hg1VLwYO12/HDiI68h6YHrZgV83epUpEpY9OLUhCDIB4MSElt3eI2dJoi/LL3bj6EJxBfM3dLiqd1y9KrJvToePHwGoWJcpBeCR9dDOWXR6BosaAmmA1VjaL/WawgfOGtML2HbpeosioMDHVozPmZWo6NkGopJUc5M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790289046; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=P6tbl9NdtovYKBprjLeqduLPRTuwn7kGUjAvElXustY=; b=E3qxrwJgqsxR9b+voG/AbZpDDSA/f+FygXiZ4K7YM6sDfmSel2vhYyQeNguQXBi55bvlIVZdIkd9ehCJitRDjQtTfqcyxr0nS79v0IySV9NOGb03mob8YvMUqehkUl4qbUt8qN7P/aoNJAEl1czts9QIZtf4Bd9v0y08dk5PkFs= 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 1790289046117498.5128409030391; Thu, 24 Sep 2026 15:30:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9rx9-0000QJ-Qq; Thu, 24 Sep 2026 18:30: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 1x9rx6-0000Oi-K5; Thu, 24 Sep 2026 18:30: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 1x9rx4-0005Ez-RC; Thu, 24 Sep 2026 18:30:04 -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 68OJ5Z6J1896355; Thu, 24 Sep 2026 22:30:01 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 4gskgqu27v-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 24 Sep 2026 22:30:01 +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 68OIlYg02521591; Thu, 24 Sep 2026 22:30:00 GMT Received: from smtprelay07.dal12v.mail.ibm.com ([172.16.1.9]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4gvbt2yws3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 24 Sep 2026 22:30:00 +0000 (GMT) Received: from smtpav04.wdc07v.mail.ibm.com (smtpav04.wdc07v.mail.ibm.com [10.39.53.231]) by smtprelay07.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 68OMTxdc30933690 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Sep 2026 22:29:59 GMT Received: from smtpav04.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3093F58052; Thu, 24 Sep 2026 22:29:59 +0000 (GMT) Received: from smtpav04.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8B8B358045; Thu, 24 Sep 2026 22:29:57 +0000 (GMT) Received: from fedora-workstation.ibmuc.com (unknown [9.61.83.151]) by smtpav04.wdc07v.mail.ibm.com (Postfix) with ESMTP; Thu, 24 Sep 2026 22:29:57 +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=P6tbl9NdtovYKBprj LeqduLPRTuwn7kGUjAvElXustY=; b=nh9APYywByJKj0qT35mVlLfy/KLvjVvdW 8c5Dl4TM/3l50cd3XnTtzHTvT504yP++2sz7DZMtDBSva0wLgFJh6Ft3VpnZT6sd lIMoSsZ2OVzm3pPXofAX/JpFUCfRJuSKYhYjE4s9JKuw9ZoHoqLNGhasqzBPNQyM J670vdLj29o/0wOxV4o/JJSOW6BugrrjgsX9CxiGWzEPii61pFQ7mhL0e7NkF27f L1ttyQednM0Sd8J0FgD1g8yswVAmQwIkITZL7+LLrW/FRYL6nGp+D6MC4CSLRybM VmvarS26V/QWrNpkp8lHkvWf4woYHZD9jaRdkLS0qk8H4+qi/J8fQ== 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 v5 3/8] pc-bios/s390-ccw: Introduce virtio_tswap helpers Date: Thu, 24 Sep 2026 18:29:44 -0400 Message-ID: <20260924222949.147720-4-zycai@linux.ibm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260924222949.147720-1-zycai@linux.ibm.com> References: <20260924222949.147720-1-zycai@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Authority-Analysis: v=2.4 cv=G+OJgNk5 c=1 sm=1 tr=0 ts=6ab5a469 cx=c_pps a=GFwsV6G8L6GxiO2Y/PsHdQ==:117 a=GFwsV6G8L6GxiO2Y/PsHdQ==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=V8glGbnc2Ofi9Qvn3v5h:22 a=VnNF1IyMAAAA:8 a=nmTm2IjeaI_QYA0BkewA:9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTI0MDA5MCBTYWx0ZWRfX+td506oS+SRu OFkD23zzXbekrG4NSKiIqGcYhVD1a8rykeyur6Vi0pmbkqe+lFIbFMSjexDOsq82qwMMNSPjZpe WlSvCiIjZ1NkUoDFMG+1kAXGRenAvcgqrt865Q8JHxakzx1nl4Hakuli2KzYlSz8OIpX3GidWj0 iU0CHmx0swJIt5snoFCXixqFUGyFl1EOf7REO2oSdSr3R0g1v9z7dlBKrvwwoe7WnbNBZIh9HY3 64PiPxS16z/+zJ1ks19nw1ICqRMOGKsFTk+Wcm8lcHny1iD7nuA0qe8ILQh9O3vxrtny8xp8Tyn kDRr/6XdydSk48rh1qWRcGQ2ZV/7um6qHFfSW5fVCBfEouNoqfuUy5YuimtmKWInX4J4pq4s0/M /OvRF6hS4o4rWOsiO/JROezpM343ZYTJ0+kxTdT8l/yhXLh4PvQbRw6jd4vXs+V2sUUOWYVLlJ/ li5wffldZWKBZqAQmQw== X-Proofpoint-ORIG-GUID: gSWhgu9c46V_0pG26Y9rIBf8eigdjaO9 X-Proofpoint-GUID: gSWhgu9c46V_0pG26Y9rIBf8eigdjaO9 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTI0MDA5MCBTYWx0ZWRfX/P7Wnk8q1AFg 8+nd++uMDLHhmzrLpa+JNlXqvL2g9flqqdhw97sl6f3/wf4hHXCunr92rvLSu5hX4ej1ibjGwZR Drsc1ilp3T4rGJEnM3VO7hwOLk8k4+c= 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-24_05,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 phishscore=0 lowpriorityscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 clxscore=1015 spamscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609240090 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: 1790289048792158500 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 34c5e6ee22..8949e6c7c0 100644 --- a/pc-bios/s390-ccw/virtio.c +++ b/pc-bios/s390-ccw/virtio.c @@ -102,7 +102,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; @@ -143,6 +143,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 @@ -159,12 +175,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; @@ -182,7 +197,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 @@ -190,7 +205,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 19:12:09 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=1790289104; cv=none; d=zohomail.com; s=zohoarc; b=l28VDo1i1FZPNsv3HL0/qROqwb288qqKi/S513Nzs/jOm0zpE5kqZlBnACNP6id48sp3CjHoDrjvQpKa7/vMRjTyiQNzYGw/2um57S9mdTXATF+chgWCzGxxA6apW+xTcOJ8i4p7DFz/drwjle986FwRYxhEC5seL0QFRUpfyWI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790289104; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=AzO8g3G7d2J5+RCHQz7DuaWf/NBS+CeNBU/Y/7HMVUc=; b=aS/nOD7NXI3S+sYe+DrAwylLv1TvvF6yrcp4NDxajBTXWadSsitdmqROYdE1tJ8tSrZQCpqCXb4wn9IpsnBdctLY9I0h5b7tnhMlxQ7f39oNRDSQvPOq5rPHVrbQIo1HZjZE/d7Neq1GKedTCnsGJ3Bsqnxv6OzktO0jHrFedEw= 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 1790289104624803.1609198095738; Thu, 24 Sep 2026 15:31:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9rxC-0000Rl-Pr; Thu, 24 Sep 2026 18:30:11 -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 1x9rx9-0000QE-A9; Thu, 24 Sep 2026 18:30:07 -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 1x9rx7-0005GE-7x; Thu, 24 Sep 2026 18:30:06 -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 68OJ5Vn91201917; Thu, 24 Sep 2026 22:30:03 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 4gske23xr7-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 24 Sep 2026 22:30:03 +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 68OIlXfp1233805; Thu, 24 Sep 2026 22:30:02 GMT Received: from smtprelay01.wdc07v.mail.ibm.com ([172.16.1.68]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 4gvu7ec7u5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 24 Sep 2026 22:30:02 +0000 (GMT) Received: from smtpav04.wdc07v.mail.ibm.com (smtpav04.wdc07v.mail.ibm.com [10.39.53.231]) by smtprelay01.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 68OMU05c52887874 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Sep 2026 22:30:01 GMT Received: from smtpav04.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C872558050; Thu, 24 Sep 2026 22:30:00 +0000 (GMT) Received: from smtpav04.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5D13258045; Thu, 24 Sep 2026 22:29:59 +0000 (GMT) Received: from fedora-workstation.ibmuc.com (unknown [9.61.83.151]) by smtpav04.wdc07v.mail.ibm.com (Postfix) with ESMTP; Thu, 24 Sep 2026 22:29:59 +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=AzO8g3G7d2J5+RCHQ z7DuaWf/NBS+CeNBU/Y/7HMVUc=; b=LqjTYE/OX7lt2VPCU1C9MnLFSnWi4u6Em DZmYEcqNtWrujXL8iQgVDz4OWRAeqfH/VlFkj9A+kMTdmJ0Ch9GLNoco9BOHFAlL oRrTfJ5oPMXUuAYNmrAr8WxF/XEAr83YYyjUeovzkHOZQDITCazTOXTXgNDKw7sj jQzkqz36Df6bS/yNGaHi6UyqvO8c4UwHl3RcRB0tLSAvzLkLJDZx7aWZnL2xDNVZ qDL3ePYbRDx1kmLEr7Eyb9ULyoukeSc8PYO+dKXgYLfpYib0IeYb0Xz4T5xIh6Lm jRO+xaNkvFlO38wiRxVzyC56O2lnKsFlXikfFzu8MMe4HRORCg5pA== 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 v5 4/8] pc-bios/s390-ccw: Add support for virtio-net-pci IPL Date: Thu, 24 Sep 2026 18:29:45 -0400 Message-ID: <20260924222949.147720-5-zycai@linux.ibm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260924222949.147720-1-zycai@linux.ibm.com> References: <20260924222949.147720-1-zycai@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: V_t2fCJaeS8SfxjuDMAzBO7hkYgzU1l5 X-Authority-Analysis: v=2.4 cv=EOCTQFZC c=1 sm=1 tr=0 ts=6ab5a46b cx=c_pps a=AfN7/Ok6k8XGzOShvHwTGQ==:117 a=AfN7/Ok6k8XGzOShvHwTGQ==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=uAbxVGIbfxUO_5tXvNgY:22 a=VnNF1IyMAAAA:8 a=ctsVLiZ_AAAA:8 a=Iu4lfvU6lRjo1WYjJIoA:9 a=3VCIHQLkQthbvTRuo98s:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTI0MDA5MCBTYWx0ZWRfX6/eT0eSwoNv/ omf7+ScWnMrhHX3CC+G0DrCKPYjSsUZrOG24oyZ4+Up+w5EuK06h7dmM3nOLZveyGwu4KN/TB5g dL5BC7zvA+Okrjlf2yNUca10s0k34GE= X-Proofpoint-GUID: V_t2fCJaeS8SfxjuDMAzBO7hkYgzU1l5 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTI0MDA5MCBTYWx0ZWRfX0E+RimakV6ln BGxp6ZHkqTbSlF8FT/5zj7tVDK87a83SU4Q6mGZKvsERuannBWhZwjUC5VeDvbtv1CpYxr5aVPC DcITpmsAmVeZCvzSgkIEGWOOWTzC/uN5XNVvQax8b3mo/VHgAO1i3x3X0C6u+ba6QaUftjALWr0 hxVSyNRimanhB3EoYMFm4smWUfGA0TKpRVYoMbXtbvDTNqeIxyeFZuqes2PhSZ0k8ghNX69A4ie pSdrsHQynrvKQaV1mDStKAKdgtT/wOz/Vnf1SypRk1KDa4hqJzyOeO0WVXODqyBOPyA422mHbLX U1PpOznu3ZtFBkrnjKfkdHUZAAVIrJone3H/Q4YVdvVgL1WwBGnZFdWKfG6MF6DlTf4iFiDVP/D KcntIljLYFjW2pTD7cye7dfZqJ3MloTt8MRXdvgmgfhggf1Pk2ojfHCZ5HqN41lW6Ol0hJECduV KFRzQBLU2+sxlrUxZSQ== 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-24_05,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 phishscore=0 priorityscore=1501 clxscore=1015 spamscore=0 adultscore=0 impostorscore=0 lowpriorityscore=0 suspectscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609240090 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: 1790289104977158500 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 | 2 ++ pc-bios/s390-ccw/netmain.c | 8 ++++++- 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 d2a2ac3138..b06d67c563 100644 --- a/pc-bios/s390-ccw/main.c +++ b/pc-bios/s390-ccw/main.c @@ -342,7 +342,9 @@ static void ipl_pci_device(void) return; } =20 + /* net, scsi, and block all intentionally use the same shared boot set= up */ switch (vdev->dev_type) { + case VIRTIO_ID_NET: case VIRTIO_ID_SCSI: case VIRTIO_ID_BLOCK: if (virtio_setup() =3D=3D 0) { diff --git a/pc-bios/s390-ccw/netmain.c b/pc-bios/s390-ccw/netmain.c index bcb62bf6ca..dd02c5c71f 100644 --- a/pc-bios/s390-ccw/netmain.c +++ b/pc-bios/s390-ccw/netmain.c @@ -498,7 +498,13 @@ 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 need specific net setup; the virtio-net-pci devic= es + * still follow the regular Virtio, PCI, and generic network setup. + */ + 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 7bb3f8f551..632ce059d6 100644 --- a/pc-bios/s390-ccw/virtio-net.c +++ b/pc-bios/s390-ccw/virtio-net.c @@ -66,7 +66,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"); @@ -118,22 +133,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) { @@ -147,8 +170,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 277c3ea68d..eb47e7c534 100644 --- a/pc-bios/s390-ccw/virtio-pci.c +++ b/pc-bios/s390-ccw/virtio-pci.c @@ -56,6 +56,10 @@ void virtio_pci_id2type(VDev *vdev, uint16_t device_id) case 0x1004: vdev->dev_type =3D VIRTIO_ID_SCSI; break; + case 0x1041: + case 0x1000: + vdev->dev_type =3D VIRTIO_ID_NET; + break; default: vdev->dev_type =3D 0; } @@ -223,6 +227,17 @@ static int virtio_pci_get_scsi_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; @@ -355,6 +370,7 @@ bool virtio_pci_is_supported(VDev *vdev) switch (vdev->dev_type) { case VIRTIO_ID_BLOCK: case VIRTIO_ID_SCSI: + case VIRTIO_ID_NET: return true; default: return false; @@ -414,6 +430,10 @@ int virtio_pci_setup(VDev *vdev) vdev->cmd_vr_idx =3D 2; virtio_pci_get_scsi_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 19:12:09 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=1790289117; cv=none; d=zohomail.com; s=zohoarc; b=fVIucH0rmUMJ/DRLIHsnPssddkBXcp7UlvaJZuOJI1TgDK5IIWlS7s+4OJ61lICVJZBlae67K7DG16xutVcItgHhQWAwAjGvIzYvhID5kjRxwyAy+NAEJCZ4qd+Z2TyYDe9+GMsqRw3mhTkYYcF+DM4TudXz4meADjtJzzJlbcw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790289117; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fQzxeG2c1QXfVbNWBr0gRpg7Ovvr7j78tqpuR5tkQSc=; b=jVoYuodWp/D2krRYIfq5v2vrm5HmOwfn6YCfRGSS8/7eSeFBncaoAz6LCFum5hiWxMNo2LnQWdhO99h5HD2db+uWGtlAchDsZ6bpmMl4qLgD0FhVg4+7Fu+fyF6Xd1yunmRqky478Zyz0v925Ues3tj8CKwpUgwnLXvNSsMvntc= 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 1790289117891309.9410983019011; Thu, 24 Sep 2026 15:31:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9rxE-0000Sv-5A; Thu, 24 Sep 2026 18:30:12 -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 1x9rxA-0000RA-Nv; Thu, 24 Sep 2026 18:30: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 1x9rx9-0005GY-0B; Thu, 24 Sep 2026 18:30:08 -0400 Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68OJ5MHf3067959; Thu, 24 Sep 2026 22:30:05 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 4gskgskvsd-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 24 Sep 2026 22:30:04 +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 68OIlVeR1233754; Thu, 24 Sep 2026 22:30:04 GMT Received: from smtprelay03.wdc07v.mail.ibm.com ([172.16.1.70]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 4gvu7ec7uc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 24 Sep 2026 22:30:04 +0000 (GMT) Received: from smtpav04.wdc07v.mail.ibm.com (smtpav04.wdc07v.mail.ibm.com [10.39.53.231]) by smtprelay03.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 68OMTIJq23593660 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Sep 2026 22:29:18 GMT Received: from smtpav04.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 77EF658050; Thu, 24 Sep 2026 22:30:02 +0000 (GMT) Received: from smtpav04.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F055A58045; Thu, 24 Sep 2026 22:30:00 +0000 (GMT) Received: from fedora-workstation.ibmuc.com (unknown [9.61.83.151]) by smtpav04.wdc07v.mail.ibm.com (Postfix) with ESMTP; Thu, 24 Sep 2026 22:30:00 +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=fQzxeG2c1QXfVbNWB r0gRpg7Ovvr7j78tqpuR5tkQSc=; b=CR/u0/PzHQ9CadcJP2SCbnEXeHo6YHJKn uqCDTQDz1V/uasQbra3QNbcGBDNu9g7V+jz547D3KzJxmFs3/vekBXBCVVSr/Uwf YalMz2hdixGW8zbyfo8rLFLEYsy295Qusd7ep7hM9fSv1/en897Ppoy7PfigZMVm v8AAT8KRCznKP/MqHJir1XtnbgLKHCyXO+1MmeURG0rG4pY+XUiV7AThcacy9Qbc fQbc3ciYf5bYf6ZLQT34VUNdjOypLv96RREV6nM+fMBd15IbbDDb8KgLUh4K2Xab +loB3SEvbBFmXjazqu98NoznFgBllntIe3d2slHsEUmBWQGbSdt4Q== 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 v5 5/8] hw/virtio: Add "loadparm" property to virtio net PCI devices booting on s390x Date: Thu, 24 Sep 2026 18:29:46 -0400 Message-ID: <20260924222949.147720-6-zycai@linux.ibm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260924222949.147720-1-zycai@linux.ibm.com> References: <20260924222949.147720-1-zycai@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Authority-Analysis: v=2.4 cv=V/XoQuni c=1 sm=1 tr=0 ts=6ab5a46d cx=c_pps a=AfN7/Ok6k8XGzOShvHwTGQ==:117 a=AfN7/Ok6k8XGzOShvHwTGQ==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=U7nrCbtTmkRpXpFmAIza:22 a=VnNF1IyMAAAA:8 a=LEpY8eO1VcgwfWkpOzsA:9 X-Proofpoint-ORIG-GUID: iPR7ASzQdQzw4P6Mzie5TIgye5lrqhYL X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTI0MDA5MCBTYWx0ZWRfX4CfBHuCKAhl+ ikPxGEl82x0ckbgqK3cOw390WBg4hnUIa0JhesVXKGMOgn5BgJyDdn4cIapk8q+HPNvw6m8qbCR Uwa8452P5DQrjwQJKi+vVRhSYyBpj2/L31Qux2DRJSArKo6nN/1BdFJZqEqN9fSFvKyKLRSGj4e 4XgqRNPahjNwZvkoCIbgw4FXbjl86c64vPrnftOl9ziw8TuoGneLf4VS3HHs/eZThh2z9kY1LHu PVlhLQ60Tp3rLSH1kOVD+ZjUBrbNTJ1EGjS5NWJP8hItiLRBRZdaHdV0ZNr55Mz0eOmZFR2DhH4 0wZ9iUb/Uj96ENuhz9PIKjzCTp3Fn9XtLyy1GbcMsrVBbfUrpIOpfdogTWpqIfZ+yuykbM81gJN Zst+HYqRrsq28xDuAnlmo8NBbr7qkJg/329nQqCpaOgC+nUNO9Q3ud4BQUgoZAnmYtmqF2MQKXM sp//PG6/BpTLm/lwtug== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTI0MDA5MCBTYWx0ZWRfXy3BQo9a4C47W +4LCN2d6t1k4xl9v+ogekAJpl+8GvPi+/HPWSvpUhPmKM240D5FT7WFn1xd17MLyBsrPW5NGW0S CFpZiyFhWvNuiUEKjz2d3kNFjdte9RQ= X-Proofpoint-GUID: iPR7ASzQdQzw4P6Mzie5TIgye5lrqhYL 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-24_05,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 spamscore=0 malwarescore=0 clxscore=1015 phishscore=0 bulkscore=0 adultscore=0 lowpriorityscore=0 impostorscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609240090 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: 1790289118966158500 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 19:12:09 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=1790289095; cv=none; d=zohomail.com; s=zohoarc; b=BWjQOUQ1XIJl2lhYvb3SK7S6fy9698Fems11Z0HMx+fbe2MYVLpZD6PdJpcITWDC6NXXEbnQPqAdRaS5ynCT72zBVy9KB0NmbJpVOpHVdH8U3dJj4aekvC7rJIA6ubNVUX6uDdmcOf9MMZO+jy+MWMp5WaEBa3gGmCgmJEMtRpA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790289095; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=zccov/aqvkVKwzqMFrG44/iDnccBJN4KVKdjFmsBSCo=; b=QKCPexn9kkg9ftjpz6wPXaNTtfyhs4ai3JkdZRLcCJ1q/zVDpJs6eCWD8qS8omAZ58YPoKaDTfj2hvgvOBSJ6UcKm16SPUIuTvnr9CPOxpeTeizUpmC+OvNZszOZs+/QefSwnGPmdl1Dkp2rYjURgNxN1xy6e+N/+/0+Qo5XyUI= 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 179028909568710.032011072832233; Thu, 24 Sep 2026 15:31:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9rxG-0000TO-4g; Thu, 24 Sep 2026 18:30:14 -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 1x9rxC-0000RS-79; Thu, 24 Sep 2026 18:30: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 1x9rxA-0005Gm-3G; Thu, 24 Sep 2026 18:30:09 -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 68OJ5jR03079484; Thu, 24 Sep 2026 22:30: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 4gskg2v1pa-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 24 Sep 2026 22:30: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.11/8.18.1.11) with ESMTP id 68OIlbjd2516022; Thu, 24 Sep 2026 22:30:05 GMT Received: from smtprelay05.wdc07v.mail.ibm.com ([172.16.1.72]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4gvbu8ywb1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 24 Sep 2026 22:30:05 +0000 (GMT) Received: from smtpav04.wdc07v.mail.ibm.com (smtpav04.wdc07v.mail.ibm.com [10.39.53.231]) by smtprelay05.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 68OMU46n12321534 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Sep 2026 22:30:04 GMT Received: from smtpav04.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 24BF158054; Thu, 24 Sep 2026 22:30:04 +0000 (GMT) Received: from smtpav04.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A50BF58045; Thu, 24 Sep 2026 22:30:02 +0000 (GMT) Received: from fedora-workstation.ibmuc.com (unknown [9.61.83.151]) by smtpav04.wdc07v.mail.ibm.com (Postfix) with ESMTP; Thu, 24 Sep 2026 22:30:02 +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=zccov/aqvkVKwzqMF rG44/iDnccBJN4KVKdjFmsBSCo=; b=c4R4yqooyPsmYRTM6/mwZk8W9hSFvtaP3 x7WyiML+iB4ZTepkGAeLNrJozi8xCvKFXgfGHKx/a3qjmVwhKcMGCqzOU8Md8rhG +jaMw+Oh7efFAtW7SkfjnfC2PlHPeCrcYqMXWY5ye01cPglZF+izXUy74qf4gPIc SKF+j4ET+cXZEGLVRgCXLbaBN/Bv3zi0dinYgl//0tX+3t/8gMzK6kgdOsIuDUbP Uv8Xms+N/2sXlINXP6lM/qj8dMhQcUptnYM0upHrgt74V9DqrP3bYJEJFQr2ew7m II9+7s5TC4Sfu2hs/ZUbboYcJlLaBCt/ANSrIdTw9W2/utzbdhMHg== 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 v5 6/8] tests/qtest: Check s390x boot device support in pxe-test.c Date: Thu, 24 Sep 2026 18:29:47 -0400 Message-ID: <20260924222949.147720-7-zycai@linux.ibm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260924222949.147720-1-zycai@linux.ibm.com> References: <20260924222949.147720-1-zycai@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: n-QSIO0x8noGglAWFXRPUgHQRuUhjz25 X-Authority-Analysis: v=2.4 cv=I43w19gg c=1 sm=1 tr=0 ts=6ab5a46e cx=c_pps a=5BHTudwdYE3Te8bg5FgnPg==:117 a=5BHTudwdYE3Te8bg5FgnPg==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=iQ6ETzBq9ecOQQE5vZCe:22 a=VnNF1IyMAAAA:8 a=uBPJ6fAX7Dlw_A6SEmQA:9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTI0MDA5MCBTYWx0ZWRfX4KQfVpbYV5Ml jeMldErSKCpccLvbk6m8LKG4i4GGwwfyZrqH2anTTVr2yrBhTAzQ7XxqIB1iiagie0nGfbWl649 ikl2L/ifon5OosGVs1zZqQqtbcIbJckWZO6CDFr7Npnu4vq+VsJbdqmlQM/kwM1dfIPIo3iCOqj ZlBWQAYd88lvB3BJz0OTq+QXnvz294rIu0VZBU01PGzKQNbAp7oRE9cDy+ypC5GyKhSQP5pWIiN JQl0iIaHVmgcL7hShJ4PPOxmdE+vIXwPYjhKVEhgDx+52x8DS2d/Wqbh5KRkk1nPjhCCGW6k5Uu abcA6HAoKIjAEiyvO1KYxfggnwXUhKaATQX8BJTlwmEerpi9IeymJVFfdNGoPYxwrD2E6NSqYAf C2HhzXnfhxeSTRo8LFjhjS2uYN6rmi5IOvUXzIGIUjv0nJGsoRXh9Zw3mp6T8i3EKhNIVZvG8zU IZiqPgvlGcPZGRqNz/w== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTI0MDA5MCBTYWx0ZWRfXzbZV9EwwpG3C qdbYlwo1JtQoh9eh3Ew5BaIhusslRwH5n1LrwznU1Nqv5gWQ1iKhw3o8k9zz4NBWJzCgIgEu6se bTh40DGfVJNHJlvEY8YBR5GC/c7CE8w= X-Proofpoint-GUID: n-QSIO0x8noGglAWFXRPUgHQRuUhjz25 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-24_05,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 clxscore=1015 adultscore=0 suspectscore=0 impostorscore=0 lowpriorityscore=0 bulkscore=0 phishscore=0 priorityscore=1501 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609240090 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: 1790289097012158500 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 Reviewed-by: Matthew Rosato --- tests/qtest/meson.build | 1 + tests/qtest/pxe-test.c | 85 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 85 insertions(+), 1 deletion(-) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index 33f58b0e95..341f6ad1ba 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..5c6415b936 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,80 @@ 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 in bios", needle, found ? "found" : "not fou= nd"); + return found; +} + +static bool s390_bios_has_net_ccw(void) +{ + /* + * Assume that netboot support always includes virtio-net-ccw support. + * Check only that netboot code exists, rather than probing virtio-net= -ccw + * support directly. + */ + 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 +163,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 +175,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 19:12:09 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=1790289052; cv=none; d=zohomail.com; s=zohoarc; b=WP2fXyit0MX/0XvvXvAtn3SYmjltdFDw0s1t+Vms83bYffBTHxMbZXLLFa5ioyjIiAhlu05D6UIvWI0wmUmGCjiLUTX9Iohdo1ztQOLKjyRXAEn4xzFmobaQ7qkvBEr04XTSWlvq5KxmUzE5OhFnopbdMKXMSniIQm31gWlzxpU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790289052; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=W28NPNIANLUNQGp3IkCc6Izx8YgJrLiCy/E8HZaJJL0=; b=D2v8EazU/yWSVfauHtb87fX1ANHaKOuOjObKjHmOo9bBItf0DVSkgFH55PJxfp7SzBihOyZifYc+xgyrYGVUaCAqOzpe1uQYxXogS9oKxatOEkh5QpMbY/HZ/2GnH0k0yWGvDCt5el+k9OwjjduG6c8W8+U2BLMq/+GyWixGmbs= 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 1790289052489359.44678119211244; Thu, 24 Sep 2026 15:30:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9rxG-0000Tx-RU; Thu, 24 Sep 2026 18:30:14 -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 1x9rxC-0000Rm-MR; Thu, 24 Sep 2026 18:30:10 -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 1x9rxB-0005H4-0h; Thu, 24 Sep 2026 18:30:10 -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 68OJ5mhS1896649; Thu, 24 Sep 2026 22:30:07 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 4gskgqu28u-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 24 Sep 2026 22:30:07 +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 68OIlZ4O2521605; Thu, 24 Sep 2026 22:30:07 GMT Received: from smtprelay06.wdc07v.mail.ibm.com ([172.16.1.73]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4gvbt2ywsu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 24 Sep 2026 22:30:07 +0000 (GMT) Received: from smtpav04.wdc07v.mail.ibm.com (smtpav04.wdc07v.mail.ibm.com [10.39.53.231]) by smtprelay06.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 68OMU5Ef10289852 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Sep 2026 22:30:05 GMT Received: from smtpav04.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C42A058050; Thu, 24 Sep 2026 22:30:05 +0000 (GMT) Received: from smtpav04.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4D58158045; Thu, 24 Sep 2026 22:30:04 +0000 (GMT) Received: from fedora-workstation.ibmuc.com (unknown [9.61.83.151]) by smtpav04.wdc07v.mail.ibm.com (Postfix) with ESMTP; Thu, 24 Sep 2026 22:30:04 +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=W28NPNIANLUNQGp3I kCc6Izx8YgJrLiCy/E8HZaJJL0=; b=gu8Leq0uerC7A/+kdOZ7kBwHhEYCLERye trPpH4/ws4rMX6HgIBlLlNWwdWaXnZf9Pbhlaarx9PV6rshcLHCxzym25430+EcK 4hG5TcHCOuAoDHSRy7T3k/gLfAmqZTIkQsN0M8GBZj5riKpfuaYZc8QvBlMqyi9g YMHnLZCcxIp12d4DbTgeJ8K/bZ0IkQgr/uSW/NtHNNy2P+DeQq7EK8E3F7AIW6RA WKa6/XtUP0Yta3jzt73wH44vd3NDqL7fi3TZJCLQ5pGPvPLpK7ygdOBd2LvvPImJ vZmCYdg3vQmOb94CoMrk/Pci6oZjQkcZdLquQRYp+llxmNxCfmt3A== 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 v5 7/8] tests/qtest: Add s390x virtio net PCI test to pxe-test.c Date: Thu, 24 Sep 2026 18:29:48 -0400 Message-ID: <20260924222949.147720-8-zycai@linux.ibm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260924222949.147720-1-zycai@linux.ibm.com> References: <20260924222949.147720-1-zycai@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Authority-Analysis: v=2.4 cv=G+OJgNk5 c=1 sm=1 tr=0 ts=6ab5a46f cx=c_pps a=GFwsV6G8L6GxiO2Y/PsHdQ==:117 a=GFwsV6G8L6GxiO2Y/PsHdQ==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=V8glGbnc2Ofi9Qvn3v5h:22 a=VnNF1IyMAAAA:8 a=PkLLOfym-WlFbigP99UA:9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTI0MDA5MCBTYWx0ZWRfX3XOmylZyyR12 G703LKZLvs6GjB8zCvZTeDpauIjt1en51c/FQoi0BZsM5om/YL9W36lEo7OoZudrAxWhI7G7OvG BDO5xfheHqcfo6K+aqAQEiGup6PUrxtB3aMyQgX8scvulzEln4LLYXdHlrg84zJqmVFlqxxIkUk 6qm+zGI5I+FlA5Vk1yEJUCHcbJKYZmCN3yx02o9se8JWRv7YBRXEnDtt9y/TUluTR3nVN9WDOOh iGL4xODme55oxqSWrcwwTm//fYh2I9DEUZxvMWVZp4IrPPXDeC+5y6mp97ZAACj1csmlIiyl8ZB O49joqMYE1GsmEs7vxlUoJHro+fP23tE/2OhmLszrOl32Nb5LpTms4sc+OOzBwTPqU5IR0Vctth 9NppSNAe4rW7n6EZNHJya9zk3FotacAMVsBC46FZX1NfVzZxLXwozjXkm2uRwfB7+BsYkQbdq+w lVYZGFNo+DpeS1H1Tmg== X-Proofpoint-ORIG-GUID: gSLShaarW9KzUyvVSOS2ZWSxpo_imc98 X-Proofpoint-GUID: gSLShaarW9KzUyvVSOS2ZWSxpo_imc98 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTI0MDA5MCBTYWx0ZWRfX3ednwrKOTR3C /AxUp2CvFRkD+QxH5WrybJ7OTf2iEJLHvJd3CIjRucj9RGAaGa5F6fppuMBNJTp7GznIvnOFGOp F8dncIc81A4USMSYHUeCfAMl0h7YJsI= 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-24_05,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 phishscore=0 lowpriorityscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 clxscore=1015 spamscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609240090 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: 1790289054665158500 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 Reviewed-by: Matthew Rosato Reviewed-by: Jared Rossi --- tests/qtest/pxe-test.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/qtest/pxe-test.c b/tests/qtest/pxe-test.c index 5c6415b936..61c92a2df4 100644 --- a/tests/qtest/pxe-test.c +++ b/tests/qtest/pxe-test.c @@ -130,9 +130,20 @@ 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) +{ + /* + * Check for a string unique to virtio-net-pci boot support in the bios + * to determine if the binary was built with support for this device. + */ + 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 19:12:09 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=1790289069; cv=none; d=zohomail.com; s=zohoarc; b=L7egwEPqkgawOqhJ6XxSF/1HV0zqnA32lpNqfl0r2gvJ3l2wAeNfG3/vwrcwQk8BfSMhmbgABtzkwyXrifx0YQzeeoquPRM9PCZtJxQnvVMzIvi1vBA55wZeCUhnu+ragfjUe9bs0OwjIZHHnFlLPeC9SDIKRGByzRCwkLbQBso= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790289069; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=cQR+DsEFuiIdDK4XaDmeCs6vX4161X/idAu68Z0x0R4=; b=kCVFUi6ne9249Zb7LARc+jx6FaSspzzhyZ0XUldSfBaIMwr9AYmJ1cYGoBdx7lJ1ir0M25P4LYvwJJMWE6HMONwLTyufu7CPoj8dUMiM2WdP31gQL6DF/ynYXP0kndzMu1n42+Fx4S9EGIN+xb+FkxmaJFFYd5ld7OJwRgRthT4= 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 1790289069144950.909551847628; Thu, 24 Sep 2026 15:31:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9rxJ-0000Vf-9B; Thu, 24 Sep 2026 18:30:17 -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 1x9rxF-0000Tf-VK; Thu, 24 Sep 2026 18:30:13 -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 1x9rxD-0005HW-LY; Thu, 24 Sep 2026 18:30:13 -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 68OJ5eA61202115; Thu, 24 Sep 2026 22:30:10 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 4gske23xs4-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 24 Sep 2026 22:30:09 +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 68OIlc562569930; Thu, 24 Sep 2026 22:30:09 GMT Received: from smtprelay02.dal12v.mail.ibm.com ([172.16.1.4]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 4gvb6qr1e8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 24 Sep 2026 22:30:08 +0000 (GMT) Received: from smtpav04.wdc07v.mail.ibm.com (smtpav04.wdc07v.mail.ibm.com [10.39.53.231]) by smtprelay02.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 68OMU72N24707712 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Sep 2026 22:30:08 GMT Received: from smtpav04.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B6BFA58054; Thu, 24 Sep 2026 22:30:07 +0000 (GMT) Received: from smtpav04.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 041705805E; Thu, 24 Sep 2026 22:30:06 +0000 (GMT) Received: from fedora-workstation.ibmuc.com (unknown [9.61.83.151]) by smtpav04.wdc07v.mail.ibm.com (Postfix) with ESMTP; Thu, 24 Sep 2026 22:30:05 +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=cQR+DsEFuiIdDK4Xa DmeCs6vX4161X/idAu68Z0x0R4=; b=jlCFKA8uAw9e3sPYsXakOHnQNisy7W+th k6bDyRLTX5iE2vdq4Ibd1bV0jdNZ6e7aJL9oHf5Nkue1UFbkEPAm6b+AsP2Z9+G2 TkIWTHpYiGwZRjvBan6HgbNBWlTnheSYjaM+XyrGgFW37snoicH2HoscnFu5bFLl /uo7Oxblw7e3AE9yb/DAEjmFQxfigQ3i334uXKHBcBvFICBX1sJ0lB1jsqJ1kOc9 B3zP9hnTTzywUroN6YOsmf063w3eVkJD49G8EwDQwtAGjBe1G/mIx/pX8Dc4s1Ju tr9GaT2pZDtyh5eo7mz5qYhv4Dhe7JbE7v9Cjl26mghq0lcnAGMIA== 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 v5 8/8] tests/functional/s390x: Add tests for virtio net PCI in test_pxelinux.py Date: Thu, 24 Sep 2026 18:29:49 -0400 Message-ID: <20260924222949.147720-9-zycai@linux.ibm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260924222949.147720-1-zycai@linux.ibm.com> References: <20260924222949.147720-1-zycai@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: pRj2-tIZH8IWeOlPa6vtCkpBqwoXYbg_ X-Authority-Analysis: v=2.4 cv=EOCTQFZC c=1 sm=1 tr=0 ts=6ab5a471 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=Z6bpV0tWmYslb40Kif8A:9 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTI0MDA5MCBTYWx0ZWRfX752usSf98beR DenVfgtCPsDsbfuiyEPt+vkiz+t+2iKsB6ajix1sXF9ikBsKaAP17em5WbfB0Td4FHk5Ql+3/lB GpoLXuQQQprpcTNWIeeLXBpBHdwMEms= X-Proofpoint-GUID: pRj2-tIZH8IWeOlPa6vtCkpBqwoXYbg_ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTI0MDA5MCBTYWx0ZWRfX1LObPKRCAheL SHuuk9Y5rq6X9wGqvH2UKhT2bsoPVRxgUmu9FBx5U0d0OfEy7ivbhnlP72jX+CJPrLOlWzzGwlq /1xRjOka4XB/GgS+vmH6JNQUBq3/T5RZQI+YYncecTlkLbHaq+7SI+Rnwy9ULVSkBV4tGNlwb3q pfBDEnADqrnC3atCZ92bRMvJDxoInOO6ow3f4FdJkirehNnrpnl04VEuIQwTH0AF8fMAn/8Wwct 4HL+oYRhIlqz92QUaad1T5I15y4lSPZ13ehouEq1tCtIMt6QhlhIkOEMPwUMzgDf54uDTlDTszz YEc3SUXUCWlEZtX9DKsyfXlD4QHhcGJmuxVTQ9Wiwexkr8r+eXio+TfboFMIG4JvNp+rReHLF/0 hCG8JQAxwHu8cZmjaXlThDvlx+dJF1M422tj9Bt80fJnZH6jorI4MCkR7xFxspkkzR0rY5W0PZ+ OncEEOOoN696K0/xypg== 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-24_05,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 phishscore=0 priorityscore=1501 clxscore=1015 spamscore=0 adultscore=0 impostorscore=0 lowpriorityscore=0 suspectscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609240090 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: 1790289070875158501 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 Reviewed-by: Jared Rossi --- 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..5ce42aa074 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_ccw(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_ccw(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_ccw(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_ccw(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_ccw(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