From nobody Mon Sep 28 02:00:07 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=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1785231684; cv=none; d=zohomail.com; s=zohoarc; b=iFEfG4Lvq/OfQZDitCELgFNXdQimcIBRMGenwZCQ+3pyjFhlaprLHrgRwtrtHs+rK5tlX/Hm0dQWzyeq/JObD5bhWyYSXT/6AYs3l8erXU146VD/9ltN4yxk8bkQrC7sZqTq5U4PDErFUfmXgyagRgrZEcX7Ngv19OVGGJs1g8Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1785231684; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=u/byRxww6h1eTsTIyxFmwIVT8X+SFfGh7WiYz2U2f1s=; b=SpSCKQDTxXGpDAdYxugzWVL+qtxByN1rSp4oVYQDx77Cp8Mjq5Ev8302wdi+oryb9aVAVEImqw/6+gOiZBUOwdoTW6NBTtVrrxRr6DUu0ilFO8cp1iuaKSOyHuVfBXu0sPTqOKttn387GkItI0RMxey+rioGZPb3mMKkbuOTabc= 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 1785231684611490.9827489786783; Tue, 28 Jul 2026 02:41:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1woeJE-0002c0-Dj; Tue, 28 Jul 2026 05:41:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1woeJB-0002Zz-DN for qemu-devel@nongnu.org; Tue, 28 Jul 2026 05:41:09 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1woeJ9-0007Od-Ls for qemu-devel@nongnu.org; Tue, 28 Jul 2026 05:41:09 -0400 Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66S82Ghr2128814 for ; Tue, 28 Jul 2026 09:41:05 GMT Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fpbn8bh7g-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 28 Jul 2026 09:41:05 +0000 (GMT) Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-51c1a97644aso45880581cf.2 for ; Tue, 28 Jul 2026 02:41:05 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47f85c66cebsm57977299f8f.30.2026.07.28.02.41.03 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 28 Jul 2026 02:41:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= u/byRxww6h1eTsTIyxFmwIVT8X+SFfGh7WiYz2U2f1s=; b=AqPhFsJL88cOtGk2 BfRo3c1WK/tm7Ki9PBvLLrJ2XTXQjMNCDpwZO8EX0+7d/y32zwPsMbPEGe4HGpoM KjmxNf4q+Thz++3jStywynIkNaj3BH0qZWDIqSP8lqSU843piRyDU/z4mksH1rct EaLewsZYXQs/N+eCJ/9OPqni6KuTtCxmzTOYYGsadr87h2liHjkd41YxNkjpMkHN Ya+my+0jnLt4bOSFXrUdCpDOeypiIz5HwgarVs+ykYnumf3VTY/AHj9zBZyv9LfO Gc0x1NKK1Wu0pqkgekFJY4AXx+Mv3GGo2/B8shOYD9ztaV1aa8x+ZbvIESFp3GnD Pkb53w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1785231665; x=1785836465; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=u/byRxww6h1eTsTIyxFmwIVT8X+SFfGh7WiYz2U2f1s=; b=bXiod4GZgkl3+usoSxvNt9W3o8MOOKQM5OcjRSmOUJPIu5ewVbRqFnDr+KiDLjI+t4 eeE0zcR9b2beF9xPduZnzJzYEtCGeYJUBH6w4YITFvHAKMdxxnHMKjpRm6Srxrnv03In pyc7V+rfDxaHWD0B52J+VFaAVqXn/uQloAH/7mxEmcOiOmyfR95R4frKkV/O8mzzeYW6 IGSdZgcLCjq8zDHkpkKNuRHqRCeGrfoFKS+In1xGY0diYDyCY0wBcdkGKlcr/b1rEjcS VjU8i3XDiSQ9sKPSLNAQOTKrkFx+OzPvnq9Xz0sqqYMMZZxZVs8WESx9nSqq9rBdznII 6iZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785231665; x=1785836465; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=u/byRxww6h1eTsTIyxFmwIVT8X+SFfGh7WiYz2U2f1s=; b=bhxQ4PqBOGooO7UzDcGlwMhkGEb9FVo9MGKe1craWe4lxkGMr/o6Knc+QdZetWTmcY qIb3TaCD6uzd1Np5aE9CnJLZddm2t5xBGME/ezvmxtcx/RxORWi27jj+vBDlubl+jxL5 jsBU7ZL9b8tKybbi8aIvSH6mG729/j7s5pvistYDeaVtOjwHUNRYPG0T1yqo0gATTNaF zCJd9HPtl6S6k3oFmxI6abPldbdoXsxeYhvsDchzquZphzoV3hGYGu23Elx9wtlyGYER Wu8lyYzMayRw++fdIQM0C8IkFF2b0qHkQ1D9R6Iud0vviK596WYF65brfAngROIZCeh1 T+Eg== X-Gm-Message-State: AOJu0YxZru6I1EJh0jT3TVg21MmwpD/6KKxuN1tSY+2cZorXZof/d1Pr Xo6yz4duHZz5/8x58ADHatcFxCjugwHxsiLxFu4+qC635hhpiIoeYQ3Y9d8/TUFf62xvCtJIAac 5dbLxkTGKWJi3BdDnhMDnDCLf2dqIprphIp0YrPz4F3Dg5j/7LNBPAz9i92r5b5HtAg== X-Gm-Gg: AR+sD12naXnSLOypOjUfZ4IjrVne6+rNGL/BicffchC3GqA08JiH4RqjbcoPwTgv3v4 yZaUkvr97DTjj6S7vsCs7RFaQOcJME/3wPnGJMho9vHaNo+aOTRDAg0v1qVdAisMAerhmWdWgCL luXO+j3mwwQFR5bYM2qEZblgofzbE9Ed5ZkXn9IE2lwXKpwHEd/XtM/R35gkHwQ0dSuX/ty5ILl 4ggjZxJOYd0sDNaKK51vpF2PHeMIi+aBaBIynyvv55D7KGuwk/tWeU8HMbRh0HNQbsbzJd7d8Z/ BmZR1jWSEc+K3ENSsdrV/eBZe9TJX7g44GPX2btgMFkqxaCLStDlMTya/bF+yw0I7/tgmSdZw4A K7Jd70Vlk0DspAvSxCiczuULZLAwHSiPIzat2+eYIRmKkhIFleGDQtwDKVA== X-Received: by 2002:a05:622a:558b:b0:51c:667:7e30 with SMTP id d75a77b69052e-529d70d8521mr11364071cf.47.1785231665031; Tue, 28 Jul 2026 02:41:05 -0700 (PDT) X-Received: by 2002:a05:622a:558b:b0:51c:667:7e30 with SMTP id d75a77b69052e-529d70d8521mr11363821cf.47.1785231664337; Tue, 28 Jul 2026 02:41:04 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 1/6] hw/net/xilinx_axienet: Don't write checksums off end of packet Date: Tue, 28 Jul 2026 11:40:50 +0200 Message-ID: <20260728094055.12684-2-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260728094055.12684-1-philmd@oss.qualcomm.com> References: <20260728094055.12684-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI4MDA4MyBTYWx0ZWRfX0ypmpS1O66J2 zsZwlA7KDzHPJr2ILFmDhzLOHBpAWtrzOY1TyjbTcXwU6/2j37Rw3u7Bga8ZK+cakhw/XOwOasW 1MfvSCsKqFcj2cvzzGLE+0i9a64FTqclhikZQzXoQVfE1TqDHSN6lDJSS1MNeKqdKHilzM53Sli 6z19KZOrGRl8ey+0MQHners5GRfTVC0NdNkUpSfPE9zTtMjA4ICKpA0xAGfsUUYJcZz6F/clQUQ AvMZycbzuJCkWoWASAgM28rbCuoimh/pCaaVkiS8VmB0c7Ppb9CgkfrgUg5+DwiJrfTPcYMXlhw J2qBIsSDaGU2wH3jPc6//Fqeo+yF1z83wFu9yvR1mx7dMy8fkVIY5RlWy4Ri7si3xKrgZ6IeCfX bWXb1O+VyJi9HLHyKRb/F2DyUKxdTrKWICj06fkRLOphfS6/2sVWP9YlL5vXyTqoG0vLmeEzjLx a+dAaNON/9BV2ynBW2g== X-Authority-Analysis: v=2.4 cv=RO+D2Yi+ c=1 sm=1 tr=0 ts=6a687931 cx=c_pps a=EVbN6Ke/fEF3bsl7X48z0g==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=p0WdMEafAAAA:8 a=KKAkSRfTAAAA:8 a=69wJf7TsAAAA:8 a=EUspDBNiAAAA:8 a=JF9118EUAAAA:8 a=keMAUe95F7znPUNsns8A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=a_PwQJl-kcHnX1M80qC6:22 a=cvBusfyB2V15izCimMoJ:22 a=Fg1AiH1G6rFz08G2ETeA:22 a=xVlTc564ipvMDusKsbsT:22 X-Proofpoint-ORIG-GUID: ozyWDdBcZEspOTB7D2ZyeasMK8OPWFjd X-Proofpoint-GUID: ozyWDdBcZEspOTB7D2ZyeasMK8OPWFjd X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI4MDA4MyBTYWx0ZWRfX6QrXYm++hNoK SaeDy3RShtAboeNZJXWaa1v1a6pHmOLbZB7ebSwmIzw3EtV5bpiRcmlF7H+E0Nx7Ebrik49bk91 OnvKo0qoR7VLDKCP6M1PW2t4oBJAkWM= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-28_02,2026-07-27_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 suspectscore=0 phishscore=0 priorityscore=1501 spamscore=0 lowpriorityscore=0 adultscore=0 clxscore=1015 malwarescore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607280083 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=205.220.180.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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 @qualcomm.com) X-ZM-MESSAGEID: 1785231685523158500 From: Peter Maydell The xilinx_axienet device has ethernet checksum offloading, with a mode where the guest provides the offsets within the packet where the data to be checksummed starts, and where the final checksum should be written into the packet. We don't sanity check the TX_CSINSERT offset before writing the checksum data into it, which means the guest can pass us a value that is larger than the packet itself and cause us to write the checksum off the end of the buffer. We also don't explicitly check the TX_CSBEGIN offset; this doesn't currently cause any problems because we will pass a negative length to net_checksum_add() which does nothing, but it's a potential trap for the future if the type used for the length gets changed to be unsigned. Explicitly check the offsets. The datasheet doesn't say what happens if the guest misprograms this, so we choose to log an error and send the packet as-is. Cc: qemu-stable@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3599 Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alistair Francis Message-ID: <20260706162704.787495-1-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/net/xilinx_axienet.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/hw/net/xilinx_axienet.c b/hw/net/xilinx_axienet.c index 9f5f65ecfac..d35f4a847d6 100644 --- a/hw/net/xilinx_axienet.c +++ b/hw/net/xilinx_axienet.c @@ -922,20 +922,27 @@ xilinx_axienet_data_stream_push(StreamSink *obj, uint= 8_t *buf, size_t size, if (s->hdr[0] & 1) { unsigned int start_off =3D s->hdr[1] >> 16; unsigned int write_off =3D s->hdr[1] & 0xffff; - uint32_t tmp_csum; - uint16_t csum; =20 - tmp_csum =3D net_checksum_add(s->txpos - start_off, - buf + start_off); - /* Accumulate the seed. */ - tmp_csum +=3D s->hdr[2] & 0xffff; + if (start_off > s->txpos || write_off + 2 > s->txpos) { + qemu_log_mask(LOG_GUEST_ERROR, + "%s: offsets outside packet, skipping checksum\n= ", + TYPE_XILINX_AXI_ENET); + } else { + uint32_t tmp_csum; + uint16_t csum; =20 - /* Fold the 32bit partial checksum. */ - csum =3D net_checksum_finish(tmp_csum); + tmp_csum =3D net_checksum_add(s->txpos - start_off, + buf + start_off); + /* Accumulate the seed. */ + tmp_csum +=3D s->hdr[2] & 0xffff; =20 - /* Writeback. */ - buf[write_off] =3D csum >> 8; - buf[write_off + 1] =3D csum & 0xff; + /* Fold the 32bit partial checksum. */ + csum =3D net_checksum_finish(tmp_csum); + + /* Writeback. */ + buf[write_off] =3D csum >> 8; + buf[write_off + 1] =3D csum & 0xff; + } } =20 qemu_send_packet(qemu_get_queue(s->nic), buf, s->txpos); --=20 2.53.0 From nobody Mon Sep 28 02:00:07 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=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1785231692; cv=none; d=zohomail.com; s=zohoarc; b=k12LU8sLytiuF+/P8hwX+aPHGkDMxag6A45GMchbC9UBufA0xVxTkS9FvIsIVA3H7dVmgiCk8NE4N8mJ2Ev9xMNainUtGIzZHu4Ls3fI0o34+L8fCbgcCteM9wghtrVouhD/0nGT2Ex2T3DKLYlAnHwe9xdx2MP829c8S2slbHw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1785231692; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=cUMY7buvUujjwmjvw1tjC7sd0Ar7z/xxnVlDZDXYTMM=; b=jYuSCi/osHD8ZLuM22eSTq5BxqSBQAPIhtKvJitizx4jFXoeAVXPaU4oBDVHFMu8qw3pGYBrZMfSOtuMZ0DSdLZEDBcW1CfoOp4iIeVxeMamxlZ/a2rXwgsa0eZCECSkHfkhu4/pRIIkTKHbvq8BIxwKIs7xJeqr9RdRdBX009A= 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 1785231692387824.3043823631615; Tue, 28 Jul 2026 02:41:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1woeJL-0002l1-63; Tue, 28 Jul 2026 05:41:19 -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 1woeJG-0002dy-Vv for qemu-devel@nongnu.org; Tue, 28 Jul 2026 05:41:15 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1woeJF-0007QI-8z for qemu-devel@nongnu.org; Tue, 28 Jul 2026 05:41:14 -0400 Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66S82Eji2026962 for ; Tue, 28 Jul 2026 09:41:12 GMT Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fpq9hgraa-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 28 Jul 2026 09:41:12 +0000 (GMT) Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-51a8db414c7so54235011cf.0 for ; Tue, 28 Jul 2026 02:41:12 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-496c45cb67esm67587875e9.8.2026.07.28.02.41.10 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 28 Jul 2026 02:41:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= cUMY7buvUujjwmjvw1tjC7sd0Ar7z/xxnVlDZDXYTMM=; b=SMhTE+PVDHEXPb71 tswbFjZHxRy5I7dsSSlKdeSnxR5waF/2BlflUa7QZCWYfuWhk3j15B/Qh/UldWYz Gs0xAu0bWgxJvLU2q2sHZGpL/5ak8OjSpsSHk69PKn1uM1IwgKQerl1+rpIA2PU9 ttO4rCJRXQlzIRQxqB2UHCU4ywnqeMFPpdz9DZzj2bUQQ6Kigt5n87CNJ28VMlIm ITeuR/hZUz0d0KyjcvYSgWVs01e7HA4JwnceSRQzcE8ga8lek+jSuU7Ot70xTuzM cZNinAcX+pxJ/BoK6iajiwGMXgkGBslO0jpA7o0OkyArQTduOv2H/Aie3yqHg2p5 VKgUfw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1785231672; x=1785836472; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=cUMY7buvUujjwmjvw1tjC7sd0Ar7z/xxnVlDZDXYTMM=; b=aJ5oBZqA/V0Mr4ny2P3C0W8ZDsWdy83Y01NWnemKbSFq9LTcTIT0nqUNE8Paq7VXAq 9TBDOZE0h01ycMo3S/z2LJbwjpBt78I1Ql+QvFiohl27UW78N7ZE5W04JgpVpkCcS5J7 do9obcZYndwSTJjGOqXKdHn3xRet4HLs+SRLTcmKn616rnd/MbqOo3aU9+Jz+/4Q3dWe YMxkJdPSwcKr4bO0fikOhuP95W8imi06LrGQTt7TU42Zz5UtC7RuSxvYR/8GOO8uNmb8 4sVX2vOJZJUs0aLXMIKftP02MUGFg7rx8sJVuXUyIHy5b7bwnHoBdi99PAJzl7RWHbZP zfWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785231672; x=1785836472; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=cUMY7buvUujjwmjvw1tjC7sd0Ar7z/xxnVlDZDXYTMM=; b=FYnAjI5pg6/hOAOCQx7vxjIYVULgWn1dqa+DotXd6mRfnDcvm0shKqqQxxBHTD2x5a NCTFlhZTi2w4evxWxvnOKyj67h1um8SCywDIjVwCsMzkJR2Yy0cT/i+H2vYrqIU7+DqY qOBKLwdnMwDqtiNHWm7w+keYREYQNTWHsPFtFtrayRe+A9M2eC4P6mUg5ziHh3Z9k47u mHDYKJbg5CfpSv44de+wBRU1i2b+sntBggkkXSzRB2U867q9aQP/oRRc3KfjcoSxwlSu t3ZSFkP7cC9QbcTne/LD8T/8e7MbcTzGtbrdSjoJmUfVzEaPNrof7+blT7bFXFXoJY3m LtGg== X-Gm-Message-State: AOJu0YwKAxJ4W0kQmn/jpD+kBXwm32wkRvEDQE2U1gMY6uqTpmOqIx1R MBENLZ0hUygPgvCbjSC/cS8kFbOkYwDPI9yM0Lwf+LW7lq6YsJ8DbeuEza6MURZVXMUtBDMxuSF OtXAgzVm1v30hXkeXVNT2G058ZeOqX7S5SvzHcAN6EDqJhsHTDsZw2+G1Pf7nLoqJuQ== X-Gm-Gg: AR+sD10tOaZ7FZ2jgxN+ShypcbnG2jzjeUsKOwn6Po2RLZyBf1fk0q9ljqBm+YMvT3L 9CcmsQF41b4dhR2Qr7oJBLwTGuh7TMvMCAXF2ncOMC68atPhz6rrDwtN6LiXgD6nfrfSMpg8y2P n8XNFPfr/pI2z6QqLQWApbbcRgTfd0RS96zmIZArY5h6KAxyZooNHq0BFBsq/0RuUIqIlGlqlDj h0NA7yFUf0pYUAw2yZuzIb1IyO/1AST1AtvTZFWCkJe3CPjLboz9IM2BbhZfbZ/MVosS07KRO+k ZGG7XVRKXvXUU8xcGizgnbf4xZnvf+uaqEKnwB/ygzQfi0RmRfyQ/FqVzQhFy/qFBInKEDP+Syv 328KDSv7elEM2NoDmGpA3o/3iP+DfeXVlkkpfgXSkEG3M/eHLBKuDCpA97g== X-Received: by 2002:ac8:5f8a:0:b0:51a:8c9a:8fb3 with SMTP id d75a77b69052e-529d72226d4mr11994801cf.68.1785231671678; Tue, 28 Jul 2026 02:41:11 -0700 (PDT) X-Received: by 2002:ac8:5f8a:0:b0:51a:8c9a:8fb3 with SMTP id d75a77b69052e-529d72226d4mr11994501cf.68.1785231671074; Tue, 28 Jul 2026 02:41:11 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 2/6] hw/sd/sdhci: Extract uSDHC-specific quirk Date: Tue, 28 Jul 2026 11:40:51 +0200 Message-ID: <20260728094055.12684-3-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260728094055.12684-1-philmd@oss.qualcomm.com> References: <20260728094055.12684-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI4MDA4MyBTYWx0ZWRfX9eLLy5WF1CMr DL554uIXPUG83N2IeOHDpe44g2Fx8jkczpRtJ4J2N18faSxRXojEyZZmFq/YWRw7QVeyDEW+50y +7gCa7vW6mVGNqPwE4jgtIuLOlB7pZg= X-Proofpoint-GUID: c0KyRfDKaO5QntFBC3JnHN9PmaWy0ZhF X-Proofpoint-ORIG-GUID: c0KyRfDKaO5QntFBC3JnHN9PmaWy0ZhF X-Authority-Analysis: v=2.4 cv=Aa6B2XXG c=1 sm=1 tr=0 ts=6a687938 cx=c_pps a=EVbN6Ke/fEF3bsl7X48z0g==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=pGLkceISAAAA:8 a=69wJf7TsAAAA:8 a=FRSEYCzRAAAA:8 a=EUspDBNiAAAA:8 a=Rg1yqSK7o-gODesPaPkA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=a_PwQJl-kcHnX1M80qC6:22 a=Fg1AiH1G6rFz08G2ETeA:22 a=H4N_Y-AU75W7NKDNhZlT:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI4MDA4MyBTYWx0ZWRfX5cAZNQCTiq/X WKVNuOuknfphNbVRYBXCN3Zg9g1TT9Feh5Ci2pSRsOWE6H7IP91ZJ8v7gP+5eM1To+pa4NsGW0h 1ErJWo/2YRWNJgJmKhAl7jfizF2X7fs+eKid56ZYDPD1cMWs/cumrSmLt2y0Lx6PtKtzQtf1RR7 3IdvP2rEbG4brHjOLGgdwcqsT2yQeb6LXbqyA2mlccrkhBp7PJAJ9z7lWT+qhc/F0KPh9KIrOqs LlhuZUKuu8vGi4G5pPZ0Q4D3dxxFKCVvD4VlcT2Ig8ED7hE3XMeSUOngalcT0a56B8BGHM4k060 0hDRlS4M4uzTKGphZYyIyMyryGW7jKhUFme2zowCpI2HxkSDCHoPPqUqnO5doEniYaRDEbQMo8f WO4QgxP34dZrQmHNVV6FuQfkmhHFLOsQMLz32Qe/Bd93gqPzwi6daZkcumU5H+z6gjiAY0Y//Nc bIBD9LLlf/6EFAYXPBQ== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-28_02,2026-07-27_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 adultscore=0 phishscore=0 malwarescore=0 clxscore=1015 lowpriorityscore=0 spamscore=0 priorityscore=1501 bulkscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607280083 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=205.220.180.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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 @qualcomm.com) X-ZM-MESSAGEID: 1785231693494158500 From: Bernhard Beschow In Linux, the ESDHC_MIX_CTRL quirk is guarded by esdhc_is_usdhc() while the eSDHC code path uses the standard SDHC interface. Extract the quirk into a new `usdhc_write()` function. Fixes file system corruption on emulated i.MX53 where Linux' esdhc_is_usdhc() returns false. The same likely happens on e500 and imx25-pdk machines. Cc: qemu-stable@nongnu.org Fixes: 75e98bc4f859 ("hw/sd/sdhci: Add TYPE_FSL_ESDHC_BE") Reviewed-by: Bin Meng Signed-off-by: Bernhard Beschow Message-ID: <20260720201133.24796-3-shentey@gmail.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/sd/sdhci.c | 73 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 44 insertions(+), 29 deletions(-) diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index c86dfa281f4..e58a6103970 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -1795,34 +1795,6 @@ esdhc_write(void *opaque, hwaddr offset, uint64_t va= l, unsigned size) sdhci_write(opaque, offset, value, size); break; =20 - case ESDHC_MIX_CTRL: - /* - * So, when SD/MMC stack in Linux tries to write to "Transfer - * Mode Register", ESDHC i.MX quirk code will translate it - * into a write to ESDHC_MIX_CTRL, so we do the opposite in - * order to get where we started - * - * Note that Auto CMD23 Enable bit is located in a wrong place - * on i.MX, but since it is not used by QEMU we do not care. - * - * We don't want to call sdhci_write(.., SDHC_TRNMOD, ...) - * here because it will result in a call to - * sdhci_send_command(s) which we don't want. - * - */ - s->trnmod =3D value & UINT16_MAX; - break; - case SDHC_TRNMOD: - /* - * Similar to above, but this time a write to "Command - * Register" will be translated into a 4-byte write to - * "Transfer Mode register" where lower 16-bit of value would - * be set to zero. So what we do is fill those bits with - * cached value from s->trnmod and let the SDHCI - * infrastructure handle the rest - */ - sdhci_write(opaque, offset, val | s->trnmod, size); - break; case SDHC_BLKSIZE: /* * ESDHCI does not implement "Host SDMA Buffer Boundary", and @@ -1891,9 +1863,52 @@ static void fsl_esdhc_le_init(Object *obj) qdev_prop_set_uint8(dev, "sd-spec-version", 2); } =20 +static void +usdhc_write(void *opaque, hwaddr offset, uint64_t val, unsigned size) +{ + SDHCIState *s =3D SYSBUS_SDHCI(opaque); + uint32_t value =3D (uint32_t)val; + + switch (offset) { + case ESDHC_MIX_CTRL: + /* + * So, when SD/MMC stack in Linux tries to write to "Transfer + * Mode Register", uSDHC i.MX quirk code will translate it + * into a write to ESDHC_MIX_CTRL, so we do the opposite in + * order to get where we started. + * + * Note that Auto CMD23 Enable bit is located in a wrong place + * on i.MX, but since it is not used by QEMU we do not care. + * + * We don't want to call sdhci_write(.., SDHC_TRNMOD, ...) + * here because it will result in a call to + * sdhci_send_command(s) which we don't want. + * + */ + s->trnmod =3D value & UINT16_MAX; + break; + + case SDHC_TRNMOD: + /* + * Similar to above, but this time a write to "Command + * Register" will be translated into a 4-byte write to + * "Transfer Mode register" where lower 16-bit of value would + * be set to zero. So what we do is fill those bits with + * cached value from s->trnmod and let the SDHCI + * infrastructure handle the rest + */ + sdhci_write(opaque, offset, val | s->trnmod, size); + break; + + default: + esdhc_write(opaque, offset, val, size); + break; + } +} + static const MemoryRegionOps usdhc_mmio_ops =3D { .read =3D esdhc_read, - .write =3D esdhc_write, + .write =3D usdhc_write, .valid =3D { .min_access_size =3D 1, .max_access_size =3D 4, --=20 2.53.0 From nobody Mon Sep 28 02:00:07 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=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1785231693; cv=none; d=zohomail.com; s=zohoarc; b=krIMFhsWp8hu2ONnEYzzC1KvvyzyxjSCqlHwGnJaJeCi8QOfQV2GMHqEOGvMC8p8fLMeGHzHOnVlKYXlgKRSjsqTne80mgSYBpXf+D1KZN7o5w1QIHD38JAgH3bKj0dX7pyGgiQfdmU0blPXPof9M6FkqzPGIp6KV7pp8hxlRjk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1785231693; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=lHLRNvm3Ny/FbIZi9oQtTg13RJJdi79mWKQDY727r04=; b=Og+kawtaUbm1DxeyBd8LFxbB7EU5QVfoI95NNNciuAMbJG8QgO+hJKjtNhoaqwXXM61on3DGkhy/+iB99kxa6HR04BEN+wKXZvypVKXRJHb1tDyq1mhOLfVbdzrUDbsVCFJXowYMClyTwvric3y8RGTvSQXI+ERzaRc/cc56WpM= 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 1785231693392534.8556441263804; Tue, 28 Jul 2026 02:41:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1woeJV-0002wh-Jt; Tue, 28 Jul 2026 05:41:30 -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 1woeJN-0002vm-Ma for qemu-devel@nongnu.org; Tue, 28 Jul 2026 05:41:21 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1woeJL-0007RK-Vs for qemu-devel@nongnu.org; Tue, 28 Jul 2026 05:41:21 -0400 Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66S82ol02309835 for ; Tue, 28 Jul 2026 09:41:19 GMT Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fphh7j2rg-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 28 Jul 2026 09:41:18 +0000 (GMT) Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-51c19493ac2so53415051cf.1 for ; Tue, 28 Jul 2026 02:41:18 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47f85c63bd3sm57111561f8f.27.2026.07.28.02.41.17 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 28 Jul 2026 02:41:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= lHLRNvm3Ny/FbIZi9oQtTg13RJJdi79mWKQDY727r04=; b=PtlwfjdhjMA7wybY 32gC4koMd0v26iLZ1nXuPvGULdXjf5yUots9garctwPuJSWmWDbV5anVUBtLDmqs EYYjjlL7FCIr61b6jcdyIBdn/Js6TZHlCHg6kqSAthanvPBCyiuwxCV7yLxGcDyY GNpmbuBGKNDB25mrMTWRmUEy2AL2CjS1xSSZgLTLyldOzXfMTvUSNq49pSSp6E2x AXiMFT5Sn3KfUjf3XA93JZvKkGT/aeNjuzMO7WgZqOz2lSu9XM1CwYN/9twgY97W DDNQKXHAZK2lj7m6jAffEqG05CPCBAYp6bEWJqmJY4vGLj5igrdleMg8cGXY2BHq dF0Kcw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1785231678; x=1785836478; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=lHLRNvm3Ny/FbIZi9oQtTg13RJJdi79mWKQDY727r04=; b=gcDdwaSfV17w6RFO/dwH3aNwW2tfFhPUM1mOx5zcdahXMVyEVs84l98G8M8pe83Loc 0954+ruEFEqZUPaXW+RHtlgHKmszEY5njSR6xdxvlCBlsG48yGIkree4NkbPekM4zoiI enkqYsz78Hfnn6cIFTEXU1SvQ2GsClZVAWWWdVD/vSEEZZvsy+kjh/qZnHmySLKnRprx GaHJekRdv6NXR+BKrcriXBKcQi4ZdsWVdEFRuh8NeNZgYQv/Nuqvrb1V52Z2pRnNukau uB7Ul5tTBomvOj5KT/xwDbMhD45AJOANyC1DDNtB72F3p9P0eXsZ9GtysvIbkrFfqDJ1 jOOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785231678; x=1785836478; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=lHLRNvm3Ny/FbIZi9oQtTg13RJJdi79mWKQDY727r04=; b=Nor3sTZYWrILMr5Ci9uVbom3CoGYqoIFnKA0TVZxNb+CdaNwOy9ks0EOTQej6tP9/i eIrQjqq9kpBrRv/uQ30LlSl/xIzeKMNJ8s17lzGhjyZO6NI3s6m4a8vjEiECs4LavI5x oVQu32dB8eKbN8kJi9B1rWLermTiU0LkFio8LHlsPJVwJ/HYbrmWZsc/4d2s54oYoyiG QmYcabo2tEdMTPc/k1CzklD0P93y6MuC2qgc/C8S0/uB0ZO9J+6y9INa4qketA+3EFsf HxgNs6BYxMS//H7iRX49i77T8OMVgCcxaVbmRRXJcdWMF0sMRpxXptXDNX1ZfFhy4DzY 0FLg== X-Gm-Message-State: AOJu0YziuFxMmJKIo15W/Z7M4Ter/1eJN7kfQs86mEh/9anAkW0Xokdc /nDh9i3CeY+DYk4JxZkex7Fzx3RyG8iUkmfnuWhni2/+7xWykodktQ3c03LslfHsxQmsN3wpPvd 36lQU6zSAnK5Gu1bgesl/hJPFQ+quAfSX7MF6/usGVZAx+Bhc7J8vTbgxAjFxwEm0rg== X-Gm-Gg: AR+sD10hvbtx7g99s1TLkt05rBQX6ey7pI+jp+vF0iG/lN08HpNhJm6Gj1XltPcJIkX Md+vLGmMmvG9tQL1zMo0M17dbx9nSvcsiJyperM9uJUevKB1O64Y/5k96XYrLHSuG9rFfHtqXAa YnzwDC/7TUu8urUc67RNWvCRl7JA5CH7i8moAj6Vx7S6ZY+mvDFkLsyo+qtjL59bENTiW1HPMtU Fsat21b8XQoVLohfUdaWrWHSUQig8VHxNNcQhfPLqtCMNGyEzn+QlFY8pEl6D+b7G56Vl4SJe18 IchqYRC9uTqjkcYnAlZ+nsX4V/zShnLDv8BkLjt/mIqU2an3v0FpDRRtAlXd2HJ27RrdOL5iSAe JQEYxsoaJyBHOLDK/gWcNxfRidErMhCKl6yh88VaV689gEXDRHiH9WRDUsQ== X-Received: by 2002:ac8:59c8:0:b0:51c:f3:34d9 with SMTP id d75a77b69052e-529d6fea3e6mr12887561cf.27.1785231678472; Tue, 28 Jul 2026 02:41:18 -0700 (PDT) X-Received: by 2002:ac8:59c8:0:b0:51c:f3:34d9 with SMTP id d75a77b69052e-529d6fea3e6mr12887291cf.27.1785231677923; Tue, 28 Jul 2026 02:41:17 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 3/6] hw/net/e1000e: recalculate rx_desc_len on migration load Date: Tue, 28 Jul 2026 11:40:52 +0200 Message-ID: <20260728094055.12684-4-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260728094055.12684-1-philmd@oss.qualcomm.com> References: <20260728094055.12684-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI4MDA4NCBTYWx0ZWRfXyxYb1WTQKP1/ w1ZTg3KP76AoG/VvrovCinI6xHmsHHU0333s7DS8bhyeXsRzXRFXeiOkojDAHfPr/cMSJbx5YzO bVrLB8MtSocyiWabPrenRbbciH4i5Di468GImj0eDlrls0pMrxxvlYgc46rVH9/1aheyaJ/JBSb CRu1TEK3r8lZxfjMCWfwQSPAP0NIf1iJTpQs0LrdX0s8LzGVftI9VGN5FfJxA/AyCvEzGiLPV3k ++hUy2pU+kfHNr+z+RhB9RLAQkM/LR81ZDQ5EQkCeSFNsi68Opef7xt8shxX6oQGOPXyjSrs0eL P0fqd+yPTs/i/U1qS5vXeEMOL0Sr+E+HUb7j4fxoKQcNZf7BDAH1oZogF19wecALHzObxsae3HS eVw6q6f0sV7IUd+Ny3Ul1/a2mFgFpPT474/DeDt8ZFCTpfrJdhzqJOOQVAoQkvG3aq+2gCw43mr xdXA3OOnOBvY/F0qHcg== X-Proofpoint-ORIG-GUID: Eq4An3NSfPFgs6ATZBLnSbP1-FbSlzKk X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI4MDA4NCBTYWx0ZWRfX6xUUQ7pIVEBV F5xZlVAihXZ7K0CNWU1ObzV3PsK59jauTefulgnA1kLaQFF5rn5+RpcMThQszb5skl8pkUux7bE JcK66RgkSmB6GarLzqpwidQruwW5GQk= X-Proofpoint-GUID: Eq4An3NSfPFgs6ATZBLnSbP1-FbSlzKk X-Authority-Analysis: v=2.4 cv=b+6CJNGx c=1 sm=1 tr=0 ts=6a68793f cx=c_pps a=JbAStetqSzwMeJznSMzCyw==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=p0WdMEafAAAA:8 a=20KFwNOVAAAA:8 a=69wJf7TsAAAA:8 a=EUspDBNiAAAA:8 a=u9DDSBZwBUtJ3TGLOyUA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=uxP6HrT_eTzRwkO_Te1X:22 a=Fg1AiH1G6rFz08G2ETeA:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-28_02,2026-07-27_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 phishscore=0 lowpriorityscore=0 suspectscore=0 adultscore=0 priorityscore=1501 impostorscore=0 malwarescore=0 bulkscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607280084 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=205.220.180.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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 @qualcomm.com) X-ZM-MESSAGEID: 1785231695508158500 From: Laurent Vivier rx_desc_len is migrated as a raw uint8_t from the stream, but it is a derived value that can be computed from the register state in core.mac[RFCTL] and core.mac[RCTL]. A crafted migration stream can set rx_desc_len to an invalid value (e.g. 64), causing a stack buffer overflow in e1000e_write_packet_to_guest() which copies rx_desc_len bytes into a 32-byte stack union. Recalculate rx_desc_len and other derived values from the register state in post_load, ignoring the untrusted values from the stream. Cc: qemu-stable@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3869 Signed-off-by: Laurent Vivier Reviewed-by: Akihiko Odaki Message-ID: <20260722112449.1386162-2-lvivier@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/net/e1000e_core.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c index 46e156a5ddc..b87a9f167a7 100644 --- a/hw/net/e1000e_core.c +++ b/hw/net/e1000e_core.c @@ -1948,6 +1948,16 @@ e1000e_calc_rxdesclen(E1000ECore *core) trace_e1000e_rx_desc_len(core->rx_desc_len); } =20 +static void +e1000e_calc_rxconf(E1000ECore *core) +{ + e1000e_parse_rxbufsize(core); + e1000e_calc_rxdesclen(core); + core->rxbuf_min_shift =3D + ((core->mac[RCTL] / E1000_RCTL_RDMTS_QUAT) & 3) + 1 + + E1000_RING_DESC_LEN_SHIFT; +} + static void e1000e_set_rx_control(E1000ECore *core, int index, uint32_t val) { @@ -1955,11 +1965,7 @@ e1000e_set_rx_control(E1000ECore *core, int index, u= int32_t val) trace_e1000e_rx_set_rctl(core->mac[RCTL]); =20 if (val & E1000_RCTL_EN) { - e1000e_parse_rxbufsize(core); - e1000e_calc_rxdesclen(core); - core->rxbuf_min_shift =3D ((val / E1000_RCTL_RDMTS_QUAT) & 3) + 1 + - E1000_RING_DESC_LEN_SHIFT; - + e1000e_calc_rxconf(core); e1000e_start_recv(core); } } @@ -3557,5 +3563,7 @@ e1000e_core_post_load(E1000ECore *core) e1000e_intrmgr_resume(core); e1000e_autoneg_resume(core); =20 + e1000e_calc_rxconf(core); + return 0; } --=20 2.53.0 From nobody Mon Sep 28 02:00:07 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=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1785231718; cv=none; d=zohomail.com; s=zohoarc; b=Puy+Uy6JOFu2zMFKtbqMAJAGeBziFG5wTVePB7tQtvYOGoa70a/jOsD3D13pItu6UosXYW+KdNocfLbThKxs5mjAgpGRoNfrpkPDvAGX1uS4h840Fq/QJLDVd5t17/axoNTojJlB4DA36jjWPW0skViENRHKWrzZQXuqE7+lRE0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1785231718; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=QAOIwRE11/Q8kQPyymOxMOhHchhX1mFWjXH0lsGyb5o=; b=htw41liF+U4M7crBxJCSmC9ZolIwsvPG4PNTX+ksjRonVku3pgSdzDfAO6r4m3v3GnsvcVVkJwl7OVMZwkIScDZr+I5JV3rPvfuE0VTFL59IyvMByHbVk8HZMA2oOkePVCXdqL8AOFp5WOf8B0gmdKLiXyxTa3nJMoEp2/3dqqQ= 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 1785231718760688.0048345471273; Tue, 28 Jul 2026 02:41:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1woeJd-0003HV-Fp; Tue, 28 Jul 2026 05:41:39 -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 1woeJX-00035R-M4 for qemu-devel@nongnu.org; Tue, 28 Jul 2026 05:41:33 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1woeJU-0007UO-TU for qemu-devel@nongnu.org; Tue, 28 Jul 2026 05:41:31 -0400 Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66S825F52071463 for ; Tue, 28 Jul 2026 09:41:26 GMT Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fpqxjgjaf-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 28 Jul 2026 09:41:26 +0000 (GMT) Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-51c1d30035dso34156691cf.2 for ; Tue, 28 Jul 2026 02:41:26 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-496c45cb67esm67603185e9.8.2026.07.28.02.41.23 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 28 Jul 2026 02:41:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= QAOIwRE11/Q8kQPyymOxMOhHchhX1mFWjXH0lsGyb5o=; b=hj6BSf2i9BLUV2gy rH1blv8Z5e3EqJto5nB9hXH/VBrhU8ScbwbXOhGeZ5NcvqIDSSjVtYhGw6WlwC/q 2N6Mz/YHqv+b1lCiPEX0blANc5d16F2mMaA+z4qUxYO19b6egMXYEejReZVgpM0W e9/RTSBtFx9FeDl7IG6kuPWb0YkVQexiIdPyNBBl3ag+U0MaIsxnmnjXEWVPdbHH MKdA1v6ZSHEBo6k/GyDhjiucikJ+/qFHPNF0+WTuJqOcVE3CUDleJd2fSpYv1iCq B74sczuXzxLT/hGPpSe2LVrDLZyDSOH0gEuG/8qnC5BEDzdMCOgka8nFlVJPOvXS gF36xQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1785231685; x=1785836485; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=QAOIwRE11/Q8kQPyymOxMOhHchhX1mFWjXH0lsGyb5o=; b=TMpZqnaOWIKF/ryY42iCI6NYGa5lMypQXgbH31Hhk41TIuGcPpAH5TTbGOjnukmzln JzIxc8B+Cwbt7ac6xQypZsLskzAj5NYY/fOApK8hX5WeMYpWbboByoJJsSJP0ERD0ga6 YTQyOTgMRR/0NqGOSLYmGe4z8hNBQ3EjT87tJrxpV0R2hbZzNNFvjo50ZJgwAp/oJIH0 4m1tdRw/YcjD9dxEEJFdxIHs/3CQt5J4pBoMv1J2l6DBVexSP08hrvTvY0e/J22SabTO 3tIhoGwVyorR5vsLOKacqA+UcXiprAE98wYbRQJV7Xs9/NKQWehOxC3mtefq/CPHZKXY /qfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785231685; x=1785836485; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=QAOIwRE11/Q8kQPyymOxMOhHchhX1mFWjXH0lsGyb5o=; b=ULiN5Fid1sNwypMnc1qJB6cWBOoMmGWZcqIPmHRI36ITSVExTbhRLCvJq9xlEC4tpW q8/Tcoau9e4kUG1sGqn+FRwmmIkIwFAOYY+AaGl/SVe6iNjziQLep8EFr5Qwd675tcGB /gHVSw0AlLf/F13olZMU7TeUV1L7iKqkcDEhCU63MXtolTMLLDOOhnuLgs8vfh3l1pgn f/pf8r29ofMrDEBs+IxnCTO11cnL0XuH2NO5N3vgop3/7XoNWSGsDrIMCwM9Hivy8gEo dhkHzkKRwmsx4x4+LZtxdWXmBpNdc5KF+cotdW2P3fwv4b5H5b3lWiS2/PrUj3/wQJZX HOfg== X-Gm-Message-State: AOJu0YxQ1phcIbDas2DbljNEIrPWALyVtioiEHpP252++ILpPHz7GlOG Q01SSOGITVZdjatzcrYST9L4T1sdN7qlaahigBdUm8Urm1E76KSIaDrpKCCrj9IIFqkmZv3D+sX yXiIRrGm497Q0GnjWfDRhQ2UbCFXA6gB7+/y2gwGPJTVaaHoIUdehM9DScBAfc2JVqg== X-Gm-Gg: AR+sD12fxvU4Om+JyEgwe0q/5HRSjgk/LHCSh7f+xORmf1jS6jyc7I8WlkxUFdDXNlo G7gZHTd2+sjB/hSuy3VypvEETwQXu98f9d7Z3o7N+rr8Sbrshe40gvCDdlyMiAhefzj30XL0hl8 lMPKCO0m+Q/HFYfJxM45StnPtQBqYfYa3B1GtCzoemOS5D4EGnAIDPiqbH7TvxDdtT5L9LdOvel hHk/VkQ9XCNJ0q1eBxQwMzpCHQjvUepXwQhTl0evOF9Hry/mLCGaSrSTPcZGRQzA4DZKbz7QPAM Fw2jp9n7502XB0N3dMNALvsEhwRCI2aQ3Vm9PoHq6ysh/GtedoIIFz16i9Lu69tLjfCr91t+j1P EgSRUK1nW+GStrbpU4VSOunA1pthWZNhwzQMgt95ZdmFWpU+wpOiZfKC+5A== X-Received: by 2002:a05:622a:118a:b0:519:efea:cf41 with SMTP id d75a77b69052e-529d6feb6fdmr12488811cf.28.1785231685251; Tue, 28 Jul 2026 02:41:25 -0700 (PDT) X-Received: by 2002:a05:622a:118a:b0:519:efea:cf41 with SMTP id d75a77b69052e-529d6feb6fdmr12488551cf.28.1785231684710; Tue, 28 Jul 2026 02:41:24 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 4/6] hw/net/igb: recalculate rx_desc_len on migration load Date: Tue, 28 Jul 2026 11:40:53 +0200 Message-ID: <20260728094055.12684-5-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260728094055.12684-1-philmd@oss.qualcomm.com> References: <20260728094055.12684-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: iMzrI7SrgNucSmkU2Ee7HEuyXf46sv3Z X-Authority-Analysis: v=2.4 cv=MORQXsZl c=1 sm=1 tr=0 ts=6a687946 cx=c_pps a=JbAStetqSzwMeJznSMzCyw==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_K5XuSEh1TEqbUxoQ0s3:22 a=20KFwNOVAAAA:8 a=69wJf7TsAAAA:8 a=EUspDBNiAAAA:8 a=s6qeQGAgE-pMEjVXHjgA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=uxP6HrT_eTzRwkO_Te1X:22 a=Fg1AiH1G6rFz08G2ETeA:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI4MDA4NCBTYWx0ZWRfX/lxguR7zNpuz zm3qkTIzJUzrCLFIYcY358IlEytpaO+hRx2cN9dQ7WdVVH7C5TVC9MQSPY5N1PWFZ3jjPOcctIk RYekYQMaqfqJGVHOezzhfrzOe0oTwe8= X-Proofpoint-ORIG-GUID: iMzrI7SrgNucSmkU2Ee7HEuyXf46sv3Z X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI4MDA4NCBTYWx0ZWRfX5mLMzUNk+Gkw m59WqCG2l0jbDkxxmBVZXFdsX/sS4w4LjHvX3q8sXTzkVrsdTdbYOX8Uy492b5DtmyWskf1AqcV nCHaiQVS+r42ygEEYRRhWBeOuyBQ5vxkPnrOxRx3PH6e2O0IkYcZH7QgAMsAbDz6wCVMPCbVnff RE53r+zq0R5cYoPOHG5SoIejtsWwJYSz7D98C8xREkJBvnFQpZs+ntQ4KnZmLr4mEZGIyXROsGk 0HH6rFivHgbpx1NeM0Ky34qtdEn0Rp/G+oYjNrmoLKlvrUYY68C89CaFrxf1wwjVPZdAzvZIXOY 0vuchPc+Co+UcxS0m+LspAbnJF60OrWfzNWZ7ZjK9Yq3Pxi2eO3GpX7Kh/zLzP3I30i8r6zeoOr SekmNgbz95i3wLopppwoSSMwfRGofmmTxBQ3GkF1lid64gCT8MghB4WPi0rbQxiLeRsdHt5/TaK 3NDyksYoIgJgFsE6gUA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-28_02,2026-07-27_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 clxscore=1015 suspectscore=0 impostorscore=0 bulkscore=0 malwarescore=0 priorityscore=1501 spamscore=0 phishscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607280084 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=205.220.168.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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 @qualcomm.com) X-ZM-MESSAGEID: 1785231719627158500 From: Laurent Vivier rx_desc_len is migrated as a raw uint8_t from the stream but is a derived value. Currently igb_rx_use_legacy_descriptor() is a stub that always returns false, so rx_desc_len is always set to sizeof(union e1000_adv_rx_desc). Recalculate it in post_load to prevent a crafted migration stream from setting an invalid value. Cc: qemu-stable@nongnu.org Signed-off-by: Laurent Vivier Reviewed-by: Akihiko Odaki Message-ID: <20260722112449.1386162-3-lvivier@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/net/igb_core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index 45d8fd795b8..2a488390735 100644 --- a/hw/net/igb_core.c +++ b/hw/net/igb_core.c @@ -4548,5 +4548,7 @@ igb_core_post_load(IGBCore *core) igb_intrmgr_resume(core); igb_autoneg_resume(core); =20 + igb_calc_rxdesclen(core); + return 0; } --=20 2.53.0 From nobody Mon Sep 28 02:00:07 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=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1785231705; cv=none; d=zohomail.com; s=zohoarc; b=gmkKbjuV8HlF6zDd2ei94dFxZTV2oDqcdg8M+czIoyuCvC4g5SfKcFbNXCmIVk7iKJQ+1YLHGqoAnGdUPtKNbT5LdslORmZZbF6m5XZ2Mp0bhaTNGbfdjA+4QxXRBr9WaGwQWa/9+xjNxzkjd8d+F3CtGzWT8v7CqycQe7QHBGc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1785231705; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=mQewgAGZlTwk4l+P/U0hx29q84iSX1jPkJ8+AJstAT8=; b=N3TmyKiTWB5Oksw9kLBuoPkpd1Flx+rdvNNxZAa0FFyI5wkdqQNJC8UEXmw78GeD4BJM5/pXnOHU/0MjRf392vFEI/KcaKWRH1t2fBW+supk4VlPohUZA3ssUgIyY0PhH6Z3S1jdrIjSUKkGXgXPlt6xCrP7U1vx8CRoqpEK56o= 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 1785231705674462.73397470119176; Tue, 28 Jul 2026 02:41:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1woeJj-0003Si-M8; Tue, 28 Jul 2026 05:41:43 -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 1woeJb-0003E9-Je for qemu-devel@nongnu.org; Tue, 28 Jul 2026 05:41:35 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1woeJZ-0007VG-SS for qemu-devel@nongnu.org; Tue, 28 Jul 2026 05:41:35 -0400 Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66S82l3v2275985 for ; Tue, 28 Jul 2026 09:41:33 GMT Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fpbrsuha9-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 28 Jul 2026 09:41:32 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-9309af14fd7so391616885a.1 for ; Tue, 28 Jul 2026 02:41:32 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47f85b9a5c4sm56754889f8f.8.2026.07.28.02.41.30 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 28 Jul 2026 02:41:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= mQewgAGZlTwk4l+P/U0hx29q84iSX1jPkJ8+AJstAT8=; b=Yn8jHna+BR4X1/MQ +9ZhAQ393fwzWNslNNtJDMigmSTk3WNMY/ZzeDLt7e/xIRh6nFqUhi82kj2Xa4Ui Ut60W8y+REXQaFBz9Z96FnnRdZf2xFdYSytFl0St4SifQGuIXbgvNbcJgllAivlr lHcDJPfPRUdY11jVW8jYPxRybYEh00PlQTywcP9UvHO0nv5ez33CqIRtSNaKAHzs Zj/Ak45IYrO1QEctjxCOL4hSnxGpuNOUGEPy8aRwdOgPTb7VnSQHsa7/3rysUil2 wqmUyqTX/yoFHcE22EHkMJmaqZjozS6B8NxswgiGmi4K+f0QTxWY6YP/iYB51McC aiM+pA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1785231692; x=1785836492; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=mQewgAGZlTwk4l+P/U0hx29q84iSX1jPkJ8+AJstAT8=; b=hKhR9kmhpcctWJ3PU7ytRRAlMrxmCad2LIMbVSrhk/bd2Fvc5xwo5t247ZvjpsLIBf BB8gwqiZYfQg/sBRi7COPvBvc2YNb6QJeLPdsNkTSj5PjDh3jlboPETq3KccXBjJQYqs mhZzFii1guaeiEQVhMQaCX2DnRm5p2jVs+zE0QowJM6FT4+lES7kjPMsJzIs/bwOcJ4I 5KBnodmVxeN8Ri7aM8V3SnV4EeHdpYdIOTBnUZqzvsJtMMYxqb5LNwrMEldM3+zss5xO iJ2oQIFCXYQP/yPcOL7J0VXJocuhPxY/YuEqj/vCQmrkASfOXaujaLHUTUnf646ULxua C4iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785231692; x=1785836492; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=mQewgAGZlTwk4l+P/U0hx29q84iSX1jPkJ8+AJstAT8=; b=jmNkPkrx6bU/KfRb6tyZYGX/hbWN9fKuwX0obBd7M8cta7Mi/CADt9KFCMTHMqw+Ys vv2ka4gz0kQ3+B15WhmIPZOOYgyM5kj9iLJ50eDkG37BUGlbtZmKdlgBlEpJqbCmWe1/ JHv91FL+SEmtgSzlhhkrN8jPNTqKkln2CYE00ztXUXcs65a9MJPlKy3GbQb+DeEy9K2Z 7hEm3PTOeuLOs98Jl+etF2nmZlUU/lGQZBGv8SfzxrXLF4G/iu6issfNk3rhqiycBZmX AGY2TX38sKltEQFrPK+y8tSDzRIn5ygd79pR3P/5JUFK07kkic0oLyYV0Q/YM3PeazRH HWog== X-Gm-Message-State: AOJu0Yy74lYl8qzotRPV/ikfpaC77UJ08OfajRpdfcUnldH+akmOJd3Q 7FRyU5c/6BcmtztyCEP33H4kc1ctJy0H6bscDDibeBWtzyXwLrGSjzcSLnvI3KS7i8AijDpuViG OHs/rjACO2B2MBuKMkaHrM3h/UO1S/A9s23Ch6PNAtZMyxrz4Nm4ytcpTfqHvg64cvg== X-Gm-Gg: AR+sD12RhfVK5bfQmnrCwkbS+UZFVYrgigNg1LNIY8h8Beb8x2oeHRZG46MMQ2wwSzy guRzXLvA5thvFgFw9mTreQLev6Y3viHzte1ekHmcPLYW/TSFQBKvwr8Uc8QOPNl9VpBZzsk8xo8 Ns7LHfnPFh6ZjMQv92QMIaifFhFGSJ6pkMnfvTp2GlEs/b8RfNahvNArQ/6GfXs0ULOxw3uPiw5 0pmeCfalh0eY0C1XLHJgnEm4QiYmQUHRT5Bo/ekP8rZoS3Ew21hpw/pm7UAhsuEVk3vdd5La7zh 6IS0pWEZhiumZ8Jl2I2Vp+Te/yCkuOUU28UKtCI4Xhl0jYdHo4E80A5bjfRycvyVec3XE19WplV 20vB/PLlJNmOH5NJD/uVlrpzvZJB3PPODnZMlWZwpfZkAIaJppfNpgnoOhA== X-Received: by 2002:a05:622a:1baa:b0:528:3ae6:14d7 with SMTP id d75a77b69052e-529d7161ef6mr11730011cf.59.1785231692087; Tue, 28 Jul 2026 02:41:32 -0700 (PDT) X-Received: by 2002:a05:622a:1baa:b0:528:3ae6:14d7 with SMTP id d75a77b69052e-529d7161ef6mr11729701cf.59.1785231691436; Tue, 28 Jul 2026 02:41:31 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 5/6] target/sparc: set reg window data structures currently after vmstate load Date: Tue, 28 Jul 2026 11:40:54 +0200 Message-ID: <20260728094055.12684-6-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260728094055.12684-1-philmd@oss.qualcomm.com> References: <20260728094055.12684-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI4MDA4NCBTYWx0ZWRfX53pzND2DRwt+ GtbwCqd/dBybkWXXa6cR5SuEU/tqhn1Pjx75dbDvedZQ3DAabu6d4+nXBViZY5bEXulXXQGrDmy GdfLJV1z+TC3x4jhejfbXgEzuVM3XzrdLCRBH8L1kfyQtHYXSiQU+bVN+YseSta3HtjbzK3A4/b zgRThO78XCoO8nsL0s0criSuXh5+VSDWiwPSkZcX/KpZ3SrxlcrsyOsjCtg/0KpTH5/UsN8bJVd 1y07c+xXHtKZv/gJmpDuSsLswF/aoSlU/mNKOmL0nYOazYqFebl97TNlPcH18icZnrOSFauk5CE uQJvzGlglGJzWfNT/vzdFjvn/ulFruNc9JdfiYur6p3VoRavlu+YcNVUE6sqRJ24QboE8l7vPHP FVjQUxvj4VmnGMfeGnemWHis9hyGQRhxrH0S6jfL/Ft5E+qwQUwphTYNe+fJX3NoyXfo4fPUzsV C07PecnU2No0FUtwwMQ== X-Proofpoint-ORIG-GUID: dFZMN16QwN6hzss9BJ_DUGWWwKN4Ls8x X-Proofpoint-GUID: dFZMN16QwN6hzss9BJ_DUGWWwKN4Ls8x X-Authority-Analysis: v=2.4 cv=ALkdLnG8 c=1 sm=1 tr=0 ts=6a68794c cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=pcZqCyVeAAAA:8 a=69wJf7TsAAAA:8 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=x5RrepDsKcNiVzbUWgcA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=NFOGd7dJGGMPyQGDc5-O:22 a=SGy6VSG0Ue1xmPAwIFl9:22 a=Fg1AiH1G6rFz08G2ETeA:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI4MDA4NCBTYWx0ZWRfX/7k9lKwmjhMu E7e95O3fc9KV2/E7DdBcn354tfADi9f/FrKZi7D8CJ2qpwKz5N4EZaTXjL6BMZNeQd2LlHY+4JD KzfIazUk+OUa/jOnyAPFUwiE6CdQYak= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-28_02,2026-07-27_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 impostorscore=0 phishscore=0 bulkscore=0 clxscore=1015 priorityscore=1501 adultscore=0 suspectscore=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-2607280084 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=205.220.180.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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 @qualcomm.com) X-ZM-MESSAGEID: 1785231707565158500 From: Mark Cave-Ayland In the SPARC CPU state, env->regwptr points into the env->regbase array at wherever the architectural CWP (current window pointer) says we are in the register windows. We don't migrate this directly, since it's a host pointer, so we must ensure it is set up again after migration load. We also have to deal with a special case when CWP is (nwindows - 1). In this case, while running we keep the "in" register data for this window in a temporary location at the end of the regbase[] array, so that generated code doesn't have to special case this "wrap around" case. In cpu_pre_save() we call cpu_set_cwp() to force a copy of the wrapped data from its temporary location into the architectural location in window 0's "out" registers. We then migrate only (nwindows * 16) entries in the regbase[] array. So on the destination we need to copy the "in" register data back to its temporary location again. For 32-bit SPARC we get this right, because the CWP is in the PSR. The get_psr() function does: env->cwp =3D 0; cpu_put_psr_raw(env, val); which causes cpu_put_psr_raw() to call cpu_set_cwp() in a way that sets up both regwptr and the wrapped-register data. However, for 64-bit SPARC the CWP is not in the PSR, and cpu_put_psr_raw() will not call cpu_set_cwp(). This leaves the guest register state in a corrupted state, and the guest will likely crash on the destination if it didn't happen to be executing with CWP =3D=3D 0. Fix this by adding a custom vmstate_cwp VMStateInfo with corresponding get_cwp() and put_cwp() helpers which does the same for the 64-bit case. Cc: qemu-stable@nongnu.org Signed-off-by: Mark Cave-Ayland Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20260725123411.993099-1-mark.cave-ayland@ilande.co.uk> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/sparc/machine.c | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/target/sparc/machine.c b/target/sparc/machine.c index 5f402e098cf..0d5d79b5e7b 100644 --- a/target/sparc/machine.c +++ b/target/sparc/machine.c @@ -151,6 +151,37 @@ static const VMStateInfo vmstate_xcc =3D { .get =3D get_xcc, .put =3D put_xcc, }; + +static int get_cwp(QEMUFile *f, void *opaque, size_t size, + const VMStateField *field) +{ + SPARCCPU *cpu =3D opaque; + CPUSPARCState *env =3D &cpu->env; + uint32_t val =3D qemu_get_be32(f); + + /* needed to ensure that the wrapping registers are correctly updated = */ + env->cwp =3D 0; + cpu_set_cwp(env, val); + + return 0; +} + +static int put_cwp(QEMUFile *f, void *opaque, size_t size, + const VMStateField *field, JSONWriter *vmdesc) +{ + SPARCCPU *cpu =3D opaque; + CPUSPARCState *env =3D &cpu->env; + uint32_t val =3D env->cwp; + + qemu_put_be32(f, val); + return 0; +} + +static const VMStateInfo vmstate_cwp =3D { + .name =3D "uint32", + .get =3D get_cwp, + .put =3D put_cwp, +}; #else static bool fq_needed(void *opaque) { @@ -286,7 +317,14 @@ const VMStateDescription vmstate_sparc_cpu =3D { VMSTATE_CPU_TIMER(env.hstick, SPARCCPU), /* On SPARC32 env.psrpil and env.cwp are migrated as part of the P= SR */ VMSTATE_UINT32(env.psrpil, SPARCCPU), - VMSTATE_UINT32(env.cwp, SPARCCPU), + { + .name =3D "env.cwp", + .version_id =3D 0, + .size =3D sizeof(uint32_t), + .info =3D &vmstate_cwp, + .flags =3D VMS_SINGLE, + .offset =3D 0, + }, #endif VMSTATE_END_OF_LIST() }, --=20 2.53.0 From nobody Mon Sep 28 02:00:07 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=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1785231711; cv=none; d=zohomail.com; s=zohoarc; b=ltLtsppydwVDKJxY1SuCGoczqsLfO4qP6cCFzd6BnXeRO+ABdKqoAwhm059BU78AXb4Cy46/hu17chgkOlShTJUMkbYJYIKOMXPs88O5yeacgrJRkAfHPb10itNSLe7VmBTel/U/1bfaIVZ03mLRcGVjsWPGYxuKgFK/K4tggfQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1785231711; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=Il9BSu/Ho7J8AcXZWEYJWnCZeHZP+9NrkyIWkDEsvKM=; b=GkyJEIgo7Jz36NbDNTQRB1HoIkkAV4ZKv8lM7TkrYWyL/jxbSNZwFjQ4KrCGwTkXAo2dTRcaGRVPs8c4hTm+77oX/ZJRFVziGsfcl1a2bubQ6Z3VOO54Az7yNeaZvOcWMu2+fzIDQoz8jmJVToCS8jZaGSYPqhzZRuLxp+5GUgA= 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 178523171118856.21296769466721; Tue, 28 Jul 2026 02:41:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1woeJl-0003fr-Im; Tue, 28 Jul 2026 05:41:45 -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 1woeJj-0003Rh-Fb for qemu-devel@nongnu.org; Tue, 28 Jul 2026 05:41:43 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1woeJh-0007WF-Nx for qemu-devel@nongnu.org; Tue, 28 Jul 2026 05:41:43 -0400 Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66S82F2h2480199 for ; Tue, 28 Jul 2026 09:41:40 GMT Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fpmy119fe-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 28 Jul 2026 09:41:40 +0000 (GMT) Received: by mail-qt1-f199.google.com with SMTP id d75a77b69052e-51c12e43b98so45014861cf.1 for ; Tue, 28 Jul 2026 02:41:40 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-496c45c297dsm58857805e9.7.2026.07.28.02.41.37 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 28 Jul 2026 02:41:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= Il9BSu/Ho7J8AcXZWEYJWnCZeHZP+9NrkyIWkDEsvKM=; b=cqmk+B0uKDgbXTg1 Xa0QdiiUMUqEYwZqHW8z+0OGrmoaLx/hMyCeOVYArw+ZAzEb5Vgs5hgBzrZETPzJ Zu+nfm92bxrtj+Js5DuVfIzphzv/FTggZ8n7nheYapCKvmV0dEVjr/i5Jx+EFqsu vgkqV04aG6ac4ueatClDMPy2G/xQys8bpOfN93yNsxHSY09mgXKLNG6sA+wVODhl edD0dTV+/YFxKvhA39cCsnS0m5UISIscJ7jcxbeXQKqDvFgsI1dgnR5bzHa74gI5 EpUD6RpWJQLM8NOgNfTPG6bPUYiR+kEFzfk09gjv8u2zDSnV4dydVY+M7HLhvJoi DFICww== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1785231699; x=1785836499; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Il9BSu/Ho7J8AcXZWEYJWnCZeHZP+9NrkyIWkDEsvKM=; b=W9qXIjkDFp0bo7z9b3EcpwTDb1kf9MTAJx16rQP/B6faYs+cVPxJ/MkOgzZBK8ycS7 KvAlsbABwGjk3hNGeh7t7ciHklUlqKO+OHvqKJDj1bnME5VvGPDH1GtSJYsoJdjz7cy7 pSKCOchzyYIiaOvTfJxxjlS5HRzC6b7hYWNx/3lNAOQiUHro8WAzqCcbaHrYYevunVde 47wA3fquhag1aSt02Xj4yI8xOH8TAq/bavQ54GhLSqXH63oPPklR69QH85C4cD2WHNFq J+U4K1OmHMFQyj5scWlxZU6wgG1XJpXMYqAyc/0WySqCji+EZ5LSCgXM6MFVOcCBOkh4 iP0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785231699; x=1785836499; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Il9BSu/Ho7J8AcXZWEYJWnCZeHZP+9NrkyIWkDEsvKM=; b=pwkMsnPQFdhncPGXN0indlx25KerU8XTWEpbrHlJg8i3NuGUrwHHzUWAAi6WdZNjkx 09hJAb09m3445ya1yDrOiRbEzDZ3vw/9S5UjpEBizn3jJkA52MkHwk42HXC3IM//HsMW HrIdcRCrBNuzXGq40up74T35Zjwh1HqccJ5UMMGmP49CH84ZWc2dHUjUe1K4MfRsrbJa RcAES0rsDt8Ci3yxEkimGxQF5SIHPNPP/QQh9AJt5l/Q2Jg5MRb5DnUS9r/8a5OfZreq N8CGcgSDmHVjK9KrnmcIFKxkzjD6JgJuN9hZl+Wyw3I5A3T8MZJW1DZfxKepVDooBJAu 8kog== X-Gm-Message-State: AOJu0Yz0YxhuMDKvZuvIG7h8Fw9SRa9ZgTVbAcnLDjHjUNe5yPN8NsQc wONKtWOivasF5SdtpIi1Et87UzgBEGKaGML3n6d1OYObivcsqT6FpFS8iXyZYhlJ/fddHHIzsll VrHJqnjiFI9QKA6e4Y1rqGNU0QgWs8rTZdunaA105I56L1GqebHevrFVSOly62x6hFg== X-Gm-Gg: AR+sD13nLZqL9PPteQ0w57MuOkp2JB5MZviNExEhuAxiV2mVUxv+0VmV1RWaV8IfPjy VBgsH6LLhGT7aBQ1ZeBo2+gpDYLucs2NSbDx2JZDv1Mt0OB2PBAdgOW0l++ERh7+MzE54p/ZxW3 jFLwa7hvLDitjKALqp7TuVRR8yI8urlmmLFRi+u0/GorkGVaT6BLu4HI48itWTJo1gtmJ00qyiq Xv0eKfO2Xilkjv7hipkAGb8Hj1VAZpxGxaVrJQLJ39OSKvGSofbqq5DkzRTWHw+80MNQ+P6T7a3 t5WLJSoBuly6WclYhIl7AXNhrQnwNTGkRocKVYGpaC4nqb/A5P7B1W+HKzle/8tcoQ7xtlf2Mjk 7uYQNJhkgXgGN76API+QE3omBOQD2od0H5GFt5FqGrIFuLIBpsoP9wq3B+A== X-Received: by 2002:a05:622a:1804:b0:51c:21d1:3852 with SMTP id d75a77b69052e-529d6fafaa1mr12404931cf.5.1785231699143; Tue, 28 Jul 2026 02:41:39 -0700 (PDT) X-Received: by 2002:a05:622a:1804:b0:51c:21d1:3852 with SMTP id d75a77b69052e-529d6fafaa1mr12404671cf.5.1785231698615; Tue, 28 Jul 2026 02:41:38 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 6/6] tests/functional/ppc: skip remote interrupts test if -net user not built Date: Tue, 28 Jul 2026 11:40:55 +0200 Message-ID: <20260728094055.12684-7-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260728094055.12684-1-philmd@oss.qualcomm.com> References: <20260728094055.12684-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: bZwOSpamQhjre7nM-ddQ9_Cenw1LfnK5 X-Proofpoint-ORIG-GUID: bZwOSpamQhjre7nM-ddQ9_Cenw1LfnK5 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI4MDA4NCBTYWx0ZWRfX3zab5Hr90yCE d717g7qu+UWAj/hcaLx/+p+0Nqc6DmcO6Ztswd3YvQhbA62kupsiL0EvuWfEBkxzZK2hKBEDsE1 rYKu9P3DEfCo7sHY4XeuTAY0QhxFWAlSPrvwbtd0p/L0C4OWgOpPD2PZ/RT19wh4mfDJTvCiiEo 0fwD3U3BPVWhu1frkpw12p7m9R4ukLwsV9UEFu+Cs6vKiKv4P3IyG9GbU1lMUtJLvVOUqMxeZhU iTxjpfwFU05ibZQLrESk2p8wGMubBcKfGC2yOn6XqqJ65K9HPW7R51W7y6zKOzVMpPljrRPY44d 3TEl6+ha9qPVt+NE09N8SJd3EeT0lTipwmZYu0e+n0pnCpdeBoYqM4qwt8FN6J2YYEd1/Igm+PQ b+MJMEZumEM7OgfeJkQhkSI9NVMDmEDWcMJFIPPBTQfNwQ4qQf5TT+1adV+z8kdWxot/u9ghro4 XGt6+5pfZydr+7lW1cA== X-Authority-Analysis: v=2.4 cv=PJo/P/qC c=1 sm=1 tr=0 ts=6a687954 cx=c_pps a=WeENfcodrlLV9YRTxbY/uA==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=VnNF1IyMAAAA:8 a=20KFwNOVAAAA:8 a=EUspDBNiAAAA:8 a=_mrNEnGEA0-oycTHUFkA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=kacYvNCVWA4VmyqE58fU:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI4MDA4NCBTYWx0ZWRfXz3XPCMeaGUKf ZRoEGJjvUOzZyhp0bZQdGroz0EFAZmfbLTDXGXG61DdEXNcTCwSazcnXAHr9/ZQMY3/Yi9857Ba h0zr69PJ4jHx+voxqrz6f2WvEMFym84= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-28_02,2026-07-27_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 priorityscore=1501 malwarescore=0 adultscore=0 suspectscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607280084 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=205.220.168.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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 @qualcomm.com) X-ZM-MESSAGEID: 1785231713589158500 From: Shivang Upadhyay While running remote interrupts test, without libslirp-devel installed, facing the following panic logs. File ... raise VMLaunchFailure( ...<3 lines>... ) from exc ... Output: qemu-system-ppc64: -netdev user,id=3Dnet0: network backend 'user' is not compiled into this binary Adding netdev user requirement for this test. Suggested-by: Amit Machhiwal Reviewed-by: Amit Machhiwal Suggested-by: Thomas Huth Reviewed-by: Thomas Huth Fixes: 63f5ba80921 ("tests/functional: Add remote interrupts test for Power= NV") Signed-off-by: Shivang Upadhyay Tested-by: Amit Machhiwal Message-ID: <20260728074612.42397-1-shivangu@linux.ibm.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- tests/functional/ppc64/test_powernv.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/functional/ppc64/test_powernv.py b/tests/functional/ppc6= 4/test_powernv.py index bac2017e18d..f3e05e4d381 100755 --- a/tests/functional/ppc64/test_powernv.py +++ b/tests/functional/ppc64/test_powernv.py @@ -90,6 +90,7 @@ def test_linux_smt_boot(self): =20 def test_linux_remote_interrupts(self): self.require_accelerator("tcg") + self.require_netdev('user') self.set_machine('powernv') =20 # Have below setup in this test: --=20 2.53.0