From nobody Sat Sep 26 22:14:45 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=1788452791; cv=none; d=zohomail.com; s=zohoarc; b=ZONe2FVWft4/P7o50pZ++aJj5YsIxRNS42zHauKTpPtenpVYwG9rKOurcKoKpQtvTjfiD21vGpzk2O+mecXxK7q7uQLmbTCVZMLeWoLaagGBVcwd4ATx4TOd1hiBqc/lc5mfp2wi5YzGl+LIRxC2p9QBYEp85g6l0ogRsqlDXj8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788452791; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=30xlshIggkiho0rel6WonbDxYI913NugENmazBvpcZc=; b=KbblKx/1o3qLnu25KHbwhxvChGHm0T1xmCoPzT/l7otcL5bCvhdyXfAb3exXMqx6rLWIn6ojpJqhsOZuHa22zV1YasSzRXkZBJibpBUNGs11tbubfyDcK3AjVTl7cNhBFuQ+U5iLtGJ9bTuWTwT7QexBXBmYLVlAGiG+iuS2utk= 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 1788452791247149.499746677988; Thu, 3 Sep 2026 09:26:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2AFP-0003w5-Pl; Thu, 03 Sep 2026 12:25: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 1x2AFK-0003tB-AQ; Thu, 03 Sep 2026 12:25: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 1x2AFH-0006UD-VP; Thu, 03 Sep 2026 12:25: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 683G2sLH3304782; Thu, 3 Sep 2026 16:24:56 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 4gbmuj5ks2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 03 Sep 2026 16:24:56 +0000 (GMT) Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 683GBeQW006146; Thu, 3 Sep 2026 16:24:55 GMT Received: from smtprelay07.wdc07v.mail.ibm.com ([172.16.1.74]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4gecjartya-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 03 Sep 2026 16:24:55 +0000 (GMT) Received: from smtpav05.wdc07v.mail.ibm.com (smtpav05.wdc07v.mail.ibm.com [10.39.53.232]) by smtprelay07.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 683GOsMJ30933568 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 3 Sep 2026 16:24:54 GMT Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 53D6858059; Thu, 3 Sep 2026 16:24:54 +0000 (GMT) Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CC32158043; Thu, 3 Sep 2026 16:24:52 +0000 (GMT) Received: from fedora-workstation.ibmuc.com (unknown [9.61.31.144]) by smtpav05.wdc07v.mail.ibm.com (Postfix) with ESMTP; Thu, 3 Sep 2026 16:24:52 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=30xlshIggkiho0rel 6WonbDxYI913NugENmazBvpcZc=; b=kjhceFMcD6FqIyV16bJJTlpMj88k3D9VZ 3MckD2aaU1ep6XSTQXPWu/6j/tvekykxdKRbgBIXBYEjkz4VZGJ31CvRJwIV+5o9 Ng44ySXwbvomTq3mdgQdb+vThVtp7ExBxvX69VVouOD0hGNdQbkhMcAfVMiwOips +zhKezpGGZgg7vTZ49sTasFvgfvTu+RNPpI7sCzUoBsFQRWQHn+MNfwasw2dOJCK rK88+vNsTkGLBQhyTfpV6W5ESDVjMIQzLmMNGdH6cjkdH3QxSpVCq7GZnBtERW7a jN+WIOa5wcDWMyoxMMLs29kyIqlzV1gIIeJ6+zMDeElhShYhwRSHw== 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, jdaley@linux.ibm.com, pbonzini@redhat.com Subject: [PATCH v2 1/7] pc-bios/s390-ccw: Move CCW net setup to virtio-ccw Date: Thu, 3 Sep 2026 12:24:43 -0400 Message-ID: <20260903162449.2588271-2-zycai@linux.ibm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260903162449.2588271-1-zycai@linux.ibm.com> References: <20260903162449.2588271-1-zycai@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: bx9JThHIU_lTVYBDZA63CFJK7yLdAVHX X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTAzMDE0MCBTYWx0ZWRfX4cijHerD1I6N jbeB8yBFH5d9eAxojHa/X9aoefGxnzbdjTQgMst3ocodL4cSTlM9c4npJGKvkCrUBCd8E9gP1q5 ODatT0NCuuNEXjNXm5C+uN7LJ+dNh7QcVy04h8cvpmtZfUkXvRfsab9Qvxh7RXxZuB9+/w1dz2f Zuk46b/FlT6STfeIe7iHW55Y7cseVeOanr3Ua/hTmfRrmSmrYqu02MFG7maxEHKWY9jwT6ULmSi 6RGsdNiLMGMSUD+a7DWLise3hcrH2jiYnqsvBreuxHAgjGg6lmHM6v3h1CKWWnISbhtpQVtZpcq Tt6MUTZ5TLCzsRMNbziNkIQVnjiLH/nU8NNcSdH6nTQE73JazxWrwXc8B4O2s+6Qdrfk3vo0WNR KUSPFq3V/gT6WzoDsBETik4FT/Uua9f7QZzzD6okX8lUhMb1+42DKz5E87KzJBUMGHyxCMYUQ1P ipMn0rj7iWDZYHnM2Gw== X-Authority-Analysis: v=2.4 cv=Osl/DS/t c=1 sm=1 tr=0 ts=6a999f58 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: AW1haW4tMjYwOTAzMDE0MCBTYWx0ZWRfX/e/PDHEoiJX4 YB4DNehQDjivagskNfFWi8HfiHaTvlBSHI6j/m1tfMwkdaFMRw/3MMklJi2m4jAs858ER/a2mF9 GjuIeu8ysIzZim5sCgvx57QM7gnhaJc= X-Proofpoint-ORIG-GUID: bx9JThHIU_lTVYBDZA63CFJK7yLdAVHX 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-03_05,2026-09-03_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 malwarescore=0 suspectscore=0 bulkscore=0 lowpriorityscore=0 adultscore=0 impostorscore=0 phishscore=0 clxscore=1015 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609030140 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: 1788452792809158500 Content-Type: text/plain; charset="utf-8" Move CCW-specific virtio_setup() and find_net_dev() to virtio-ccw.c to decouple the generic net boot logic from the CCW transport. Also update the error message on failure to specify "ccw net device". Signed-off-by: Zhuoying Cai Reviewed-by: Jared Rossi Reviewed-by: Jason J. Herne Reviewed-by: Matthew Rosato --- pc-bios/s390-ccw/netmain.c | 67 ++--------------------------------- pc-bios/s390-ccw/virtio-ccw.c | 62 ++++++++++++++++++++++++++++++++ pc-bios/s390-ccw/virtio-ccw.h | 1 + 3 files changed, 66 insertions(+), 64 deletions(-) diff --git a/pc-bios/s390-ccw/netmain.c b/pc-bios/s390-ccw/netmain.c index ccd1c30013..bcb62bf6ca 100644 --- a/pc-bios/s390-ccw/netmain.c +++ b/pc-bios/s390-ccw/netmain.c @@ -35,6 +35,7 @@ #include "s390-ccw.h" #include "cio.h" #include "virtio.h" +#include "virtio-ccw.h" #include "s390-time.h" =20 #define DEFAULT_BOOT_RETRIES 10 @@ -489,68 +490,6 @@ static int net_try_direct_tftp_load(filename_ip_t *fn_= ip) return rc; } =20 -static bool find_net_dev(Schib *schib, int dev_no) -{ - int i, r; - - for (i =3D 0; i < 0x10000; i++) { - net_schid.sch_no =3D i; - r =3D stsch_err(net_schid, schib); - if (r =3D=3D 3 || r =3D=3D -EIO) { - break; - } - if (!schib->pmcw.dnv) { - continue; - } - enable_subchannel(net_schid); - if (!virtio_is_supported(virtio_get_device())) { - continue; - } - if (virtio_get_device_type() !=3D VIRTIO_ID_NET) { - continue; - } - if (dev_no < 0 || schib->pmcw.dev =3D=3D dev_no) { - return true; - } - } - - return false; -} - -static bool virtio_setup(void) -{ - Schib schib; - int ssid; - bool found =3D false; - uint16_t dev_no; - - /* - * We unconditionally enable mss support. In every sane configuration, - * this will succeed; and even if it doesn't, stsch_err() can deal - * with the consequences. - */ - enable_mss_facility(); - - if (have_iplb || store_iplb(iplb)) { - IPL_assert(iplb->pbt =3D=3D S390_IPL_TYPE_CCW, "IPL_TYPE_CCW expec= ted"); - dev_no =3D iplb->ccw.devno; - debug_print_int("device no. ", dev_no); - net_schid.ssid =3D iplb->ccw.ssid & 0x3; - debug_print_int("ssid ", net_schid.ssid); - found =3D find_net_dev(&schib, dev_no); - } else { - for (ssid =3D 0; ssid < 0x3; ssid++) { - net_schid.ssid =3D ssid; - found =3D find_net_dev(&schib, -1); - if (found) { - break; - } - } - } - - return found; -} - int netmain(void) { filename_ip_t fn_ip; @@ -559,8 +498,8 @@ int netmain(void) sclp_setup(); puts("Network boot starting..."); =20 - if (!virtio_setup()) { - puts("No virtio net device found."); + if (!virtio_ccw_net_setup()) { + puts("No valid virtio ccw net device found."); return -1; } =20 diff --git a/pc-bios/s390-ccw/virtio-ccw.c b/pc-bios/s390-ccw/virtio-ccw.c index 5cb2158ed2..5bf67738e4 100644 --- a/pc-bios/s390-ccw/virtio-ccw.c +++ b/pc-bios/s390-ccw/virtio-ccw.c @@ -237,3 +237,65 @@ int virtio_ccw_setup(VDev *vdev) =20 return 0; } + +static bool find_ccw_net_dev(Schib *schib, int dev_no) +{ + int i, r; + + for (i =3D 0; i < 0x10000; i++) { + net_schid.sch_no =3D i; + r =3D stsch_err(net_schid, schib); + if (r =3D=3D 3 || r =3D=3D -EIO) { + break; + } + if (!schib->pmcw.dnv) { + continue; + } + enable_subchannel(net_schid); + if (!virtio_is_supported(virtio_get_device())) { + continue; + } + if (virtio_get_device_type() !=3D VIRTIO_ID_NET) { + continue; + } + if (dev_no < 0 || schib->pmcw.dev =3D=3D dev_no) { + return true; + } + } + + return false; +} + +bool virtio_ccw_net_setup(void) +{ + Schib schib; + int ssid; + bool found =3D false; + uint16_t dev_no; + + /* + * We unconditionally enable mss support. In every sane configuration, + * this will succeed; and even if it doesn't, stsch_err() can deal + * with the consequences. + */ + enable_mss_facility(); + + if (have_iplb || store_iplb(iplb)) { + IPL_assert(iplb->pbt =3D=3D S390_IPL_TYPE_CCW, "IPL_TYPE_CCW expec= ted"); + dev_no =3D iplb->ccw.devno; + debug_print_int("device no. ", dev_no); + net_schid.ssid =3D iplb->ccw.ssid & 0x3; + debug_print_int("ssid ", net_schid.ssid); + found =3D find_ccw_net_dev(&schib, dev_no); + } else { + for (ssid =3D 0; ssid < 0x3; ssid++) { + net_schid.ssid =3D ssid; + found =3D find_ccw_net_dev(&schib, -1); + if (found) { + break; + } + } + } + + return found; +} diff --git a/pc-bios/s390-ccw/virtio-ccw.h b/pc-bios/s390-ccw/virtio-ccw.h index a506767eaa..c330e02f99 100644 --- a/pc-bios/s390-ccw/virtio-ccw.h +++ b/pc-bios/s390-ccw/virtio-ccw.h @@ -20,5 +20,6 @@ int virtio_ccw_run(VDev *vdev, int vqid, VirtioCmd *cmd); long virtio_ccw_notify(SubChannelId schid, int vq_idx, long cookie); int virtio_ccw_setup(VDev *vdev); int virtio_ccw_reset(VDev *vdev); +bool virtio_ccw_net_setup(void); =20 #endif --=20 2.55.0 From nobody Sat Sep 26 22:14:45 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=1788452775; cv=none; d=zohomail.com; s=zohoarc; b=Fu3DBo6+fz49x69V39/k9cc0mM1T46KMYhrVGpsNdC/stOFRR8wtTmrGJLXtmLvRDxfUMAlR8MjuD6Go3w8IrwGV/BjJ3GB5ZQjMcHFVG/Ov5Cw+hB5O3qmfru4204zF7CASEuNbmjhHLf/Gdu+Q4/mi6fnhl9m8v3htRL4VyAY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788452775; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+hMlmJY+J26UFND8NnuXaqfbWV3kHEmcb9fqKreviBA=; b=mvDfpNhzw5p8u6U6ngL+bEtCjUhcL4G7Yv8i/wJcT4NaugqOgzFF8VYNrc4NS2vrorfLpiNJxOfHQhL07WU5V7vpZyvVNhvdesVaX5cgbgsyCAsTs6CKbJ469FuG2xfDR1W05iP90e0TsWijZMu21Xuqi5VE2hCOiNp8FItU7Zo= 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 1788452775702141.23362767160677; Thu, 3 Sep 2026 09:26:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2AFL-0003tj-NU; Thu, 03 Sep 2026 12:25:03 -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 1x2AFJ-0003su-U9; Thu, 03 Sep 2026 12:25: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 1x2AFH-0006Ut-Ct; Thu, 03 Sep 2026 12:25:01 -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 683G37fV2293550; Thu, 3 Sep 2026 16:24:58 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 4gbnue5fcq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 03 Sep 2026 16:24:57 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 683GBcbx002709; Thu, 3 Sep 2026 16:24:57 GMT Received: from smtprelay04.dal12v.mail.ibm.com ([172.16.1.6]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 4gcceyg8bq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 03 Sep 2026 16:24:57 +0000 (GMT) Received: from smtpav05.wdc07v.mail.ibm.com (smtpav05.wdc07v.mail.ibm.com [10.39.53.232]) by smtprelay04.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 683GOuDu27722248 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 3 Sep 2026 16:24:56 GMT Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 02B1558043; Thu, 3 Sep 2026 16:24:56 +0000 (GMT) Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7BE495805D; Thu, 3 Sep 2026 16:24:54 +0000 (GMT) Received: from fedora-workstation.ibmuc.com (unknown [9.61.31.144]) by smtpav05.wdc07v.mail.ibm.com (Postfix) with ESMTP; Thu, 3 Sep 2026 16:24: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=+hMlmJY+J26UFND8N nuXaqfbWV3kHEmcb9fqKreviBA=; b=MKpFdB5Zci+1dy2qYl7BXowYnnW4kU7EX /m3KTUIk9cMTIeHCIt00eQ8+LVR9F4TQiApjg09gKkgwQ/HsIzvbanFXzCZHNq15 tTN/AULK4rzK6/MRcKw13FkK5T8CKoy0j7EUVtN3ITUS0BzuKsBEAexvOOLCyxXd Ni/ugFYBzm4mgZd/x2EbBo3AuR0aoNXvtMXaM7Tvs9ashI6Mmy+lp3+husWfyvnw sC+kaKSEMrLaIX08xFpVO+tNdzCw4/8nWXpGV2+Req7oANXoJ+fjSZqD1qJEHyQj xFX2cu77DOwL4Cr9rWzYMzteO5dMdiGQ/VhayndgXpGB66llPnAjw== 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, jdaley@linux.ibm.com, pbonzini@redhat.com Subject: [PATCH v2 2/7] pc-bios/s390-ccw: Add dynamic net header size handling Date: Thu, 3 Sep 2026 12:24:44 -0400 Message-ID: <20260903162449.2588271-3-zycai@linux.ibm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260903162449.2588271-1-zycai@linux.ibm.com> References: <20260903162449.2588271-1-zycai@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: -_Y7AkZ6RXtdwV5Y5BXLzz6xx7dMK480 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTAzMDE0MCBTYWx0ZWRfX72jNzsNVm2RJ 2LXQYGn9VhNCBVSzbJVpAeSS+7820PZEwJnBS7y8N+VglWCFIUiIKT7CfoGP02knsQK09tUS7ir R83GMzT2jxUT64eNnA5XYoVLEwlYa0O6fModLesAlFxBtoWAzXAweFQOqLcPXcTUQDwTEQAEJZG JJfLYQ1OR11lCakwggUxRqnuphUmp61cqivDyYD/boOR3cuRBiqo6KolXv4PplrMimDp0Bjf4+6 t2Luy1N6nDj7m3sgRDy2SrQ+bUUa7zwKFwFd6k/aen058abPZw6yZQw286BgrPj0M1CX32axuQc O21g45/BjsxtjhC7+0JfOS4/9XopmMQzgyLra0yLD/Aq8Wleyypy0JpO6Z2rxFLfJy/PLXdVBQf rJYcZLmCZDWky22iKo41/5WLGWU513zoHprBHecxjAJgy+eug8QxxWHiqB27w8F7GjdpA1lfN3P 4xSQlBAkaJHGoxmv51Q== X-Proofpoint-ORIG-GUID: -_Y7AkZ6RXtdwV5Y5BXLzz6xx7dMK480 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTAzMDE0MCBTYWx0ZWRfX69QePG3O7mm6 ruORExGVp5MKfpirm6ERkoJ3TWSrZY2mS0sP20Mpu2s+F0uVXuTiN0VT0ygGewZQPQmiK9f8HWg eN9OdjzaHz5cCIbz8bBdNh0bUWJQVhs= X-Authority-Analysis: v=2.4 cv=B92JFutM c=1 sm=1 tr=0 ts=6a999f5a 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-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-03_05,2026-09-03_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 spamscore=0 clxscore=1015 suspectscore=0 phishscore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 impostorscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609030140 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: 1788452776575158500 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 or for the mergeable receive buffers feature. Use dynamic header sizing: 10 bytes for legacy mode and 12 bytes for VirtIO 1.0 or when VIRTIO_NET_F_MRG_RXBUF is enabled. This ensures correct packet handling across different VirtIO configurations. Signed-off-by: Zhuoying Cai --- pc-bios/s390-ccw/virtio-net.c | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/pc-bios/s390-ccw/virtio-net.c b/pc-bios/s390-ccw/virtio-net.c index f58f7ffc55..afa728bc32 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 @@ -28,6 +29,7 @@ #endif =20 #define VIRTIO_NET_F_MAC_BIT (1 << 5) +#define VIRTIO_NET_F_MRG_RXBUF_BIT (1 << 15) =20 #define VQ_RX 0 /* Receive queue */ #define VQ_TX 1 /* Transmit queue */ @@ -43,7 +45,18 @@ struct VirtioNetHdr { }; typedef struct VirtioNetHdr VirtioNetHdr; =20 +struct VirtioNetHdrMrgRxbuf { + struct VirtioNetHdr hdr; + uint16_t num_buffers; /* Only with VIRTIO_NET_F_MRG_RXBUF or VIRTIO1 */ +}; +typedef struct VirtioNetHdrMrgRxbuf VirtioNetHdrMrgRxbuf; + +/* Header sizes for different modes */ +#define VIRTIO_NET_HDR_SIZE_LEGACY sizeof(VirtioNetHdr) +#define VIRTIO_NET_HDR_SIZE_V1 sizeof(VirtioNetHdrMrgRxbuf) + static uint16_t rx_last_idx; /* Last index in receive queue "used" ring */ +static int virtio_net_hdr_size; =20 int virtio_net_init(void *mac_addr) { @@ -62,12 +75,17 @@ int virtio_net_init(void *mac_addr) return -1; } =20 + virtio_net_hdr_size =3D ((vdev->guest_features[1] & VIRTIO_F_VERSION_1= ) || + (vdev->guest_features[0] & VIRTIO_NET_F_MRG_RXB= UF_BIT)) + ? 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 +95,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 +126,13 @@ int recv(int fd, void *buf, int maxlen, int flags) return 0; } =20 - len =3D rxvq->used->ring[rx_last_idx % rxvq->num].len - sizeof(VirtioN= etHdr); + len =3D rxvq->used->ring[rx_last_idx % rxvq->num].len - virtio_net_hdr= _size; if (len > maxlen) { puts("virtio-net: Receive buffer too small"); len =3D maxlen; } id =3D rxvq->used->ring[rx_last_idx % rxvq->num].id % rxvq->num; - pkt =3D (uint8_t *)(rxvq->desc[id].addr + sizeof(VirtioNetHdr)); + pkt =3D (uint8_t *)(rxvq->desc[id].addr + virtio_net_hdr_size); =20 #if DEBUG_VIRTIO_NET /* Dump packet */ int i; --=20 2.55.0 From nobody Sat Sep 26 22:14:45 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=1788452752; cv=none; d=zohomail.com; s=zohoarc; b=HoYx6IG1MBVobKpt007UF2PZ00g67raD/7LibEm2QeXsoUsRb2RpB8jg/zPbwI8U2rz6Zfy0QyjAknY+rqtdd6xS7yfjJqrfMIJ1WeC2VksYzynqRfF7bYc1ebsc+Tz4N0rIpMFgIjx/IgHHIDBwApn2m5sk+4UPkUKd/cFTvrg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788452752; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=oF035lZWSOugjvxdipCuYzntpXytqybUreJPuzPgrdc=; b=EdkSNKFg6iyLaLAOTtfpN4UPocVHfyVtPqWSiL7CAeE7mdPyvfeIgNKQ4hbkAPiVUkHV7T6zmR0pQR+LzxvJ51OxKNdYxzjwxfAn2qOAk07raHN/mDzKvskrTVrllwsJEXaNY5UqZvlzhWQYV8zaUIcpOuuCR3buI4Y4sK8lFPk= 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 1788452752485272.8750690279435; Thu, 3 Sep 2026 09:25:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2AFP-0003vq-Nx; Thu, 03 Sep 2026 12:25: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 1x2AFM-0003uW-2D; Thu, 03 Sep 2026 12:25:04 -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 1x2AFK-0006W6-76; Thu, 03 Sep 2026 12:25:03 -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 683G2Q5j3425608; Thu, 3 Sep 2026 16:25:00 GMT Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4gbq555x3a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 03 Sep 2026 16:25:00 +0000 (GMT) Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 683GBmIA006194; Thu, 3 Sep 2026 16:24:59 GMT Received: from smtprelay05.dal12v.mail.ibm.com ([172.16.1.7]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4gecjartyj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 03 Sep 2026 16:24:59 +0000 (GMT) Received: from smtpav05.wdc07v.mail.ibm.com (smtpav05.wdc07v.mail.ibm.com [10.39.53.232]) by smtprelay05.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 683GOvj226280464 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 3 Sep 2026 16:24:58 GMT Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A89875805D; Thu, 3 Sep 2026 16:24:57 +0000 (GMT) Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2A93C58059; Thu, 3 Sep 2026 16:24:56 +0000 (GMT) Received: from fedora-workstation.ibmuc.com (unknown [9.61.31.144]) by smtpav05.wdc07v.mail.ibm.com (Postfix) with ESMTP; Thu, 3 Sep 2026 16:24:56 +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=oF035lZWSOugjvxdi pCuYzntpXytqybUreJPuzPgrdc=; b=UrZQCPty7wcDbKC831RKwCOMk3OcqYvE9 uaue2EFIvPKgjvu90QlMVpzJkVDlmoofeYCJogyAdIYTUvrTYCla5LfPjNS4Oyax 4M2Cr3J2Vpk+/omoYSZggj7/L/dKud9NFi8B77aA3yf41oV9Kr8394sua7NNcrGj zIM8rhanfWhY15EtOvjoeOE+ysF9iwQTKbDQiqmnERfAHwPJl9UWhasT2YHmkkZ/ 2KTIL9CPVUIG0MeriKXoeQ45dYpiMASIJMxrM+VlZvCY2a/2vh56NAbvWkUweU8U lFrERrMZn0GxIaoB9NbV3IHbX4k3uB2GUNG6y2uS9WIXQx0SpqOOg== 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, jdaley@linux.ibm.com, pbonzini@redhat.com Subject: [PATCH v2 3/7] pc-bios/s390-ccw: Introduce virtio_tswap helpers Date: Thu, 3 Sep 2026 12:24:45 -0400 Message-ID: <20260903162449.2588271-4-zycai@linux.ibm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260903162449.2588271-1-zycai@linux.ibm.com> References: <20260903162449.2588271-1-zycai@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTAzMDE0MCBTYWx0ZWRfX1wLAby29xgVu R3VRyrZFqf75iM9H+W7mGtM0gPb4nfFK2uKwQXaWJ9ujiibVKInkgsrv82qadxZ7NM5sZs8UKGk frwxRcovX2pFQAjlAexzSIOQLjolC/MjnrR/izMsrB7HQARc/hWSbKd03xZzAZMAqGo+I3UIlEe JCGDHbmxcj6nX4PTXqnOPZE8oTR+7PogPT+Acq7eInO1ukRKwj8mgF54rdttUYkhLXQxeJhXgmN m6xx8REvXsMelnQue17G9UTbM4Fhwd3aB+Gvl/Zv9UrtmihstF+rSPRTMS55rt6RZ1XN/dpeEAU yDS28aeI3WGkFLoPPzvUcmCRNb6zFuaNxpkX9a0dn1cyNcTHMWJxZvAvBr7kH9BSvsYOdfqHnwP RuIawICJ37SXnpyr2CZbrgN33ZLYQhwbTsIg/EzuQeyl0ZZybkGvvde/py6jcCVvOieX90HMIFI 5MSwes6ELOoWxHW1IVw== X-Proofpoint-ORIG-GUID: DnudH2s4T7e2xTR1z8b19JgWnjp01X1W X-Authority-Analysis: v=2.4 cv=CNgamxrD c=1 sm=1 tr=0 ts=6a999f5c cx=c_pps a=5BHTudwdYE3Te8bg5FgnPg==:117 a=5BHTudwdYE3Te8bg5FgnPg==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=U7nrCbtTmkRpXpFmAIza:22 a=VnNF1IyMAAAA:8 a=nmTm2IjeaI_QYA0BkewA:9 X-Proofpoint-GUID: DnudH2s4T7e2xTR1z8b19JgWnjp01X1W X-Proofpoint-Spam-Info: AW1haW4tMjYwOTAzMDE0MCBTYWx0ZWRfXywTo8AdguKz+ tRnBzML0YFEg5+kHvPwbWoiV+exiXBQWPRJWZUL8Sqzoa0eH0ZdrPLLtI+KJQ3En8OPbsE5Cuab og2sNWEu/RQWoOmA786ByfcJv2ge8Hs= 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-03_05,2026-09-03_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 bulkscore=0 suspectscore=0 phishscore=0 lowpriorityscore=0 priorityscore=1501 clxscore=1015 impostorscore=0 adultscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609030140 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: 1788452754789158500 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: Jason J. Herne Reviewed-by: Matthew Rosato Reviewed-by: Jared Rossi --- pc-bios/s390-ccw/virtio.c | 27 +++++++++++++++++++++------ pc-bios/s390-ccw/virtio.h | 4 ++++ 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c index a0d249db24..037c00a3e1 100644 --- a/pc-bios/s390-ccw/virtio.c +++ b/pc-bios/s390-ccw/virtio.c @@ -97,7 +97,7 @@ void vring_init(VRing *vr, VqInfo *info) vr->avail->idx =3D 0; =20 /* We're running with interrupts off anyways, so don't bother */ - vr->used->flags =3D be_ipl() ? VRING_USED_F_NO_NOTIFY : bswap16(VRING_= USED_F_NO_NOTIFY); + vr->used->flags =3D virtio_tswap16(VRING_USED_F_NO_NOTIFY); vr->used->idx =3D 0; vr->used_idx =3D 0; vr->next_idx =3D 0; @@ -140,6 +140,22 @@ bool be_ipl(void) } } =20 +/* Conditionally byte-swap between virtio-endian and s390x native big-endi= an. */ +uint16_t virtio_tswap16(uint16_t x) +{ + return be_ipl() ? x : bswap16(x); +} + +uint32_t virtio_tswap32(uint32_t x) +{ + return be_ipl() ? x : bswap32(x); +} + +uint64_t virtio_tswap64(uint64_t x) +{ + return be_ipl() ? x : bswap64(x); +} + /* * Format the virtio ring descriptor endianness * Return the available index increment in the appropriate endianness @@ -156,12 +172,11 @@ void vring_send_buf(VRing *vr, void *p, int len, int = flags) { uint16_t avail_idx; =20 - avail_idx =3D be_ipl() ? vr->avail->idx : bswap16(vr->avail->idx); + avail_idx =3D virtio_tswap16(vr->avail->idx); =20 /* For follow-up chains we need to keep the first entry point */ if (!(flags & VRING_HIDDEN_IS_CHAIN)) { - vr->avail->ring[avail_idx % vr->num] =3D be_ipl() ? vr->next_idx : - bswap16(vr->next= _idx); + vr->avail->ring[avail_idx % vr->num] =3D virtio_tswap16(vr->next_i= dx); } =20 vr->desc[vr->next_idx].addr =3D (unsigned long)p; @@ -179,7 +194,7 @@ void vring_send_buf(VRing *vr, void *p, int len, int fl= ags) /* Chains only have a single ID */ if (!(flags & VRING_DESC_F_NEXT)) { avail_idx++; - vr->avail->idx =3D be_ipl() ? avail_idx : bswap16(avail_idx); + vr->avail->idx =3D virtio_tswap16(avail_idx); } } =20 @@ -187,7 +202,7 @@ int vr_poll(VRing *vr) { uint16_t used_idx; =20 - used_idx =3D be_ipl() ? vr->used->idx : bswap16(vr->used->idx); + used_idx =3D virtio_tswap16(vr->used->idx); if (used_idx =3D=3D vr->used_idx) { vring_notify(vr); yield(); diff --git a/pc-bios/s390-ccw/virtio.h b/pc-bios/s390-ccw/virtio.h index aa307025e0..645dc288b1 100644 --- a/pc-bios/s390-ccw/virtio.h +++ b/pc-bios/s390-ccw/virtio.h @@ -287,6 +287,10 @@ int virtio_run(VDev *vdev, int vqid, VirtioCmd *cmd); int virtio_reset(VDev *vdev); int virtio_setup_ccw(VDev *vdev); =20 +uint16_t virtio_tswap16(uint16_t x); +uint32_t virtio_tswap32(uint32_t x); +uint64_t virtio_tswap64(uint64_t x); + /* virtio-net.c */ int virtio_net_init(void *mac_addr); void virtio_net_deinit(void); --=20 2.55.0 From nobody Sat Sep 26 22:14:45 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=1788452770; cv=none; d=zohomail.com; s=zohoarc; b=AT5NM10jGecSA+cQPLyjJ+VbaSfgpnD46g9hJsALjWz7SW7NB5nPXrrHchGhzSCsatlFQTw+pgAKQ3WhASX9LQpkNCuU+pIiZxQiDLbU6hckOAQ18MGmjRkFPbwbH30ZEyJc34Fljo2NLgkpgo9wJNCVAfE8bgmNI1jT5vtqias= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788452770; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=dpNCyGSCw0ewAR78fCbU9g21mjTUTH2g0jsi57myjAY=; b=f7xOLyB0oEjfcmXdz1r9V8gVZavkDb0UhvJD0/jpZUndDEx9yt1wp9AH8AufLB7bLDRtDeyhji2QPUJM2D5F6O5HVsSvWzTtg+U7kqiZkFzXsH5GI3bHMVtdVkyFQvbLEkivEPQrpDa1AFQginj5pkOVTNRSlQEQlceQUujdJ/I= 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 1788452770699151.1072481544137; Thu, 3 Sep 2026 09:26:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2AFV-0003yM-8R; Thu, 03 Sep 2026 12:25:13 -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 1x2AFO-0003vN-0n; Thu, 03 Sep 2026 12:25:06 -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 1x2AFL-0006X4-8z; Thu, 03 Sep 2026 12:25:05 -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 683G2QUV3425226; Thu, 3 Sep 2026 16:25:01 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 4gbpx5wuw2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 03 Sep 2026 16:25:01 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 683GBgbx002734; Thu, 3 Sep 2026 16:25:00 GMT Received: from smtprelay07.dal12v.mail.ibm.com ([172.16.1.9]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 4gcceyg8bw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 03 Sep 2026 16:25:00 +0000 (GMT) Received: from smtpav05.wdc07v.mail.ibm.com (smtpav05.wdc07v.mail.ibm.com [10.39.53.232]) by smtprelay07.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 683GOxOB11666114 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 3 Sep 2026 16:24:59 GMT Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5D17358053; Thu, 3 Sep 2026 16:24:59 +0000 (GMT) Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D5EA658043; Thu, 3 Sep 2026 16:24:57 +0000 (GMT) Received: from fedora-workstation.ibmuc.com (unknown [9.61.31.144]) by smtpav05.wdc07v.mail.ibm.com (Postfix) with ESMTP; Thu, 3 Sep 2026 16:24: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=dpNCyGSCw0ewAR78f CbU9g21mjTUTH2g0jsi57myjAY=; b=DtzqYXDNnYAvn20vIayWyf3z/simOZoor SvGP3uFbjetVngf8Rf/5XbdYWjiH8zF8COr0+Xj2mRCZQkrr8LV9yVEp9Aja65V0 o+wZD9NIH8wKEEe0iK2/r7+xdvwsA8cN7It1RG7GBChyA/qNNnvzYYsb/AiTZ1VX uSMZYYfJJczbCi4rEFgso1BZaIU3meRE6L885zP7AEvKTL5MoCk8Qw011cnPhHOJ xdRmV/KGj/aMZ4r9uaePS6Yz2cOpj9MpoDZlEe8qShvWoybzQd5RE3LQliXdDr+/ M8p3Q/s1iCVgrTK3HOll0E4SqzFODOkHnG9YwHSpdP+V79qc/Y48w== 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, jdaley@linux.ibm.com, pbonzini@redhat.com Subject: [PATCH v2 4/7] pc-bios/s390-ccw: Add support for virtio-net-pci IPL Date: Thu, 3 Sep 2026 12:24:46 -0400 Message-ID: <20260903162449.2588271-5-zycai@linux.ibm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260903162449.2588271-1-zycai@linux.ibm.com> References: <20260903162449.2588271-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=PPc/P/qC c=1 sm=1 tr=0 ts=6a999f5d cx=c_pps a=aDMHemPKRhS1OARIsFnwRA==:117 a=aDMHemPKRhS1OARIsFnwRA==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=iQ6ETzBq9ecOQQE5vZCe:22 a=VnNF1IyMAAAA:8 a=ctsVLiZ_AAAA:8 a=OvO-KZyVvL5PKhO4nh0A:9 a=3VCIHQLkQthbvTRuo98s:22 X-Proofpoint-GUID: JPSpTxXw6NC7G5GiXD1WcgzzNlaUZ-1y X-Proofpoint-ORIG-GUID: JPSpTxXw6NC7G5GiXD1WcgzzNlaUZ-1y X-Proofpoint-Spam-Info: AW1haW4tMjYwOTAzMDE0MCBTYWx0ZWRfX+J3ZZWKEeof3 grcHvNWwU5Np6t3XFYHXxW5WsAzdb95Q5tRSRoaOHuKjIi6qez0mz4eYnZAjHLX5d8AHrhUshmF iQjIDwlAuftiWVPbSTibkcnbKiP+2QY= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTAzMDE0MCBTYWx0ZWRfXzqnD0NYNY3dS 1Kc3ineXvJyNkRgrmxoudZoKwNOpur9gRnaRhVvnoeyRZt1MLpTM8Sb6gT0nJ4Xy2qQtL5V7qPa 5z6wjCyL9b+2ozpRefVeDO9PJDJABRhAx+HDMrGKt80XTHnEO0oLG9oJHqaJK1GC32dvPIuhzyn GIhzgXih5fS26RzjMuAqrc1iDAY5FtJaoNH+EW5VEowpa/mEuA0YFuW71TGVxAZJsmNJPx3hMxj jb8KxOxgkzYuQOtTNoPHjsaESb+55J63Yp/ZdLF+ViBRcfM3aFZ0VGP0QG1FXX1fw5gio7G6o/d wRtkHItgavhVezYtxTFy5LdxKFAOWtV+COhmgridjKXH4XTDtRUAZJZ8rUHIP3DvWD3v9+xCoM+ MinPCGgoFAOJrWk8zoNi6rX4w45z0D45CABs8h2a/sTu3RHQj31sz3ZZnrl5vNbg38Qz/AFZ++z AxSfqshLPck4bRP6/9g== 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-03_05,2026-09-03_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 phishscore=0 adultscore=0 suspectscore=0 bulkscore=0 spamscore=0 priorityscore=1501 impostorscore=0 malwarescore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609030140 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: 1788452772626158500 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 --- pc-bios/s390-ccw/main.c | 1 + pc-bios/s390-ccw/netmain.c | 9 +++++++- pc-bios/s390-ccw/virtio-net.c | 41 ++++++++++++++++++++++++++++------- pc-bios/s390-ccw/virtio-pci.c | 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 8fc1cbf653..28cab3b411 100644 --- a/pc-bios/s390-ccw/main.c +++ b/pc-bios/s390-ccw/main.c @@ -332,6 +332,7 @@ static void ipl_pci_device(void) } =20 switch (vdev->dev_type) { + case VIRTIO_ID_NET: case VIRTIO_ID_BLOCK: if (virtio_setup() =3D=3D 0) { zipl_load(); /* only return on error */ diff --git a/pc-bios/s390-ccw/netmain.c b/pc-bios/s390-ccw/netmain.c index bcb62bf6ca..e42e049063 100644 --- a/pc-bios/s390-ccw/netmain.c +++ b/pc-bios/s390-ccw/netmain.c @@ -498,7 +498,14 @@ int netmain(void) sclp_setup(); puts("Network boot starting..."); =20 - if (!virtio_ccw_net_setup()) { + /* + * CCW devices require subchannel enumeration here. + * PCI devices don't require specific setup: the transport is already + * initialized by ipl_pci_device(), and virtio_is_supported() is check= ed + * later in virtio_net_init(). + */ + if (virtio_get_device()->ipl_type =3D=3D S390_IPL_TYPE_CCW && + !virtio_ccw_net_setup()) { puts("No valid virtio ccw net device found."); return -1; } diff --git a/pc-bios/s390-ccw/virtio-net.c b/pc-bios/s390-ccw/virtio-net.c index afa728bc32..418759565d 100644 --- a/pc-bios/s390-ccw/virtio-net.c +++ b/pc-bios/s390-ccw/virtio-net.c @@ -68,7 +68,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"); @@ -121,22 +136,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) { @@ -150,8 +173,10 @@ int recv(int fd, void *buf, int maxlen, int flags) memcpy(buf, pkt, len); =20 /* Mark buffer as available to the host again */ - rxvq->avail->ring[rxvq->avail->idx % rxvq->num] =3D id; - rxvq->avail->idx =3D rxvq->avail->idx + 1; + rx_avail_idx =3D virtio_tswap16(rxvq->avail->idx); + rxvq->avail->ring[rx_avail_idx % rxvq->num] =3D virtio_tswap16(id); + rx_avail_idx++; + rxvq->avail->idx =3D virtio_tswap16(rx_avail_idx); vring_notify(rxvq); =20 /* Move index to next entry */ diff --git a/pc-bios/s390-ccw/virtio-pci.c b/pc-bios/s390-ccw/virtio-pci.c index f501252c81..147a82895f 100644 --- a/pc-bios/s390-ccw/virtio-pci.c +++ b/pc-bios/s390-ccw/virtio-pci.c @@ -52,6 +52,10 @@ void virtio_pci_id2type(VDev *vdev, uint16_t device_id) case 0x1001: vdev->dev_type =3D VIRTIO_ID_BLOCK; break; + case 0x1041: + case 0x1000: + vdev->dev_type =3D VIRTIO_ID_NET; + break; default: vdev->dev_type =3D 0; } @@ -199,6 +203,14 @@ static int virtio_pci_get_blk_config(void) return rc; } =20 +static int virtio_pci_get_net_config(void) +{ + VirtioNetConfig *cfg =3D &virtio_get_device()->config.net; + int rc =3D vpci_read_flex(d_cap.off, d_cap.bar, cfg, sizeof(VirtioNetC= onfig)); + + return rc; +} + static int virtio_pci_negotiate(void) { int i, rc; @@ -330,6 +342,7 @@ bool virtio_pci_is_supported(VDev *vdev) if (vdev->vendor_id =3D=3D PCI_VENDOR_VIRTIO) { switch (vdev->dev_type) { case VIRTIO_ID_BLOCK: + case VIRTIO_ID_NET: return true; default: return false; @@ -384,6 +397,11 @@ int virtio_pci_setup(VDev *vdev) vdev->cmd_vr_idx =3D 0; virtio_pci_get_blk_config(); break; + case VIRTIO_ID_NET: + vdev->nr_vqs =3D 2; + vdev->cmd_vr_idx =3D 0; + virtio_pci_get_net_config(); + break; default: puts("Unsupported virtio device"); return -ENODEV; --=20 2.55.0 From nobody Sat Sep 26 22:14:45 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=1788452770; cv=none; d=zohomail.com; s=zohoarc; b=mXsDYeTwjdomwt3W+5th4TO+dZAJ+fSR7B7U0llXoByt6wIOQV7pOOFdzIrj9QAW2rJQg5bu1RI4ro3CaKERzXfYbnSK+WEa6ve5HBsje6UwgBr7Yld12jqtSlPCnUstgxJYjeBnUuAhvg4rhRgm1kiWq8fFKswYxBke2nTNlPs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788452770; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=LSjKS1E6tVwohFxlFwrrau07oDT4Bm5Q2sX9O21YrCk=; b=HSepDcrAHORgTZbVs1NuwuWvJwk6azJxBp8pWnMcJTybkMpZyb6xNgLIHn1A3KQYgflqbmcDPUzVXqP8F40Mo8PUaItpLJj7EMHO4UB+ef3TqTBiWmMJFL6RWu7eHHAaJnFDlvxJHQJJc/quiuYD3oAMIj+TNFlr9E7j3lBiP5o= 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 1788452770045482.4652255389559; Thu, 3 Sep 2026 09:26:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2AFV-0003yO-AX; Thu, 03 Sep 2026 12:25:13 -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 1x2AFO-0003vK-0n; Thu, 03 Sep 2026 12:25:06 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x2AFM-0006Xj-Br; Thu, 03 Sep 2026 12:25:05 -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 683G3j8l3306561; Thu, 3 Sep 2026 16:25:03 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 4gbmuj5ksj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 03 Sep 2026 16:25:03 +0000 (GMT) Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 683GBhDT026230; Thu, 3 Sep 2026 16:25:02 GMT Received: from smtprelay02.wdc07v.mail.ibm.com ([172.16.1.69]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4gcarkgern-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 03 Sep 2026 16:25:02 +0000 (GMT) Received: from smtpav05.wdc07v.mail.ibm.com (smtpav05.wdc07v.mail.ibm.com [10.39.53.232]) by smtprelay02.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 683GP1jB17498712 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 3 Sep 2026 16:25:01 GMT Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 29AF75805F; Thu, 3 Sep 2026 16:25:01 +0000 (GMT) Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8831858043; Thu, 3 Sep 2026 16:24:59 +0000 (GMT) Received: from fedora-workstation.ibmuc.com (unknown [9.61.31.144]) by smtpav05.wdc07v.mail.ibm.com (Postfix) with ESMTP; Thu, 3 Sep 2026 16:24: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=LSjKS1E6tVwohFxlF wrrau07oDT4Bm5Q2sX9O21YrCk=; b=qMfhupBnhvQtyxVDEvjvShkIZFHYjRt4V Gk6LHg+U77sbG10zucXzd75R0LqhCwCd0usWLyxaMhaDgLzxc6yEq5uOXV28waLj U5HJqgjf0+EQ6Zmotog0astnXy3YUqQ4PYzV+AcGM3j5+aUI7b8RBt2/k8AHt/tL oZphROOXnv1eJIRjD6f3YPDSGpUWZ3cuJJZssLmEujGfiE0CDogmQXPFM1dli/U2 L+NH0PAJaSvzxIk8oMod1FTe7eZ9IKHUvDa1PuWxd68E6Y1PwgL3x7fvHEdIaid4 ln/jw/hdUGoBRbqfXC1qmIyeCDKcSyI1LGiLVKBkOpXgtbNMQUO+g== 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, jdaley@linux.ibm.com, pbonzini@redhat.com Subject: [PATCH v2 5/7] hw/virtio: Add "loadparm" property to virtio net PCI devices booting on s390x Date: Thu, 3 Sep 2026 12:24:47 -0400 Message-ID: <20260903162449.2588271-6-zycai@linux.ibm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260903162449.2588271-1-zycai@linux.ibm.com> References: <20260903162449.2588271-1-zycai@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 3-RyKybhfEHUQ75eaRMvO1WKd0AUXNNQ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTAzMDE0MCBTYWx0ZWRfX2BaF8fXpK5GH Q3jhkHi2K3HXEACkXy8Uf4tgMZCJvmHYJw6bZfZ9CICnP+clKk9twFGhOP9uz/9LUp81nCsbBZz cI2Mpzv45Kw/p6wzoRZ07nCzsT2VIfZJG4KI1dJGXD6acTFkL6pDp5LlRu36YazLxM2tf9DPK0l eRlron5BK2qNer+8mZ5ZQGnfpZGrrk6cbTHXSd9bTXkdTewPocm7vPTfFHIehLr4Urx74Zp1bqE LaQP74MuOGUgg1kHRrKLKSTVRU0G4rCN1Yj12O7cykKtWOgE04TkMTgZYURcXL4QP8lz9Gz38vr 7/2Gj9fatVdC0AY3wZx+f95Y6A5B62b8vO875sOT1AsgtF0osu94a54tgQdMWMaFDpp3zXna5ms hzzE5yESpJfgMq7sY1FIM1Ea/1OFQN9D1sFKVReUxFEN2H4EQ2C3bHjLsPg7lO/12kcW9qq7kK/ 8lF8DnelLWZE4Uvi2Hw== X-Authority-Analysis: v=2.4 cv=Osl/DS/t c=1 sm=1 tr=0 ts=6a999f5f cx=c_pps a=GFwsV6G8L6GxiO2Y/PsHdQ==:117 a=GFwsV6G8L6GxiO2Y/PsHdQ==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=Y2IxJ9c9Rs8Kov3niI8_:22 a=VnNF1IyMAAAA:8 a=LEpY8eO1VcgwfWkpOzsA:9 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTAzMDE0MCBTYWx0ZWRfXySB+IpYWnjRl +Y5g+GUbRG404zewcgUPyUXDysLZMASQHHdLQKoZRlH/SdlDB2Ia23vXavrVqOa6ICmSavxzcm2 vQgOhA62GeH/JlkKJfbkycq5aEFNRjU= X-Proofpoint-ORIG-GUID: 3-RyKybhfEHUQ75eaRMvO1WKd0AUXNNQ 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-03_05,2026-09-03_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 malwarescore=0 suspectscore=0 bulkscore=0 lowpriorityscore=0 adultscore=0 impostorscore=0 phishscore=0 clxscore=1015 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609030140 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: 1788452772627158500 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 --- hw/virtio/virtio-net-pci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/virtio/virtio-net-pci.c b/hw/virtio/virtio-net-pci.c index fd3e0303f5..893d1905a9 100644 --- a/hw/virtio/virtio-net-pci.c +++ b/hw/virtio/virtio-net-pci.c @@ -77,6 +77,7 @@ static void virtio_net_pci_class_init(ObjectClass *klass,= const void *data) k->sriov_vf_user_creatable =3D true; set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); device_class_set_props(dc, virtio_net_properties); + pci_qdev_property_add_specifics(dc); vpciklass->realize =3D virtio_net_pci_realize; } =20 --=20 2.55.0 From nobody Sat Sep 26 22:14:45 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=1788452777; cv=none; d=zohomail.com; s=zohoarc; b=iRBWHx/eeIisfWnsh5BC+acqn9LmPk+Db1vMdhwLNjt9eYyVnV10+60IqKCWmokjv1BoPFz02zUQbBmE8tkofgxvY9NLk7GcaUPbzQj7z+IsiMKPEK5xzJsnFbAQpQvfALm4G63qWh11+jsYrCZGpguZWH1cgSiN4eVuUpzbqu0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788452777; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=drmyZ3p3oUWb8jhPLGo8lOYWeDHUXRL37N7zlYohvUM=; b=ddNi5Ha+Vm4qawQeZM8NYl/yi+90kwvpL3Rj/nECnwaybK7id+PSsKPcWEYhO6timc2NXNQ5do9UikhH6b+AQxET/HAeK1wRP1HIbx5nKfiv57wKsTBLAoCwJNZArRGifh31Jx7dGeylTwJAn4BVQQ25eWbnjbOX8NSlJ8zyae8= 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 1788452777296168.7948029140705; Thu, 3 Sep 2026 09:26:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2AFX-000432-GT; Thu, 03 Sep 2026 12:25:15 -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 1x2AFQ-0003wg-OR; Thu, 03 Sep 2026 12:25:08 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x2AFP-0006Z2-5L; Thu, 03 Sep 2026 12:25:08 -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 683G2sHX3304765; Thu, 3 Sep 2026 16:25: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 4gbmuj5kss-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 03 Sep 2026 16:25:05 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 683GBkgP018205; Thu, 3 Sep 2026 16:25:04 GMT Received: from smtprelay03.wdc07v.mail.ibm.com ([172.16.1.70]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 4gcbygr9ns-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 03 Sep 2026 16:25:04 +0000 (GMT) Received: from smtpav05.wdc07v.mail.ibm.com (smtpav05.wdc07v.mail.ibm.com [10.39.53.232]) by smtprelay03.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 683GOLuN66257216 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 3 Sep 2026 16:24:22 GMT Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D94B45805D; Thu, 3 Sep 2026 16:25:02 +0000 (GMT) Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 55A8158053; Thu, 3 Sep 2026 16:25:01 +0000 (GMT) Received: from fedora-workstation.ibmuc.com (unknown [9.61.31.144]) by smtpav05.wdc07v.mail.ibm.com (Postfix) with ESMTP; Thu, 3 Sep 2026 16:25:01 +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=drmyZ3p3oUWb8jhPL Go8lOYWeDHUXRL37N7zlYohvUM=; b=VNtrkIlzqtM8ApvlTpjtsquZ0Q7/0XlBi 98cZQgc3EZHqhl2fpxydmOT7afQ6nAgi3YqO/YG/ynXFskKjcT4v9LyAHobhSbmE 3IyImHbvtaSSVWJmUWjj4Eaz/5stVFz2IJmFLyyKGI1UJzrByPUr97CYqSXpD7DW xYkYyhJKHbZ04WlX1TSjxOrhtBx0XWXbNsx/7YW0IySTxjl5HdWDm2w2SCqiml28 p7eSdiMQdD5LO6VHbSsEyzTDf00l/pBIAOCOQnClrqXkgQmVcBfIeJ0bxOCa/5Ny vNtewfE0T4McreFomoRRUzvyRT4hZdvaj+S4e5gm/i2iKKGfzzOGw== 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, jdaley@linux.ibm.com, pbonzini@redhat.com Subject: [PATCH v2 6/7] tests/qtest: Add s390x virtio net PCI test to pxe-test.c Date: Thu, 3 Sep 2026 12:24:48 -0400 Message-ID: <20260903162449.2588271-7-zycai@linux.ibm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260903162449.2588271-1-zycai@linux.ibm.com> References: <20260903162449.2588271-1-zycai@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: Yt-ROsJHyKbBlRad5jBIWXxWpnfvAHvQ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTAzMDE0MCBTYWx0ZWRfX6A55NGtNYvqt SEfZv7RiZV6UII/kCSz0ce+udx3H/ap778Ev5XR2YXHJyHGIL2K1aAw1n+dXPiKuJoKXISBjW/i gF5xp7hLJTlzgptfnz7At5eQiMZfCy2jS0IpM+cEM3tplAc5DlJ+1YPGSJdNnYr+mc9cg9K7mIu bHTLi+rZ5HdYSzqD8qIZbwu0JLNxcZuQLDw/ejZvq1XHgd2fEVvxNMJUiD20YRoLzdLv9cTMUYG 0ByNj3lohKM3bdYW2DXbAgyo2rhCdkYAq5LVFWxdqeky6OkCO0y3/m8jfzQk4rZLe0Llkd9MUAb BQthYnGgvR3AKdJQKVW+elzllDIiyjbsZoyKkVWYxJQRZtx1JG04QKsReEPn+Nh8eEEkt9LLNxr cfSJFQ/g1pnBQfIJUZai768jKOn1XRp15qNbm+gMYWRf9UUb3W559XJOW1Nb3/T41/LSSJhyrZy pZruVQjtFQ8QrdIGYcQ== X-Authority-Analysis: v=2.4 cv=Osl/DS/t c=1 sm=1 tr=0 ts=6a999f61 cx=c_pps a=AfN7/Ok6k8XGzOShvHwTGQ==:117 a=AfN7/Ok6k8XGzOShvHwTGQ==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=Y2IxJ9c9Rs8Kov3niI8_:22 a=VnNF1IyMAAAA:8 a=PkLLOfym-WlFbigP99UA:9 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTAzMDE0MCBTYWx0ZWRfXyutGpLnkdzp5 R+7Gv0T6TnAaZB27qmcB1AqWDj6pL9QdCQrBdaiTBSs1H/ve0hTQ4pFOpI0VpqEWfdxDA7DYYMc qf3Qzp5cUgL8piscHxfkKTK7ieT2K/s= X-Proofpoint-ORIG-GUID: Yt-ROsJHyKbBlRad5jBIWXxWpnfvAHvQ 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-03_05,2026-09-03_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 malwarescore=0 suspectscore=0 bulkscore=0 lowpriorityscore=0 adultscore=0 impostorscore=0 phishscore=0 clxscore=1015 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609030140 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: 1788452778740158500 Content-Type: text/plain; charset="utf-8" Add test coverage for virtio-net-pci network booting on s390x by including it in the PXE test suite. The test verifies that PXE network booting works correctly with virtio-net-pci devices. Signed-off-by: Zhuoying Cai Tested-by: Joshua Daley --- tests/qtest/meson.build | 1 + tests/qtest/pxe-test.c | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index 50a1a5272f..654e145fbe 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -289,6 +289,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..bfa3b98cad 100644 --- a/tests/qtest/pxe-test.c +++ b/tests/qtest/pxe-test.c @@ -60,6 +60,7 @@ static testdef_t ppc64_tests_slow[] =3D { =20 static testdef_t s390x_tests[] =3D { { "s390-ccw-virtio", "virtio-net-ccw" }, + { "s390-ccw-virtio", "virtio-net-pci" }, { NULL }, }; =20 --=20 2.55.0 From nobody Sat Sep 26 22:14:45 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=1788452754; cv=none; d=zohomail.com; s=zohoarc; b=hA0myZQKNZvcQh9AslU9ih6T4+rTB1RZuwmt0RVer8GuNOOPkFA4C+N6sDo3vlfqNl/pqDFUYSIfKw61Kq9Rvi3hcgYkJ9RCCrNiIwvANfjqJsAiEHTpM98vQxFx6bzUh9zhMFyUSNKH6ZvOxsHEIPKEFarsDgwuhb0XP1zQnNc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788452754; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=t/y/vTQBtlIWi2+w7VEwIBur1cVx13Tpa7RfgWXb4C4=; b=TZHlNrlJ0AqdyTXEk+jqmV6Gpnj4nSj3F2L23q00mcWLWD+iNUhL5EQk/zzBGi++l/5ksIOE0mb6EOVnviy/rySsq5V6A2keDTj6yH+MBMHE78oW/MSQ++vVP3gU2Eobo42ha51DL1VBd7ChtFeZ4l4AR+hbMedMajeUD5n/Vio= 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 1788452754772645.1855454284573; Thu, 3 Sep 2026 09:25:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2AFZ-00047f-5X; Thu, 03 Sep 2026 12:25: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 1x2AFT-0003yQ-5l; Thu, 03 Sep 2026 12:25: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 1x2AFR-0006a8-6k; Thu, 03 Sep 2026 12:25:10 -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 683G2VaC1550103; Thu, 3 Sep 2026 16:25:07 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 4gbq3rnush-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 03 Sep 2026 16:25:07 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 683GBhw0018186; Thu, 3 Sep 2026 16:25:06 GMT Received: from smtprelay05.wdc07v.mail.ibm.com ([172.16.1.72]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 4gcbygr9p2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 03 Sep 2026 16:25:06 +0000 (GMT) Received: from smtpav05.wdc07v.mail.ibm.com (smtpav05.wdc07v.mail.ibm.com [10.39.53.232]) by smtprelay05.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 683GP4Yh34538048 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 3 Sep 2026 16:25:04 GMT Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7788958053; Thu, 3 Sep 2026 16:25:04 +0000 (GMT) Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0DB1B58061; Thu, 3 Sep 2026 16:25:03 +0000 (GMT) Received: from fedora-workstation.ibmuc.com (unknown [9.61.31.144]) by smtpav05.wdc07v.mail.ibm.com (Postfix) with ESMTP; Thu, 3 Sep 2026 16:25: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=t/y/vTQBtlIWi2+w7 VEwIBur1cVx13Tpa7RfgWXb4C4=; b=WNuHorAI2f4U7Rb8IDPHQsY9AwkgVtJVY c9wWuxOn/HoF49p4xq3P2Bo+c1KkStZ9K/Wc/FGkErB7qTMEZn0Zoti2dcu7RpEt 2ACl6H5+FCgwnIHtJTECECQRTqf8wYRUPPhvb4Vqh2qhER2sqclRQ5xhhkwpehda wfVhGNjtIl5EOs7mZAee3EdhZaKF9sOA/sZt8nTFU5C/DvDbJxWfEGIZQrk0XYqN 01kmB/nLjqGUy03j+gbDdEsMgKoBn3+5F1RubUUTRfSPfGopJ3VukrAVXtt0sSx6 l95aMsIvImG6WkLlIlgDyV8u0qbjYfqSQrGxJTnfa7mnTPCiO8sig== 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, jdaley@linux.ibm.com, pbonzini@redhat.com Subject: [PATCH v2 7/7] tests/functional/s390x: Add tests for virtio net PCI in test_pxelinux.py Date: Thu, 3 Sep 2026 12:24:49 -0400 Message-ID: <20260903162449.2588271-8-zycai@linux.ibm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260903162449.2588271-1-zycai@linux.ibm.com> References: <20260903162449.2588271-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=EIc2FVZC c=1 sm=1 tr=0 ts=6a999f63 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=Z6bpV0tWmYslb40Kif8A:9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTAzMDE0MCBTYWx0ZWRfXxHZvMctZRpvi X1RhdZQC5QVS5/iUOtS8AlyEuPpglD83HdgvyHFzTeq1ELu/1xvNgTb/8EuwxAqKmOK4jiBsYd2 g1LogsBmd+G8qlgJdgzP3cdF47baYBMEPGW2vgCRWn+53fQFJv6o0BbLakblB02FBWU8YkJ90HP btNxC9D5+ao3WSchEFvB3FebUuuVzfSahw3SCKgtvZETUxv+NyVuzClPm3JvrujzC1TdxfvmrPW VgRKUNp5pxdSoTm3X+fQTWUV1+HpBhCAZa2BnSM6JYXuVX7Wdc8Ix0FM0wh3F0w9F5aEmc+MhPc zewYtR6Oq5b9QTaufc9T2c18jQEQT64k7Iq0z5x1g3GALYXoZRAwQy4vr21Dfema0UG6sjZqIso jROjXrK/W5zTvrRLUt0YEydX2DljdwYQydAhTm4D5CxwpmbWt60mwblt946COrmdWPYTcivhgR2 8lYQ6IuGqUI6rFP6LQA== X-Proofpoint-GUID: 8keF10rWEvjNaiKTT6WCS9RA7Fqmbsm- X-Proofpoint-ORIG-GUID: 8keF10rWEvjNaiKTT6WCS9RA7Fqmbsm- X-Proofpoint-Spam-Info: AW1haW4tMjYwOTAzMDE0MCBTYWx0ZWRfX3gcmcbY0XhDX X+pD1pCn14xRsNFI5jErRkA4FvPI272pIatvbL7k6iCncYx8jOq1RMM1H8chINVm0BzOGgnf4vP tuYJRL455PBg5pAxRqUFAq9lh448X2M= 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-03_05,2026-09-03_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 impostorscore=0 suspectscore=0 priorityscore=1501 clxscore=1015 phishscore=0 spamscore=0 adultscore=0 lowpriorityscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609030140 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: 1788452756463158500 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 --- tests/functional/s390x/test_pxelinux.py | 71 ++++++++++++++++++++----- 1 file changed, 59 insertions(+), 12 deletions(-) diff --git a/tests/functional/s390x/test_pxelinux.py b/tests/functional/s39= 0x/test_pxelinux.py index c00cce6a5a..7223364852 100755 --- a/tests/functional/s390x/test_pxelinux.py +++ b/tests/functional/s390x/test_pxelinux.py @@ -50,7 +50,8 @@ class S390PxeLinux(QemuSystemTest): '/images/kernel.img'), '480859574f3f44caa6cd35c62d70e1ac0609134e22ce2a954bbed9b110c06e0b') =20 - def pxelinux_launch(self, pl_name=3D'default', extra_opts=3DNone): + def pxelinux_launch(self, pl_name=3D'default', extra_opts=3DNone, + dev=3D'virtio-net-ccw'): '''Create a pxelinux.cfg file in the right location and launch QEM= U''' self.require_netdev('user') self.set_machine('s390-ccw-virtio') @@ -74,7 +75,7 @@ def pxelinux_launch(self, pl_name=3D'default', extra_opts= =3DNone): with open(cfg_fname, 'w', encoding=3D'utf-8') as f: f.write(PXELINUX_CFG_CONTENTS) =20 - virtio_net_dev =3D 'virtio-net-ccw,netdev=3Dn1,bootindex=3D1' + virtio_net_dev =3D f'{dev},netdev=3Dn1,bootindex=3D1' if extra_opts: virtio_net_dev +=3D ',' + extra_opts =20 @@ -85,9 +86,9 @@ def pxelinux_launch(self, pl_name=3D'default', extra_opts= =3DNone): self.vm.launch() =20 =20 - def test_default(self): + def do_test_default(self, dev): '''Check whether the guest uses the "default" file name''' - self.pxelinux_launch() + self.pxelinux_launch(dev=3Ddev) # The kernel prints its arguments to the console, so we can use # this to check whether the kernel parameters are correctly handle= d: wait_for_console_pattern(self, 'testoption=3Dteststring') @@ -95,36 +96,82 @@ def test_default(self): wait_for_console_pattern(self, 'Unpacking initramfs...') wait_for_console_pattern(self, 'Run /init as init process') =20 - def test_mac(self): + def do_test_mac(self, dev): '''Check whether the guest uses file name based on its MAC address= ''' self.pxelinux_launch(pl_name=3D'01-02-ca-fe-ba-be-42', - extra_opts=3D'mac=3D02:ca:fe:ba:be:42,loadpar= m=3D3') + extra_opts=3D'mac=3D02:ca:fe:ba:be:42,loadpar= m=3D3', + dev=3Ddev) wait_for_console_pattern(self, 'Linux version 5.3.7-301.fc31.s390x= ') =20 - def test_uuid(self): + def do_test_uuid(self, dev): '''Check whether the guest uses file name based on its UUID''' # Also add a non-bootable disk to check the fallback to network bo= ot: self.vm.add_args('-blockdev', 'null-co,size=3D65536,node-name=3Dd1= ', '-device', 'virtio-blk,drive=3Dd1,bootindex=3D0,l= oadparm=3D1', '-uuid', '550e8400-e29b-11d4-a716-446655441234') - self.pxelinux_launch(pl_name=3D'550e8400-e29b-11d4-a716-4466554412= 34') + self.pxelinux_launch(pl_name=3D'550e8400-e29b-11d4-a716-4466554412= 34', + dev=3Ddev) wait_for_console_pattern(self, 'Debian 4.19.146-1 (2020-09-17)') =20 - def test_ip(self): + def do_test_ip(self, dev): '''Check whether the guest uses file name based on its IP address'= '' self.vm.add_args('-M', 'loadparm=3D3') - self.pxelinux_launch(pl_name=3D'0A00020F') + self.pxelinux_launch(pl_name=3D'0A00020F', dev=3Ddev) wait_for_console_pattern(self, 'Linux version 5.3.7-301.fc31.s390x= ') =20 - def test_menu(self): + def do_test_menu(self, dev): '''Check whether the boot menu works for pxelinux.cfg booting''' self.vm.add_args('-boot', 'menu=3Don,splash-time=3D10') - self.pxelinux_launch(pl_name=3D'0A00') + self.pxelinux_launch(pl_name=3D'0A00', dev=3Ddev) wait_for_console_pattern(self, '[1] Nonexisting') wait_for_console_pattern(self, '[2] Debian') wait_for_console_pattern(self, '[3] Fedora') wait_for_console_pattern(self, 'Debian 4.19.146-1 (2020-09-17)') =20 + def test_default(self): + '''pxelinux.cfg "default" lookup via virtio-net-ccw''' + self.do_test_default('virtio-net-ccw') + + def test_default_pci(self): + '''pxelinux.cfg "default" lookup via virtio-net-pci''' + self.require_device('virtio-net-pci') + self.do_test_default('virtio-net-pci') + + def test_mac(self): + '''pxelinux.cfg MAC-address-based file lookup via virtio-net-ccw''' + self.do_test_mac('virtio-net-ccw') + + def test_mac_pci(self): + '''pxelinux.cfg MAC-address-based file lookup via virtio-net-pci''' + self.require_device('virtio-net-pci') + self.do_test_mac('virtio-net-pci') + + def test_uuid(self): + '''pxelinux.cfg UUID-based file lookup via virtio-net-ccw''' + self.do_test_uuid('virtio-net-ccw') + + def test_uuid_pci(self): + '''pxelinux.cfg UUID-based file lookup via virtio-net-pci''' + self.require_device('virtio-net-pci') + self.do_test_uuid('virtio-net-pci') + + def test_ip(self): + '''pxelinux.cfg IP-address-based file lookup via virtio-net-ccw''' + self.do_test_ip('virtio-net-ccw') + + def test_ip_pci(self): + '''pxelinux.cfg IP-address-based file lookup via virtio-net-pci''' + self.require_device('virtio-net-pci') + self.do_test_ip('virtio-net-pci') + + def test_menu(self): + '''pxelinux.cfg interactive boot menu via virtio-net-ccw''' + self.do_test_menu('virtio-net-ccw') + + def test_menu_pci(self): + '''pxelinux.cfg interactive boot menu via virtio-net-pci''' + self.require_device('virtio-net-pci') + self.do_test_menu('virtio-net-pci') =20 if __name__ =3D=3D '__main__': QemuSystemTest.main() --=20 2.55.0