From nobody Sat Sep 26 19:11:55 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=1790279401; cv=none; d=zohomail.com; s=zohoarc; b=eAkUkUcEhWCLNYjzSDPd6pbujLM1loFugJiQl9vLp3IzBFFE9b/P6Zv53i6EyfK4avlkoy1MlRIqMDUE/v4o+mHInz66KprF8deJshtjOqQlRiUzEmka/cj+QqCYXNsnRxmvwLj5l3ut8AuuLgwHX67B4/YdWP1Zx88YO8kyUpo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790279401; 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=MnyxeiDKX+i+Zeu1CXI8r1W57QjqWigwUygGTy4KM+EYlPw86JzjhcO/l52ZOpfkqiKlQmW9hTI4NXGLIzXTbRxtzyWyRXI92s0K33O7IOAkFsVHoIPHVsmuQNnP4gAZjRPQO99w2+emYED5RCijHCWFEJ3bvS+QfFHJSffsZTc= 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 1790279401882161.39693474742614; Thu, 24 Sep 2026 12:50:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9pR6-0003we-Un; Thu, 24 Sep 2026 15:48:53 -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 1x9pR3-0003v8-Pp; Thu, 24 Sep 2026 15:48:49 -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 1x9pR1-00089u-Ik; Thu, 24 Sep 2026 15:48:49 -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 68OJ5aDl3068373; Thu, 24 Sep 2026 19:48:45 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 4gskgsk7tq-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 24 Sep 2026 19:48:45 +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 68OIlaqX2569912; Thu, 24 Sep 2026 19:48:44 GMT Received: from smtprelay05.dal12v.mail.ibm.com ([172.16.1.7]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 4gvb6qqfxp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 24 Sep 2026 19:48:44 +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 68OJmh7J22348516 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Sep 2026 19:48:43 GMT Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2B6A358059; Thu, 24 Sep 2026 19:48:43 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9223358058; Thu, 24 Sep 2026 19:48:41 +0000 (GMT) Received: from fedora-workstation.ibmuc.com (unknown [9.61.83.151]) by smtpav02.wdc07v.mail.ibm.com (Postfix) with ESMTP; Thu, 24 Sep 2026 19:48:41 +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=oRlCs/NQAjxm4KOo6Jsnq7TIhYGMrwrpr Hpj84HnYYCwqQSH8XvvhWlGUanf5szd8x4rH72ZeHs/D+Q99dTqD8FQ6cE213Pr6 mHQ2hftM6Rq6s2pYaq4a2dv+w7Fid2mR4HYl0WzcjudRE0ZIMsqBDxpbNi0KNDj1 UIJSnqVfl+Uw/GsWM3FxXtVcWhbJBcRFxfePix7g8uv98Z0GYkMKQPiqIR+sE/Q7 OxoeUlWJ/+Ajb5fMHTB0UPbRIrsY0Bop+WeIn3wPTUTPj0avfxHqgDv5CfRQA9iv ppjt3aIMQpjVnmEZExqOawjIj5Le5xnvzsM/RwpezwDpYSQla1h+Q== 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 v4 1/8] pc-bios/s390-ccw: Move CCW net setup to virtio-ccw Date: Thu, 24 Sep 2026 15:48:30 -0400 Message-ID: <20260924194837.80732-2-zycai@linux.ibm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260924194837.80732-1-zycai@linux.ibm.com> References: <20260924194837.80732-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=6ab57e9d cx=c_pps a=aDMHemPKRhS1OARIsFnwRA==:117 a=aDMHemPKRhS1OARIsFnwRA==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=U7nrCbtTmkRpXpFmAIza:22 a=VnNF1IyMAAAA:8 a=Aak0X9c2SgglYLKd_28A:9 X-Proofpoint-ORIG-GUID: YliXe3Z2ih9QFQGvZn7mjxoTQOpWNjzw X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTI0MDA4MCBTYWx0ZWRfX1h0DGEI8Pvqz coKC4JTA53fcUEm7D8I4fIY1smZ3XYJ1lofbbhhFnGzZW2e3G8Y6+h63grnzNVRetwKmrEyfdTr V2+jfmBnWwls4fHh6sRhFh3rq6dff+FCaDgWRdcLmEtwYTxxYwZRy7KTWNHo9dNzEYcdFS/cFv+ HMCLlLoy2b8p1Lj9dn4jin0F9MJwB52erdvdq2A8GLl90u3sijYp/yLYyPuh9dQSQ5AEcoS2vvn 0GsTo5Zuy5LkHS06kO6JfKBZqbv0bqOBltGQFtLm2Eq98Pt11DIzmzAm1P+YZjd0ZPuhwm9/Gx7 1mPgg+UByvWm4Pxy82t7WaQSaTb+004NWPqWZotZuRSNNMuFsxSlSAghbXGQXa1LDaWEb0If45h NwsibB4UE4S7pQ2MzPx3uhF3zUG/oeC5v5AZHC5FhsA29RSJ9QHOi9/pGzMILJa+DGqKdjBYu59 PHJaBMnpHcYmeeiTiaA== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTI0MDA4MCBTYWx0ZWRfX/6R43D53f2pt l4yOiuGoQeHn5hqwtLsZ3/L7L3POT19C4HNhfHroAVLA3Hc6XF7Qrdu2dpNmYux+13KsWn4Jhpz 12c9R3uc3QyIIemklcgxWP2MGKcwGos= X-Proofpoint-GUID: YliXe3Z2ih9QFQGvZn7mjxoTQOpWNjzw 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-2609240080 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: 1790279402468158500 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:11:55 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=1790279409; cv=none; d=zohomail.com; s=zohoarc; b=VQ2yf5VZ39P1klU5B605CL3vHC/N/oSqA5ZltCsLNA9hO+6yEaH1yzXc+pLjfULNU2yy/k1HvZ6c8Pa/rSV51ed+YS6OOi7VJFbviozBM0qt2JIXOf192djtXJ7/BuD2SgK/UsoUllr3lQB2jLKnGKXDyIFYXMkr20Nt2zOaOG8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790279409; 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=R+3BU0DdY76OUCCwGTgwM9qmyE3Rt2qfpe83EoIBKFhB8j1mXFVP1NqCG2AuPngOwjodRhIyjDYQbnV/CfEZpI5s9aeQDtGkuk5GHj0fNIt1hYVN0P00S4MTFJPENCbrwspoLqPCk8g0gt9Ndv22vUS1Pa4RzR04KkzGL0GnKqU= 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 1790279409553725.6978021934386; Thu, 24 Sep 2026 12:50:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9pR6-0003wQ-In; Thu, 24 Sep 2026 15:48:52 -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 1x9pR4-0003vL-Cr; Thu, 24 Sep 2026 15:48:50 -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 1x9pR2-0008A4-Nt; Thu, 24 Sep 2026 15:48:50 -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 68OJ5bEU1896454; Thu, 24 Sep 2026 19:48:47 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 4gskgqte9x-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 24 Sep 2026 19:48: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 68OIlVHc2569878; Thu, 24 Sep 2026 19:48:46 GMT Received: from smtprelay07.dal12v.mail.ibm.com ([172.16.1.9]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 4gvb6qqfxr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 24 Sep 2026 19:48:46 +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 68OJmjPT20513484 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Sep 2026 19:48:45 GMT Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 01DA45805E; Thu, 24 Sep 2026 19:48:45 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4C35D5805B; Thu, 24 Sep 2026 19:48:43 +0000 (GMT) Received: from fedora-workstation.ibmuc.com (unknown [9.61.83.151]) by smtpav02.wdc07v.mail.ibm.com (Postfix) with ESMTP; Thu, 24 Sep 2026 19:48:43 +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=OIaz0IKtnTJljaet7IBN4KuUl3MLLzUWC RCJYHaChiEOiHCeYNRi5bPTrfyJP6k+8HVouBoldo5f1QEFPDnfozUrJkwsdJsgR 7jRSEdvI8mJEWGwzL43P46NdDQbpoxJfVI+AUGuDIsSBcQRZqlPHs57tZUj5GEAD f+KLj4BMQWbiQ7pHl7NSs8WIeH26NhVSDStw1UfEOhJW/FsIzlFL3JIQ1mlsqOir NoWG2kxeqsljgsdSyWs7SVgOp2yqf8TB/ESdqAgZkKcuLPCw1+kiK0e3o50PaA3U 5Jya2zJowyh+mAAf3T9bIxli5OvBFF9XiFKDjW79phmaYNB+2GRuA== 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 v4 2/8] pc-bios/s390-ccw: Add dynamic net header size handling Date: Thu, 24 Sep 2026 15:48:31 -0400 Message-ID: <20260924194837.80732-3-zycai@linux.ibm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260924194837.80732-1-zycai@linux.ibm.com> References: <20260924194837.80732-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=6ab57e9e cx=c_pps a=aDMHemPKRhS1OARIsFnwRA==:117 a=aDMHemPKRhS1OARIsFnwRA==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=V8glGbnc2Ofi9Qvn3v5h:22 a=VnNF1IyMAAAA:8 a=b71jbalOAXEqY8vE3Q8A:9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTI0MDA4MCBTYWx0ZWRfXztfHkqmfvPqr RtXrDv4pdUMew8pmBO5LQuKgLIaPs56gxB/7dn9eZUL2w7cvUcZEEvv3xF3SJ1Ae51gvNGYwyyh MiAOqG7oKyUDRIx/4/zX1HMGRXmlQN4x8VCttSJ+o9QZyuIJBC/8A//4M8x//GVKxmGrzSA8v5q cJWGU8wNGOkv9v46rerA2VudjQQQR0dELCiMr0N4xFG7SJ2vfgWHnLTsSONI/iMjeJCuruHLrQg SssXgmduhGDDvUHbTC6YgacmbDkXBSJDBaQqedAtoMUFEc6BxMLz5AEtk4vAxLz6GI8NN1AI7Fn owh/u9CIuSFT27vJz4v1sQIq9dMcotXaGhQmeTsMZlbsv6XBOaJuxKawdZvxrCWxLogf80eLkWS 9KLlL2u8d9v4JDuT1hN/xLn0eu2r6KeLWYnOLRUa+BUr8Dh2xIttz5ifRMs2F8Qmkt3aaEcaR5c rm//StofovDHbeqTvGQ== X-Proofpoint-ORIG-GUID: hJ9PTxwGTsJNxreUOj-V_kO8xUoxp35b X-Proofpoint-GUID: hJ9PTxwGTsJNxreUOj-V_kO8xUoxp35b X-Proofpoint-Spam-Info: AW1haW4tMjYwOTI0MDA4MCBTYWx0ZWRfX3v6we/uzyK7h 3P513d3azxhmTOYZWbaKLQyFoHsBiAHaF5D9Cp2y1sM71uGgPnoTWtRznFqZI6D7Oxwe6HF1HHQ 4gLWWN6q8aPBj5XT49zwjvyVYhMOu1U= 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-2609240080 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: 1790279410252158500 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:11:55 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=1790279413; cv=none; d=zohomail.com; s=zohoarc; b=JfNMnDfKvJa7t6K6bIV6nkf1eey+NeC2qYAny4+jrvNpGeqJwkaKiy0qr2ARJ0AGKjF5M/xKBfDuOedv+Qx6ryFKtHdJGUdt/M8y/jwnStIzO2UaMLDCd1j+U5tLGvSpIB9u70Gkhf/yWuqYNzp3v79lCibhQNaaG2bedMlJEi0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790279413; 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=WWvR4jRzZwPSTL1YYOp2COEGp/3cxNR8Ln2/DEnrbMf8ZXKIumUZQcRfhq3pOkbRJGQW4dULA7fg+r5dfAPhZOljSWqYCF/W5HxYrbf0UWiyvjjJOcRRrSqQpG3Jbzx/4Lm9CpMptd9UyxwztuZZ/oO++NGngLhn5DvRsnij/4I= 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 1790279413193587.1899500584898; Thu, 24 Sep 2026 12:50:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9pRA-0003xh-P5; Thu, 24 Sep 2026 15:48:56 -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 1x9pR6-0003wK-4W; Thu, 24 Sep 2026 15:48:52 -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 1x9pR4-0008AP-6i; Thu, 24 Sep 2026 15:48:51 -0400 Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68OJ5YAO3107453; Thu, 24 Sep 2026 19:48:49 GMT Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4gskdvjfv3-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 24 Sep 2026 19:48:48 +0000 (GMT) Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 68OIlXDe2572657; Thu, 24 Sep 2026 19:48:48 GMT Received: from smtprelay01.wdc07v.mail.ibm.com ([172.16.1.68]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 4gvb8jygae-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 24 Sep 2026 19:48:48 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (smtpav02.wdc07v.mail.ibm.com [10.39.53.229]) by smtprelay01.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 68OJmkBx3933084 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Sep 2026 19:48:46 GMT Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A8F415805B; Thu, 24 Sep 2026 19:48:46 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2A4C358059; Thu, 24 Sep 2026 19:48:45 +0000 (GMT) Received: from fedora-workstation.ibmuc.com (unknown [9.61.83.151]) by smtpav02.wdc07v.mail.ibm.com (Postfix) with ESMTP; Thu, 24 Sep 2026 19:48:45 +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=VAZZFOEV0tB+RSf8DdeCrbhfSFICwMNs4 aPmeGmQ+loextBBstn37V3KXj0GMNQepcJ3EAYz+yObgIMKDDXncvRVeezolHGqY Q/EZWhhqmTU3XS2mMisHTF2XCZ/yBTclRvfPEzDmCr9wlEkExVftRKdM2g6hYeiK 9H/m1ixhk5tqjq97x0hqGnACpRe8+ccA+CZ3M3wk5qzcS4dzpoBofEkuk+Q4+Sqc +KkVWEGpqBQdHlwcGk7jISaTBVB1rE//9ZWOXf8GgiOrOmXErwbkYgRZg35xqJv9 ofVZu9uclDVj0CCrCc/vKYCCzfgbSkjdXnrc5bO26DoqDNp5s6zmw== 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 v4 3/8] pc-bios/s390-ccw: Introduce virtio_tswap helpers Date: Thu, 24 Sep 2026 15:48:32 -0400 Message-ID: <20260924194837.80732-4-zycai@linux.ibm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260924194837.80732-1-zycai@linux.ibm.com> References: <20260924194837.80732-1-zycai@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: CoX9tRmLp7zVIIi4yw5xASGHOX7aDzlQ X-Proofpoint-Spam-Info: AW1haW4tMjYwOTI0MDA4MCBTYWx0ZWRfXyXEF8zs/tWn7 WoYPHdxzxcdEAeYSS/RlU165ageWT8/5QPUsKXcZlcaLU9+mO663/mwb27CybUxQ+Us+t1IByKN eMtfnQ4H4z0luLiVFC56avPrWDqkDeQ= X-Authority-Analysis: v=2.4 cv=FLiOVOos c=1 sm=1 tr=0 ts=6ab57ea0 cx=c_pps a=bLidbwmWQ0KltjZqbj+ezA==:117 a=bLidbwmWQ0KltjZqbj+ezA==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=RzCfie-kr_QcCd8fBx8p:22 a=VnNF1IyMAAAA:8 a=nmTm2IjeaI_QYA0BkewA:9 X-Proofpoint-GUID: CoX9tRmLp7zVIIi4yw5xASGHOX7aDzlQ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTI0MDA4MCBTYWx0ZWRfX2z41XTk6E8F9 AtPefFzr9PkDJjiRd2PjYBGpfbg74T2YJwj/jrq6+Ka233LGMZZU4jwbMASh7tkLpjMB2wPS6xX K4uD3qh1QVbgPGeapmoat3+I/IdcZ3iCBS1xzk513Ngk1mUMND0QR06qLdCqvDynqFjyRCmbBIC IiyljOj6kzVHIov4qARDBDr9JBvYxhuh3hPq6rpa/rpR0GywBL9K4rLPcvNImGMKF9kFFTvWws1 pUcX6LbtwGvZIdxHLFDM4YoQcAim/Q2pXSGTcStDW99zOW9HlWMnHYGxIYalFoAVX8yaFvSQ5Bz 5rXDh8lxGzxRhNtr0xw4F+WW3al7Pk6k4dvg0HxV72feR9GMHsfBm0zGb+iu/irvGIxh0brTDEo IHpALFLn9kM5EQKCUL61rbtOuP47qtoyYS+nknfP0r3GGyvv1ZAsnFRjXHZOQd08B+TXPjc5p89 r+GS2lbeBUvFtebMjEw== 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 adultscore=0 impostorscore=0 phishscore=0 spamscore=0 clxscore=1015 suspectscore=0 bulkscore=0 lowpriorityscore=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-2609240080 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: 1790279414246158500 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:11:55 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=1790279401; cv=none; d=zohomail.com; s=zohoarc; b=A91LDD4MeqwJWQHjhEUYWMNEm3oP5lQz0b/CR0S29VdyRXniBP+tpSsAaIL5PHjVXcth/4iFw7Hb8VauIQ27xHp5bHPm4gkFR0k1q1Fki7kUj4mELTBcJkxR2RcrXHV5mv6jVUDmf0amFA68bTeljG/oTNkmtuy4dzZbHfO3Qvw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790279401; 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=mzKTpbOStwy7w+0lexLYnJ2mcdK7mf47zYLZG0cUrds=; b=DOsPRAC/352/gy8Clgz7cKwqIc6dO8r++awNMF9rqOXkVXX4tBC7x1ILMfWZcwSXpzfG8aypjw3Gxb2vlGPXb/20f2UCohnTPkQlBr1HA7WTS2GyvKdeuIAWs9cTNj7nAqtstJfjoWy2CdOWeOu3NIEuzqM8th6JeiZk7OFgjHw= 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 1790279401384533.2265259616904; Thu, 24 Sep 2026 12:50:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9pRI-0003zp-LY; Thu, 24 Sep 2026 15:49: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 1x9pR8-0003xY-EJ; Thu, 24 Sep 2026 15:48:54 -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 1x9pR6-0008Al-Dd; Thu, 24 Sep 2026 15:48:54 -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 68OJ5iB33079455; Thu, 24 Sep 2026 19:48:50 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 4gskg2uccm-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 24 Sep 2026 19:48:50 +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 68OIlYdV2521594; Thu, 24 Sep 2026 19:48:49 GMT Received: from smtprelay03.wdc07v.mail.ibm.com ([172.16.1.70]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4gvbt2ycg2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 24 Sep 2026 19:48:49 +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 68OJm4Jr918238 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Sep 2026 19:48:04 GMT Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6A2015805B; Thu, 24 Sep 2026 19:48:48 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D0F0458059; Thu, 24 Sep 2026 19:48:46 +0000 (GMT) Received: from fedora-workstation.ibmuc.com (unknown [9.61.83.151]) by smtpav02.wdc07v.mail.ibm.com (Postfix) with ESMTP; Thu, 24 Sep 2026 19:48: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=mzKTpbOStwy7w+0le xLYnJ2mcdK7mf47zYLZG0cUrds=; b=MWtUR7NiDsZ2mOWiU8vRnnsQGq52wmdMW 8VMJ2SULWgKHWurhs2AcCI4YMhZE8akUv/BBClD1r2rl7n1oW4e4KwXzIQpCHuO9 CegXq4psiQs1YXhDnFiqkNueAtTSUYndIzngMqZKRhQhJFBm32HS7U5j/L5ahKos vVDBzqP0BP8zc7ExKvFim/W6ENottJbgpxuPJM+ZhIpBhvxbu2uhXt3swH3ZP2oe zea7B5pSw+VxvfaPTyojomZQZc5EDlBPDdnTvgi9tNzaWxTxqweHsJ0ii5EXRVxD NhsqtmNbf7QKVzOYZ5wsnXU+L+3vLvTCT0n3ju7f3g+fgZm6smCTA== 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 v4 4/8] pc-bios/s390-ccw: Add support for virtio-net-pci IPL Date: Thu, 24 Sep 2026 15:48:33 -0400 Message-ID: <20260924194837.80732-5-zycai@linux.ibm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260924194837.80732-1-zycai@linux.ibm.com> References: <20260924194837.80732-1-zycai@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: MfPB6tTrkA4mj5zpgFlK2vlhNExGEP8Y X-Authority-Analysis: v=2.4 cv=I43w19gg c=1 sm=1 tr=0 ts=6ab57ea2 cx=c_pps a=GFwsV6G8L6GxiO2Y/PsHdQ==:117 a=GFwsV6G8L6GxiO2Y/PsHdQ==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=iQ6ETzBq9ecOQQE5vZCe:22 a=VnNF1IyMAAAA:8 a=ctsVLiZ_AAAA:8 a=Iu4lfvU6lRjo1WYjJIoA:9 a=3VCIHQLkQthbvTRuo98s:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTI0MDA4MCBTYWx0ZWRfX74NHCWMjxfuk LhLC0UQzDOFxQNweOQ0E25kOM7Un5e2U7J+GEPhk31slZbC1KJq5yiSL5jeL61MNy0XNtoqm5WE LmriIE49edgu5mSq2cGe8wSu8M5o1xjqpRbw/NOoCgzthzUUFE8gVPhz2qiLRwWz8c0Ds9/z7Hf rXKP8yA6CxpuDnRoCAQW9NrtkmLbAo18OPZsMIpHDd5pHs4GliomentDokfkGvzwQYRtu1svtlM WNmg+xCUbOJLPgNFdDGV/23KfDv6E8ZkWzaqz4ffRv9HTP31yJgVAtJHUV48779OlKN1s2ihKIH PWITpUFFnA46dPqXsJOM+ydIgYqPsTPVzWe7ER6qFEpG3hhIbOSY87UtUojfDCiVy3kPXloTBS9 rxNzZsuwdR7jnteZr82SCBWovc3rfS6lsSufUdSYxZcGsDD62ohVkRWEIAQFX9aEuCyxO8wr0MV /WFUo6XqIMzLuECJh+A== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTI0MDA4MCBTYWx0ZWRfX0ftj4wNGyDYb LToTacJk6aOpn2nPIY3wVT0l7Ml8sMjYXtAgbL/16tkl4VWdKX/YCoWg2xPQBoH9BP1f9UGQew2 ndoG0pLaergcXQWDsWAADNeBjg6YOHQ= X-Proofpoint-GUID: MfPB6tTrkA4mj5zpgFlK2vlhNExGEP8Y 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-2609240080 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: 1790279404137158500 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 | 18 +++++++++++++++ 4 files changed, 60 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..7fb987099d 100644 --- a/pc-bios/s390-ccw/virtio-pci.c +++ b/pc-bios/s390-ccw/virtio-pci.c @@ -55,6 +55,9 @@ void virtio_pci_id2type(VDev *vdev, uint16_t device_id) case 0x1048: case 0x1004: vdev->dev_type =3D VIRTIO_ID_SCSI; + case 0x1041: + case 0x1000: + vdev->dev_type =3D VIRTIO_ID_NET; break; default: vdev->dev_type =3D 0; @@ -223,6 +226,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 +369,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; @@ -413,6 +428,9 @@ int virtio_pci_setup(VDev *vdev) vdev->nr_vqs =3D 3; vdev->cmd_vr_idx =3D 2; virtio_pci_get_scsi_config(); + case VIRTIO_ID_NET: + vdev->nr_vqs =3D 2; + virtio_pci_get_net_config(); break; default: puts("Unsupported virtio device"); --=20 2.55.0 From nobody Sat Sep 26 19:11:55 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=1790279402; cv=none; d=zohomail.com; s=zohoarc; b=meBxJbIW7jqwfpJGo28OOaVT5K+dqwXA2KH3ZNfnxcFVQz5U8Nu2wpAmG25V8bwipLQ0eISlPg6WxkdNAGLrMszquAvrcphVcwUSfeS1tvs523KdnEpcpga65nsslx4vAP/8QnWLYaMgO77DLwB8nIAj9pJgpFHsGKQKWQVqkfU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790279402; 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=C9YigdtQXI5B2QIzZ2laiuqBefVkJqvwGLLT4BsGZX4Srr+zzJAK5b6HQgzMrRE9vk1+cMsdlVfc793g9ZH1+NPplIkrLHBtZZLhcIRNi/fMFOzDr3WbgHEUZPGAlcBNR5C7qqv58xilya0T5WVR6vl0d97jWLvmeEZV6ukbDRs= 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 1790279402192760.1982967054638; Thu, 24 Sep 2026 12:50:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9pRJ-000408-Ix; Thu, 24 Sep 2026 15:49: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 1x9pR8-0003xZ-TY; Thu, 24 Sep 2026 15:48:55 -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 1x9pR7-0008Az-Gj; Thu, 24 Sep 2026 15:48:54 -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 68OJ5Zs21896355; Thu, 24 Sep 2026 19:48:52 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 4gskgqteaa-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 24 Sep 2026 19:48:52 +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 68OIlYVY2559304; Thu, 24 Sep 2026 19:48:51 GMT Received: from smtprelay02.dal12v.mail.ibm.com ([172.16.1.4]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4gvbe1yfjh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 24 Sep 2026 19:48:51 +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 68OJmokX25953022 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Sep 2026 19:48:50 GMT Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 21AF258058; Thu, 24 Sep 2026 19:48:50 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 94AC058059; Thu, 24 Sep 2026 19:48:48 +0000 (GMT) Received: from fedora-workstation.ibmuc.com (unknown [9.61.83.151]) by smtpav02.wdc07v.mail.ibm.com (Postfix) with ESMTP; Thu, 24 Sep 2026 19:48:48 +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=M5kZMyRA9sY04NJpf6d5PVpkJzBfVXpyI 0gXuX7ql+JGHgXhX6gyxRzRRL4IO7FTYV2g1L1UJihe0i27FsZxAtC8ungN/yecw Md8Vak+MFYx5zaQVZQGRuv0f8iSbThxh2Fa1rjunIZwPqKI5XaC9+Vh5D5yW6uIS Z8f+oholgEYTP1PAvvnucpSuF8ROH3wHPOMTFKBi9Zg7hWZAVphahIDoebT9r9E2 zNJehKKAIBntvm0im+DuUHLYhYrfMdoq9llyQLV67/PJ2/WPYd6meA2K01uW1riX mDK7MFFnZeXF9cHx4ZCN9gzXZhaHXf9qsADV4I5niu2U/YvsjV1Tw== 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 v4 5/8] hw/virtio: Add "loadparm" property to virtio net PCI devices booting on s390x Date: Thu, 24 Sep 2026 15:48:34 -0400 Message-ID: <20260924194837.80732-6-zycai@linux.ibm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260924194837.80732-1-zycai@linux.ibm.com> References: <20260924194837.80732-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=6ab57ea4 cx=c_pps a=3Bg1Hr4SwmMryq2xdFQyZA==:117 a=3Bg1Hr4SwmMryq2xdFQyZA==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=V8glGbnc2Ofi9Qvn3v5h:22 a=VnNF1IyMAAAA:8 a=LEpY8eO1VcgwfWkpOzsA:9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTI0MDA4MCBTYWx0ZWRfX47duqwgcujMo snY/SXjsEN6z0qt3wVQq7U3Z5zvF3Zl1AAzhYrFQ7peAiv1SjCoOHSHDUT7DHBQ8ezXqBYVa2q8 Y4zRUQ/Y9kmO92PEufEffhNBYRjX+G5FpSycSGpFCGY+l++VAvNbB96vJI/4JZQ8EeS4wKrbgTl feM5Py0uW8Lu0fQyLJclT9XTJK8YrKzxaQqBleIQapEOlH8az5zGSCWHMIJ54V2TojhppKsHs6Y 5WXmc3VBR8+pfajCObF0JsFV16o2tTink30ZZ7vV971Hn7eLIrzWtIhhAK8wWd/mIjsoaSt0sz4 +tJV2qN7cssAtdTf1OgtRpobGNj4TBqK0UKLef79JLRJxhCMpZPzv6ONABl6Vf8TWq+fuPtapn3 pcreGeloT6FDOkrQ2RnmljPi2F+pslq2+zyey1XivkmLsHUB14kVnCb1PZCbnxicz+TvdaQCp0q Xsvizcq6Cf68C/pSXLA== X-Proofpoint-ORIG-GUID: LWv7NI-h_xs1LmNBUHOlTxtCLEw-YuXK X-Proofpoint-GUID: LWv7NI-h_xs1LmNBUHOlTxtCLEw-YuXK X-Proofpoint-Spam-Info: AW1haW4tMjYwOTI0MDA4MCBTYWx0ZWRfXy6gMcMC4IgW2 BZnXRslH2hqjtONGz1BIXBS8OwJsZ4rlcryuAWjbydW44DfE5hU7ZTSjaWlmcWyhpfQzGSCailg QrV4c56MoBoJQYDg9BGgVs55564moY8= 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-2609240080 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: 1790279404071158500 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:11:55 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=1790279415; cv=none; d=zohomail.com; s=zohoarc; b=mZJb4Y0OyrXH441YCK8lDeSI4Rf/cDwnY4GRhjzhZU0Ukrv8m4luKUb6oZhMPmIZ/SRB1IDiu9p9TD5repLSU+Q6hnG2gtr1fGmvXk4KrM6rqR58uOvX9aECRsUVcwTD0TGtXomPVJfOGAyZtXfzTNfZtQZXcRsY01Oa27St2wY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790279415; 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=ag92YFbITaeUgUdvKAF2x5Yn0zaB4uG61hHoGRUZOkg=; b=liqUBinr67gKGaAWYoxxyOSiucAXdE4h0I7X5ECfEp8Sb5K3GhKIBZcn/kylPStY4FM2LvPXWpGSxgpIIH8qnuHcQJsjsJWwI8c71/j5c/Sn6ao2u0JlQLIqEA3DR54KovX6RTz7MzIzGJr3xuLjOIETgOcLmxazoKzfmzeCU8A= 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 1790279414882329.7387585544899; Thu, 24 Sep 2026 12:50:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9pRJ-00040C-Ka; Thu, 24 Sep 2026 15:49: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 1x9pRB-0003yT-GZ; Thu, 24 Sep 2026 15:48:58 -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 1x9pR9-0008BG-Nv; Thu, 24 Sep 2026 15:48:57 -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 68OJ5RHi1201893; Thu, 24 Sep 2026 19:48:54 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 4gske239m0-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 24 Sep 2026 19:48:53 +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 68OIlXts1233804; Thu, 24 Sep 2026 19:48:53 GMT Received: from smtprelay03.dal12v.mail.ibm.com ([172.16.1.5]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 4gvu7ebpjt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 24 Sep 2026 19:48:53 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (smtpav02.wdc07v.mail.ibm.com [10.39.53.229]) by smtprelay03.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 68OJmpAx17171002 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Sep 2026 19:48:52 GMT Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C842E58058; Thu, 24 Sep 2026 19:48:51 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 55BFD58059; Thu, 24 Sep 2026 19:48:50 +0000 (GMT) Received: from fedora-workstation.ibmuc.com (unknown [9.61.83.151]) by smtpav02.wdc07v.mail.ibm.com (Postfix) with ESMTP; Thu, 24 Sep 2026 19:48:50 +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=ag92YFbITaeUgUdvK AF2x5Yn0zaB4uG61hHoGRUZOkg=; b=GAy4+lU96+XIaBnS8Kl8nq3hP+eS9a9FD GIFysyyFyCzayfqhdr3R7BZHjjy8q34m3s2ZybQ1ZzkNIDMduoFxInSXaDRaghZj VeuPXTHVKY1ohe0LDfccOH1l9Rm8vGU9bk0qQNHhRRhAZiwqTOifJ3y06LRnNbg4 sW7V68csZkmxZ+uVwPBSXpRKV5Z02GkmMocfKwFq0n+1g3kJFNw50+exQHI8yN5D X5frURVNamw9ihonjZWmLnJ8PzsOANUyYf0CkxCoQnylSldhp9ze8H+QWeyIBnDQ bCc8m3UFLVTfdO4aW3gZuour706Sa7+cQLvXIEDiuhHnDp38Uusww== 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 v4 6/8] tests/qtest: Check s390x boot device support in pxe-test.c Date: Thu, 24 Sep 2026 15:48:35 -0400 Message-ID: <20260924194837.80732-7-zycai@linux.ibm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260924194837.80732-1-zycai@linux.ibm.com> References: <20260924194837.80732-1-zycai@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: Ch1OoQicXFZvOX-VYwTDS9LQ7umyGXG1 X-Authority-Analysis: v=2.4 cv=EOCTQFZC c=1 sm=1 tr=0 ts=6ab57ea5 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=uBPJ6fAX7Dlw_A6SEmQA:9 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTI0MDA4MCBTYWx0ZWRfX3vtjWLa+VjhA 3Ky2Joobm/vS8QglWpX+2PMFxcQa0rHibyiFnbn0T03+03UKCYC+WiH0994+NPweFBV/3ckSUUi HrrfgtBZ9UQ28LNWGHV6mKfjUVDpbMQ= X-Proofpoint-GUID: Ch1OoQicXFZvOX-VYwTDS9LQ7umyGXG1 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTI0MDA4MCBTYWx0ZWRfXwvYh9nR/Qbdh CEaABe/Fl/8SreBaRz65eswAJHs/+Q65z/0BOchskbRcBbgV75HoZeCJbTcFhK3ANa7FWOj7WND 7NiRoJhwl9ssxYnOF5d4IHx2ZGGpBce5Yh5LrIngByN2HxpA2hPFw2ERReRXlyFDq/aflzKRTcx R9zTIqZ+aAaspum1lidxR0y0ouKhwus0lxQ3WxQCFk1BdSiL8Qtxzibbfz5QvbGarexxp2ehC1Y aao1CYqRCg/ruk5aFd/K66tKuzBhb8g8tNwJS9TJhLaG6OItdjC+8KMAm4rwUza8ZIqoJJCmDOF dj0vO9PJnY2FHP/xrQA4nko2QCORBUenjZPW3S+V4HKlUitWjDYUvP2O9gqTeV6jKCyaxpcEXb5 FMKQSSxdIXTDYHvVvkbN52wM6ZgmYZz4HZpW45z9bcdmqQIMMI+zyJtHoBMxmBn9DVbnY992I8n vAUqetkOpqhAcfkyZ8w== 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-2609240080 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: 1790279416212158500 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 | 81 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 81 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..61ad572bb7 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,76 @@ 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("BIOS boot device support indicator \"%s\": %s", + needle, found ? "found" : "not found"); + return found; +} + +static bool s390_bios_has_net_ccw(void) +{ + 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 +159,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 +171,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:11:55 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=1790279421; cv=none; d=zohomail.com; s=zohoarc; b=ARo1VxkIFGBwnYCDoRrAhX06z4KNit65Uy5gkVCOXwCb5tnVakm3wdyBTeyDOGxDQ5hv66uDxJBzqAuTkDxBXg59z7jtvLpnzW4X5Q8RjzXHPs7nrzF8DgfZFELhUA4B6w7CNW9M9GWFRv53lV9pjhir+uvdb23uUdbGi18pDIs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790279421; 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=1MSnTIvkAItdvPLYXArpBwaReNTXxtOmB6hatitdplY=; b=GTwBlNFfRN+IIHrPMh2+K0y8OwM6pZhDUE7BajMI6ZbqWYvyj9kN419RqesGLUXCC0Ygtg8266NSntANbAdTjznMwLMooZtoNWmYeBiCFAZ6rkbtwx+YXbtElURBILYGl9juG4LdkpAviCUYERudeDAuS1v1IOH2pzVaJFRwGO0= 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 179027942190960.01644182291045; Thu, 24 Sep 2026 12:50:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9pRJ-00040R-No; Thu, 24 Sep 2026 15:49: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 1x9pRB-0003yU-W0; Thu, 24 Sep 2026 15:48:58 -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 1x9pRA-0008BQ-Hz; Thu, 24 Sep 2026 15:48:57 -0400 Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68OJ5RNe3107018; Thu, 24 Sep 2026 19:48:55 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 4gskdvjfve-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 24 Sep 2026 19:48:55 +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 68OIlWsX2521574; Thu, 24 Sep 2026 19:48:54 GMT Received: from smtprelay06.wdc07v.mail.ibm.com ([172.16.1.73]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4gvbt2ycg9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 24 Sep 2026 19:48:54 +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 68OJmrLR18875026 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Sep 2026 19:48:53 GMT Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 763205805C; Thu, 24 Sep 2026 19:48:53 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F2F5F58059; Thu, 24 Sep 2026 19:48:51 +0000 (GMT) Received: from fedora-workstation.ibmuc.com (unknown [9.61.83.151]) by smtpav02.wdc07v.mail.ibm.com (Postfix) with ESMTP; Thu, 24 Sep 2026 19:48: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=1MSnTIvkAItdvPLYX ArpBwaReNTXxtOmB6hatitdplY=; b=GU43G6oBS7gUU85ywe1H5tIgYKkv77/4U eWnrp0Wuu41qCSg0ZVe86ZXJ4FVacVNR4hRkD7KeWaZx6Ll4wd80C3Y59JZljgLe wQsUHKghF/2JQ4ugJKIKyIN5u4kJeKAtMQ+GU7Z9Wblsr6FMVhR6NP8O66f6mFOJ ZUIDfwbIeSt82E2QX6AQVN9pWTXObkrY88cT3bMa8m015UCszpE7T/AL7WtdjrVF XIMD60m7mvh28s4UqBNnnSUMhg1UR9MMu3Oa0xHFsXzqyN4Ma/eoIJhpBUkg6BSd OSeFno+q2vzBh0mRCqNfT3OIj5f/2thsdoTVpVJifV7BBTti5KVLw== 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 v4 7/8] tests/qtest: Add s390x virtio net PCI test to pxe-test.c Date: Thu, 24 Sep 2026 15:48:36 -0400 Message-ID: <20260924194837.80732-8-zycai@linux.ibm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260924194837.80732-1-zycai@linux.ibm.com> References: <20260924194837.80732-1-zycai@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: YPZphbCrLpWczhgNtSlj7mT_ZJfQolus X-Proofpoint-Spam-Info: AW1haW4tMjYwOTI0MDA4MCBTYWx0ZWRfXy0nZirp24efi WersafbVATltE39SaQGE2dSY65k6Ig2dVgidfykSzp6EiIiBGge+zZGUF5VCWlNkX3G1/Tr1Cm2 wTAgBN1JGCtRJY3SKHmgwpylSmF5/ns= X-Authority-Analysis: v=2.4 cv=FLiOVOos c=1 sm=1 tr=0 ts=6ab57ea7 cx=c_pps a=GFwsV6G8L6GxiO2Y/PsHdQ==:117 a=GFwsV6G8L6GxiO2Y/PsHdQ==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=RzCfie-kr_QcCd8fBx8p:22 a=VnNF1IyMAAAA:8 a=PkLLOfym-WlFbigP99UA:9 X-Proofpoint-GUID: YPZphbCrLpWczhgNtSlj7mT_ZJfQolus X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTI0MDA4MCBTYWx0ZWRfX4LYSrCdr0Lxv vUtyrirIJDLx5MJ1f6H/lBcFEzlUZk7LSsgGmnzKkvaxCoAIkpHiewg9wB0f0Ea1zYAucyysvQq 43V2aEeGcCCqc+zrPZ2+WgxsNLsIZ4imp0RaHv671WokIhrBcavszU2TcGhw4K7U0mJ6LIaCnDz kNoQJQRNBb0mY9ii6iix8YOnR9MsakY8/nLIq6abVkxHFczeL+x3bI3jN/jtIqlkymUxfhMYLYn E20TpCqHjyXBOJbnjMQKWmiJL0iGJJgaCI0O1JFuZjzYkvndaso7muRG3o3bevxKpVVNNZdU0kY HmzdINU2PBkUIrEqypbJwZC4NKACk1qfcxLncQLG9XePo3Vkkiq8NLUYMiBUhqvxmE0YKPjLWrg PfpoLqaNHCdrTyd2uPplwynX/jCFFSvWkpZl1BR6qpRFMey7htN1+tb2HL8t9JK4F1CBwCdpxsx 4pHg9SVjeGjnm9z+XFQ== 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 adultscore=0 impostorscore=0 phishscore=0 spamscore=0 clxscore=1015 suspectscore=0 bulkscore=0 lowpriorityscore=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-2609240080 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: 1790279422211158500 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: Jared Rossi Reviewed-by: Matthew Rosato --- 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 61ad572bb7..b12de2bedc 100644 --- a/tests/qtest/pxe-test.c +++ b/tests/qtest/pxe-test.c @@ -126,9 +126,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:11:55 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=1790279401; cv=none; d=zohomail.com; s=zohoarc; b=R5zDIStgU3z9yHF6pNPhaojg2avkEmpNZmnHsgjA+glorWJ16IXOpRGwwjskCu9qdPPoMntCF3S8B1//bp4UJm7tnAC8muAopyvVSm8EZPG5zAk5UoHVeMGXWnLgznypEogMwsi+vcHsZnpCTnTrGaahmlXQdfgwJrJI7dxQGT8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790279401; 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=Wp6MpYi6kzd3KP+sl1MErqkEWuYcnawEZQeXGKFia6+4lDkeudTFfbXGPfIdPgcPBGscrt7dLfQD0/88669aEB3BvTv3ONPM1vt2mTuRbd73Iokwsrl3lTCKiBEkFhtBr9m+5s/KYmARsVzIxxStwt6jlbQ/UbXOxS2FNVy7xhc= 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 1790279401884985.0172422678415; Thu, 24 Sep 2026 12:50:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9pRL-00041V-Cb; Thu, 24 Sep 2026 15:49: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 1x9pRE-0003yj-I1; Thu, 24 Sep 2026 15:49:00 -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 1x9pRC-0008Bg-Pa; Thu, 24 Sep 2026 15:49:00 -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 68OJ5hEu2914338; Thu, 24 Sep 2026 19:48:57 GMT Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4gske1tjrp-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 24 Sep 2026 19:48:57 +0000 (GMT) Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 68OIlZ7f2572747; Thu, 24 Sep 2026 19:48:56 GMT Received: from smtprelay04.dal12v.mail.ibm.com ([172.16.1.6]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 4gvb8jygan-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 24 Sep 2026 19:48:56 +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 68OJmtLW24838700 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Sep 2026 19:48:55 GMT Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 30DF258058; Thu, 24 Sep 2026 19:48:55 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A12485805C; Thu, 24 Sep 2026 19:48:53 +0000 (GMT) Received: from fedora-workstation.ibmuc.com (unknown [9.61.83.151]) by smtpav02.wdc07v.mail.ibm.com (Postfix) with ESMTP; Thu, 24 Sep 2026 19:48:53 +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=PzmSHTnQYm0msbOXVF0U/2ztBOV76xcO2 SBAIzLJ1GxFsX6nkf7+S9BzUp3gSTvqWJrAuzDZ/0SXZrT8mAxW+olDWCkyZLS9n v6uHOkQ1/60V+FbuufeE+KS4AO1eUkCCF9wRxI+FWqP3OCCEjMHIf3vgwkOrpAvg Oxb250ajEfMYeAyt8/iwkEeWntgpQsDPd7wFzNSk7uvvebK0+NtV4HG466I+rth0 PZI3EqiVK4xnlCWHApMQ80gaIl4YSoE5Mm1LlXLrdHzfQK/jfVBsT5cz3kTd2MIq af/XAwXVLlJwWNZ5kqp5+1e9p0WLerb7gB8Wordkmr/knebZp4heg== 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 v4 8/8] tests/functional/s390x: Add tests for virtio net PCI in test_pxelinux.py Date: Thu, 24 Sep 2026 15:48:37 -0400 Message-ID: <20260924194837.80732-9-zycai@linux.ibm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260924194837.80732-1-zycai@linux.ibm.com> References: <20260924194837.80732-1-zycai@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: VT6PlWut2IwecWWS8YV1A0s8Niry1yko X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTI0MDA4MCBTYWx0ZWRfX/nm4+fTcy30g AZUkbMd98VWPdzeT/054rnUtzEg0yk8B76M1hKIEfUKAR1eCoAUGLmIy5h+iX2rL5XIJMJ0DsB8 gYquWq08qUbnFvGJVfO5XDEPFdeW8Djw5qAKnzslX2iSdMyKsjwYplecScluuJHZ1SY6v1C+jI5 HRH+JPCZfmbyj5NHnnJqhRwEAu93QbPDtkSRSuyjaUD2X85lOc4StjcVKI3Vyk8T3evKXIXE4xg aex06xUbP9Odk2/3sVPJn2+Y2KFQAzG6Qa6g0gSeh4Q+Kq9WILQctg9hGTXarSA0nW491/7emKU hKwxkD2V/io4B6lrJyzZUGvofRYYYBavWwU2frOE5HvLng7g0EjR7z2RqFHmEqU3r8E75nbxdze 3hw+KJ9lVQLC8s1bXj62Gwa/WG7OSvr02lK/idx78GupQqwbvE4aPGHUIL70oGNp27lB4gE2YTY 4L0VpH66F/UtqFvvq9A== X-Authority-Analysis: v=2.4 cv=O/KsLx9W c=1 sm=1 tr=0 ts=6ab57ea9 cx=c_pps a=bLidbwmWQ0KltjZqbj+ezA==:117 a=bLidbwmWQ0KltjZqbj+ezA==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=Y2IxJ9c9Rs8Kov3niI8_:22 a=VnNF1IyMAAAA:8 a=Z6bpV0tWmYslb40Kif8A:9 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTI0MDA4MCBTYWx0ZWRfX+uc9An7JPKAi RMzQ7FLFeqyiogZ8NuzR87vrP5ahxtEwBKoTeQFvWV+hvJdHMgEE0OtB5D4bzSQcl2YBiJVVHnB klN8NQt5U7lK3m5VecYarnnmBBMfdvE= X-Proofpoint-GUID: VT6PlWut2IwecWWS8YV1A0s8Niry1yko 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-2609240080 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: 1790279404158158500 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..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