From nobody Sat Jul 25 09:48:57 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=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1784623937; cv=none; d=zohomail.com; s=zohoarc; b=Cz5sX1FgzRbDJ+pdKRpW2QCLNn5K9mWY06q2BhpwXAHsEZqApHa7v0gumwfWvbo38+bjUtgsLS0d35Cp2j0oLPZLQrHtRjlsEOro+lKHdlv/pUEtYj0rL8tj9CCEILwc/14QTXu7Jwf7lQVJXsNAqyfeDK8dzaleUoT01LqyUbM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784623937; h=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=lOmDoEzGw0hhmhIBGIg2uJ1q+mJAOqF1fExTH4P3WKk=; b=V37RaSMnfpVr8qXcy7nRDmpVqed27CNquqS7k4pJlLd8eyCWADr34ZA4FTzEEvs3eDBDieZ+obmrXXYQJKGRMwBmeyetc/jnh8rq8NwAjKskMyWSzAAihLTrvXX3sUyUs5vwwIeYWpNyD9uJWfDWM/3efN41IxxyjkqEaIOBOZI= 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=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1784623937721291.8643337388138; Tue, 21 Jul 2026 01:52:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wm6Bm-0005MR-Gy; Tue, 21 Jul 2026 04:50:58 -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 1wm6Bl-0005Lp-5y for qemu-devel@nongnu.org; Tue, 21 Jul 2026 04:50:57 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wm6Bj-0005fm-Eo for qemu-devel@nongnu.org; Tue, 21 Jul 2026 04:50:56 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-4954f5e8020so14239945e9.2 for ; Tue, 21 Jul 2026 01:50:55 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4956537c7desm68707245e9.7.2026.07.21.01.50.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 01:50:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1784623854; x=1785228654; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=lOmDoEzGw0hhmhIBGIg2uJ1q+mJAOqF1fExTH4P3WKk=; b=bt6Lr6tgh66gymucRGlBTKDDKCDDeLq3iQ2YDszWvHDtdi6TjDvv53j7oySINoHsli F/L7HdMn2wFT2c0SQd7t3N/q07YL8U4QvY1l1jDOqW6My4uTpRiuJDFJhpcAXz7VVaRe 6YMi16KAXwCx/IWoMAiazob+GNtSSrKzP8vwZI2lAEax31MVQNmcX5bbljdgEmJX+qOT cP8qbfsiE6fvMaZt+/6NjAry8WqWWyMf1HEP5Z8DmJHPUiFq1e09+90gVcTq0pCqbKM0 F65wPV98/HA5yl3flc1f9Bj8hGtD0NzGoKTN5xQZwvlv57pF15kWr7z8nfkISLl0RIOB fqPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784623854; x=1785228654; h=content-transfer-encoding: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=lOmDoEzGw0hhmhIBGIg2uJ1q+mJAOqF1fExTH4P3WKk=; b=sBQAWAkDH6+gwgrNIF3+MV194J3iYN/pdeBxJmXevF6hd3dGxW3hbAJhoRchjYkYRR Oi4J+kQgbBN+HCOop64Nd0poeKSgtgrl+arfuYv2MOWLkruxbj3BTRT6M3HaeiNsl5Ds p29qGFHFqL/1E30Altk/jytoMZnceqEGP1ul+xKhfH819HEPIlo/d+7F0TdTrUTuU7VL fSUCXck0Nredm8b7EiWpy1gTQ+FJdfZjihTooFm3JPmmOB88J/QnMi0QeLTFgsEoSU7b k0b3hfmi450CtjbBuYs2UPDXDUo2GEyKeKXCS7bOlta/jsTxLVUeG3rPtrFufMBbp/DV ssKw== X-Gm-Message-State: AOJu0YxLKW+T6RjF0uKSaMBCFg6THZl3W/SrG2rcyuE3g1JfNmGr6yeg eQamxsHbVjUyxz9Lu3i5lCU8U4xajvIMZvJkOtGPnh07BtJMgnivAV5PUeNj8T/RuKeTCRb3YiQ yLuOhRQe5Ug== X-Gm-Gg: AfdE7cmsCH5//Psw6LHu8DM/mYiXmsSCCZs5ZbA/i/UCnaaiJTMTGXVf4ZmPX4IqOM0 K4NNrmWnHSDMY4dT2bvJ617P4wC5rosbumTMBPBdA11u+aWPLU2ii9j6nVLDm/PuIcc6TPMqRKZ aW2kSiVNqCm6O3maohz8DG58W0WpdWFmmS8Kvf0mg9ki2hzk6EfTHbMJQwBum61zDhVDqJvWrO5 ZedGAIy03hjrEnHxvGQnN6MXahaxjTJ6FBrEYCYJRHQ4plhFbcwbQhCyk5zur4hmb4E3YVN3r/C fSileomItXqC05ofMZVuHExGQoB6LGSokVaEdYnFi8aTQ/ITY3bJOKKJ92oZU04QTnUthAzSKXI vTtcWFoXbuGOuc4fNXFlJd3JzCrhVZ6USrRInHLIDRInACupyAnQ/ufMV9CF8AM+8sRK+pJ4f7W yvHXXwrVsGMgbQEb+12Mxp1LSUSnONrBUYKHKd73W4JtG7PpavUUcRMhvOT4Dto1amL46XR/zc5 odWUN6PBKIdMxf2a6YDxA== X-Received: by 2002:a05:600c:c097:b0:495:5a91:8027 with SMTP id 5b1f17b1804b1-4955a9182a8mr105997385e9.5.1784623853947; Tue, 21 Jul 2026 01:50:53 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 01/16] hw/char: imx_serial: add missing migration state Date: Tue, 21 Jul 2026 09:50:35 +0100 Message-ID: <20260721085050.421257-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260721085050.421257-1-peter.maydell@linaro.org> References: <20260721085050.421257-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::330; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x330.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, 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 @linaro.org) X-ZM-MESSAGEID: 1784623939996158500 Content-Type: text/plain; charset="utf-8" From: Tao Ding The imx_serial vmstate is missing the ucr2 field. This register includes important state like the transmit enable and receive enable bits, so it's likely that after a migration the UART will be in a completely broken state. This bug has been present ever since the UART code was first added to QEMU. Add ucr2 from imx_serial to vmstate, and increment the version_id. This is a migration compatibility break, but this UART is only used in the various imx-based boards, where we are OK with compat breaks. Migrating on sabrelite can reproduce this issue: 1. Prepare the U-Boot required for sabrelite. (according to sabrelite.rst) 2. Compile qemu $ mkdir build && cd build && ../configure --target-list=3D"arm-softmmu"= && make -j4 3. Start sabrelite and prepare for migration $ ./build/qemu-system-arm -M sabrelite \ -smp 1 -m 1G -display none -serial null -serial mon:stdio \ -kernel ~/u-boot 4. Enter qemu monitor after uboot. (ctrl + a + c) (qemu) stop (qemu) xp /4wx 0x021e8084 021e8084: 0x00004027 0x00000784 0x00008000 0x00000a01 (qemu) migrate -d file:vmstate (qemu) q Load the migrated vmstate, before repairing: $ ./build/qemu-system-arm -M sabrelite \ -smp 1 -m 1G -display none -serial null -serial mon:stdio \ -kernel ~/u-boot -incoming file:vmstate (ctrl + a + c) QEMU 11.0.50 monitor - type 'help' for more information (qemu) xp /4wx 0x021e8084 021e8084: 0x00000004 0x00000784 0x00008000 0x00000a01 (qemu) q It can be found that the data for address 0x021e8084 (register of usr2 in i= mx_serial of sabrelite) is not the data before the migration. After being repaired: $ ./build/qemu-system-arm -M sabrelite \ -smp 1 -m 1G -display none -serial null -serial mon:stdio \ -kernel ~/u-boot -incoming file:vmstate (ctrl + a + c) QEMU 11.0.50 monitor - type 'help' for more information (qemu) xp /4wx 0x021e8084 021e8084: 0x00004027 0x00000784 0x00008000 0x00000a01 Cc: qemu-stable@nongnu.org Fixes: 40b6f91151 ("i.MX: UART support") Signed-off-by: Tao Ding Message-id: 20260715131819.14827-2-dingtao0430@163.com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- hw/char/imx_serial.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/char/imx_serial.c b/hw/char/imx_serial.c index 080b7f6331c..fb41ee2ac50 100644 --- a/hw/char/imx_serial.c +++ b/hw/char/imx_serial.c @@ -43,14 +43,15 @@ =20 static const VMStateDescription vmstate_imx_serial =3D { .name =3D TYPE_IMX_SERIAL, - .version_id =3D 3, - .minimum_version_id =3D 3, + .version_id =3D 4, + .minimum_version_id =3D 4, .fields =3D (const VMStateField[]) { VMSTATE_FIFO32(rx_fifo, IMXSerialState), VMSTATE_TIMER(ageing_timer, IMXSerialState), VMSTATE_UINT32(usr1, IMXSerialState), VMSTATE_UINT32(usr2, IMXSerialState), VMSTATE_UINT32(ucr1, IMXSerialState), + VMSTATE_UINT32(ucr2, IMXSerialState), VMSTATE_UINT32(uts1, IMXSerialState), VMSTATE_UINT32(onems, IMXSerialState), VMSTATE_UINT32(ufcr, IMXSerialState), --=20 2.43.0 From nobody Sat Jul 25 09:48:57 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=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1784623966; cv=none; d=zohomail.com; s=zohoarc; b=If9P8DVRh+/OOrEj9HSRxClA3gCdeSjx9e2VeuQJaH4aowxP7LelufkRx+WFO0s2ME6hI2jxW0NwVd4SF8hjP1ei6IEdlwh1Q/pgD8/uNm8DNQYJCdABUURFrk6MUxChYd9l/GY3WzKFVmlj9wODFw3szsH0C1zvnCd5VpE6ZmM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784623966; h=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=pcVlEqr/bB3gW9K7U5eUl2N8mxO8truIrpOolaMbkfE=; b=iCSD8t5dcnBRJfz2RC5m7CS2f8iumAnFJGrhWci2CM/5SBvmrvIICtxP3Ky90jRLhzdftb8qHtbIl5HqfOsxZaSuo5npK85DKs2MeXnijQdpBlhDM/Hbg1NUKwwTbRxDwprnEKuCdhDv+eDFjf1No74t6tJUERr8UY/i2nKMvqI= 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=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1784623966246680.4423335877075; Tue, 21 Jul 2026 01:52:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wm6Bn-0005NE-To; Tue, 21 Jul 2026 04:50:59 -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 1wm6Bm-0005MO-BZ for qemu-devel@nongnu.org; Tue, 21 Jul 2026 04:50:58 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wm6Bk-0005ft-Tn for qemu-devel@nongnu.org; Tue, 21 Jul 2026 04:50:58 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-4954c0833b4so23988415e9.1 for ; Tue, 21 Jul 2026 01:50:56 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4956537c7desm68707245e9.7.2026.07.21.01.50.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 01:50:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1784623855; x=1785228655; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=pcVlEqr/bB3gW9K7U5eUl2N8mxO8truIrpOolaMbkfE=; b=e5uihLcUi+yiLJerGqyjXau+N1GnSvd78r9XoGqPrZfVwAxlpL8+j2MzBJ+Cz81gAF H6NTX1+7ELvboHXzBDyjufi4swuE2hmlYx1jjbiDVXr19BFqbrnNIEQ4JOmF7pBIXAXy eYQ46XdvUSSFxG66usJQlKavZL/GftFAppBuJN16ZbgFOiC757YO/5IXjjTsX6QRFrUE Dap3fh3W1cAsBfuykaW0WNfpzCr50vswaFGnP1BTFk3y92v9ZJwC3y38AuMWOdQM6vNZ eATmvsz9/B7djyFByyVuOIcn8sY26PWXyrR/YTzYF9sRVAGn/Z+TxKA1lOyOhHTRWtvl 4eEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784623855; x=1785228655; h=content-transfer-encoding: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=pcVlEqr/bB3gW9K7U5eUl2N8mxO8truIrpOolaMbkfE=; b=Yff1oq0/VXdPCzS0Ig9qVLbEWzXLTo0OIsG+QhGf81hktFdsasM4OZ47M0raoW4DA1 e4E2sxnqXgg1Kik1HkKIhoqztx/WGXANIxjEglzIrMPiL9uTzT0Hy2NchzpdW+K4g/YU NGAfpjFo6EhKDxg4Mc9RXkJ+MZ89YKeuJxbW5DiarnZENqyUuCceQlCPpWJk3gynReo4 EKG5twjy3T5ust4WRAbXLzW6psQql6xk6y1rWjDz03cUaDcG2c0ImKqxRhsg6OikJC3y +r+D1YuG38JkL4i8Z7m38zQny3xr5oywoeZzI0/INrX5mmB4OcdsMxZ1379iixLPygwp pXNQ== X-Gm-Message-State: AOJu0Yx1zvXa7SjzeS/+ZS/C51JwcmGEIF7NP6ab0XQynKpDxgQorPgo hMvmfFaAk6MYjOfmPlin2zfpF4LM1mD/2OVbsyeZh95vWbRVqpvuD7QEEv7icrmz6aobOAvPk5A Aq7JGLa/NMA== X-Gm-Gg: AfdE7clHSz6UW5tGkR9EUcKWsIvL9WICyUWnhxJi3BE+YqzBDB7AtUdqXPwLzY0PYnZ 4bkW/S/eQQRyZEBqyMc0rjOU0cqDJpHjb4s1PrmgonqOHsb7Pa7qBvXVCCs1/l63p1bHyLEVP83 P7WwauPPS6dFylczXeyHkCiOuXzzC76O+qRWM1qU05psdliQLZqjGcYDwR84Y3USyIW9Do42mF8 JTcUnF6OF7Xy9rx9QCRksErf4yWFqNSONedtSOG2efTfw9mx7nX1BHuTT/GlJiLnfP/pC33bCMy sqUwzEvFtug/CJ3RRTbzpXpbpsAiV5jUVn1+w0UR49+s1f0fLbBQX4szTAgrkqYBOMZ0eYNGB9u XZovttjHo7B/X+tPupjVIlwyCI5sXIVbrcUu3UJancZLemMPUnVjFZnpyemJjOaDvtH5gqFM1SC /ZoCSVrYRjvovovSSmeuW/4wtMg0px3UOWMY5YF2zzYawoGNjH/69qfvPL7n3DeTYe/RmoEU8Y1 FwLkw7p3xA= X-Received: by 2002:a05:600c:524c:b0:495:4cb6:71c3 with SMTP id 5b1f17b1804b1-4954cb67f3dmr201107495e9.39.1784623855515; Tue, 21 Jul 2026 01:50:55 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 02/16] hw/net/xilinx_axienet: Fix PHY register 17 link status reporting Date: Tue, 21 Jul 2026 09:50:36 +0100 Message-ID: <20260721085050.421257-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260721085050.421257-1-peter.maydell@linaro.org> References: <20260721085050.421257-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::330; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x330.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, 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 @linaro.org) X-ZM-MESSAGEID: 1784623968015158500 Content-Type: text/plain; charset="utf-8" From: Jay Chang The Marvell 88E1111 PHY register 17 (PHY Specific Status Register) bit 10 reports real-time link status. Previously, this register returned a fixed value of 0x8800 with bit 10 always cleared, causing U-Boot to always detect "No link" even when the link was up. Signed-off-by: Jay Chang Reviewed-by: Frank Chang Message-id: 20260713064617.85374-1-jay.chang@sifive.com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- hw/net/xilinx_axienet.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/net/xilinx_axienet.c b/hw/net/xilinx_axienet.c index 970732b162b..9f5f65ecfac 100644 --- a/hw/net/xilinx_axienet.c +++ b/hw/net/xilinx_axienet.c @@ -103,6 +103,9 @@ static unsigned int tdk_read(struct PHY *phy, unsigned = int req) case 17: /* Marvell PHY on many xilinx boards. */ r =3D 0x8000; /* 1000Mb */ + if (phy->link) { + r |=3D 0x0400; /* Link is up */ + } break; case 18: { --=20 2.43.0 From nobody Sat Jul 25 09:48:57 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=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1784623925; cv=none; d=zohomail.com; s=zohoarc; b=HJAqlSHTHEokSCtubULOIpNJNtgyuTJ/jAyAiq93Duxk8A7EpuQqxyXKNt39ZAYOwAvuR+TsCmReDC6tJsjROGG9hP91Uye4c6vzeUJWWS2Eq2ydWHvK1s+TbqMfkQxCxYY/ncsJUxt+N77+j5O9mFxCHqDEQPBb7JZfZ4rFqLs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784623925; 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=3pdZrBiJ/ZHAwvk1OO5i4mEcP54HyOUllZ94ugx0dKk=; b=j58XgQ/ClxsCVoXOI6C9kBq6231Yxi6x1wTuBrRTr60qP8A9SlM6S/8HX1Wvd7A/EB/mGtskCb5Ou+DIloa2bsWrctue4MYqHw/HcEdMerSh9KUT3NscaxrWz4fjA2W0Cp2UtBIXB432Ln5gzf0IinLmo0+YnRVNtDAgAn1lYJ4= 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=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1784623925372124.21568385158128; Tue, 21 Jul 2026 01:52:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wm6Bp-0005Nx-AK; Tue, 21 Jul 2026 04:51:01 -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 1wm6Bn-0005N1-Hd for qemu-devel@nongnu.org; Tue, 21 Jul 2026 04:50:59 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wm6Bl-0005gA-TW for qemu-devel@nongnu.org; Tue, 21 Jul 2026 04:50:59 -0400 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-47c2b362ee2so9686252f8f.1 for ; Tue, 21 Jul 2026 01:50:57 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4956537c7desm68707245e9.7.2026.07.21.01.50.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 01:50:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1784623856; x=1785228656; 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=3pdZrBiJ/ZHAwvk1OO5i4mEcP54HyOUllZ94ugx0dKk=; b=WUbiVUhdRUmeJLXuw5HvHOBdsp6X+Pbj32TTryT+WDqdOrZmWi4KtrCpMKM8L+s9JY AjLo1TEFga3tx7nWmolEkmUghUvjeIdnchfATAoKS5VPv3C3WUenDpAYvpkz69y+e0e/ GxkQFQVknkAmQCwpWo1TXyF3u5F2Go+YJ4q41vm7SwiajfpzbyqhCQnfgUnqqgN6lYf2 udRKpY76S3mXbe1OCGpwH5EkOquFN9/0i/Rge87jhxjgUttci/Ht4KmlFJEOGs4nwF2V cC7tk/aJpWqSm84GKsPpIsbA4Na/6qFhgt2IbZpNZXyoyYG3gZXFbBcxXBT05/2hJg9b ngWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784623856; x=1785228656; 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=3pdZrBiJ/ZHAwvk1OO5i4mEcP54HyOUllZ94ugx0dKk=; b=qBBTaf2XbxAHsyEiPXhQNNuBGygb3Ah1B86WM4IPFNMmUAQIzhgGmi31L1j+Srl2WS qIoPyBLmKQK3CMBFkr/HojjrjoMSZ9aRA3m1axnIOaliI9CjVu6T+mMw4hhuBnw5wXHi Iop3ygh4bvc3NK14C0kmKpAaNCduychsbhe97Dy0Ytcw+goY/NldCJ+XXADsJgrlB31F vAH88URAkCO9jYGs+YVLKZvlCOxceCJw1DX0oghC0/jGtB5H9TLdeh82ndAymSylR/FN Pi+MlhDedjne4zTEfAq1hnowv+3siue3ZVK9XmHeA31zCayXbPDpNL1hUHQeteBM4AoQ gyIg== X-Gm-Message-State: AOJu0YzuF8KYyJFQp2M0UI+aGU0MFMtRPtNzePOBF2PPBBoLUqIUoYf9 iWNYnrrdsBIjMYhhpneufZfOyrdz3AM6wYISeTvYpQ7lUsDpfSSetI+2bKJRn1dtGirlXneDG/C glRWEHkD0EA== X-Gm-Gg: AfdE7cmY9COzLo89l0crgOf5b0xY+lH3KhInxlTY42XVxSvbJGnpW/EHLk5H1KpdgvC ELw1gF/AyCuh3XMq0Wsn22bM3dDqQTuOw5q+oe/YEEDJQeHmbPGE6FTVAMWyBZ/AZ55WT9lZ9kX geGXSiBQJgbFAP19p0p26UvNwv4zxKr6LU4p0MYDoTp8LZzdMwjv0f0uSkNRiRbamVJBC7kS+17 EpRJwVWEEnrzIq7Pa71glA8OVeDt0pcCXgSXM4L4h+B0Lw9FEjYCg7wk/sGy506RPCRm4/6nDUD PemC1XRt5siqe13SMaX0ogzd1tTbF63RXycBfdnc2+eU1B9InIkgMJ1C8zUYQZO5SFQCAwhVdoT FtUtH34K8bBM9ORiTyWNynMj1YlAo8VLM9f4NJKZTl70zI0OI/epez7KeOBgYRKMdkYL5QDgX1l iXIKHp/BVVg6U0pZjamp2Vfy8MMy9BvuCTMT6RTC8pDz5cjGgJXkV2p5MMTQe4hsIBPCQ3IE/7c hOsrfvSdrw2zlqdeBWsEA== X-Received: by 2002:a05:600c:3baa:b0:495:52a5:8815 with SMTP id 5b1f17b1804b1-49552a588admr178032185e9.6.1784623856487; Tue, 21 Jul 2026 01:50:56 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 03/16] target/arm: GICv5 cpuif: gicr_cdia_read() ppibit should be 64 bits Date: Tue, 21 Jul 2026 09:50:37 +0100 Message-ID: <20260721085050.421257-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260721085050.421257-1-peter.maydell@linaro.org> References: <20260721085050.421257-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::432; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, 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 @linaro.org) X-ZM-MESSAGEID: 1784623927865158501 In gicr_cdia_read() we turn a PPI interrupt ID into a register index and a bit mask with a 1 for the bit we want to change: ppireg =3D id / 64; ppibit =3D 1ULL << (id % 64); However, we used the wrong type for ppibit, making it a uint32_t. If 'id' is too large we'll shift off the end, so we won't ever update the state of PPIs with indexes above 31. This didn't have any visible effects because the currently allocated architected PPIs are indexes 0..31, so you'd only see this if for some reason a guest was manually marking as pending a PPI in 32..63. Fix the type of ppibit to the intended 64 bit width. Fixes: 3f79212abae89 ("target/arm: GICv5 cpuif: Implement GICR CDIA command= ") Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20260714091806.3568281-2-peter.maydell@linaro.org --- target/arm/tcg/gicv5-cpuif.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/arm/tcg/gicv5-cpuif.c b/target/arm/tcg/gicv5-cpuif.c index 1cdd4103d0e..8e2a08fdb6f 100644 --- a/target/arm/tcg/gicv5-cpuif.c +++ b/target/arm/tcg/gicv5-cpuif.c @@ -633,7 +633,8 @@ static uint64_t gicr_cdia_read(CPUARMState *env, const = ARMCPRegInfo *ri) switch (type) { case GICV5_PPI: { - uint32_t ppireg, ppibit; + uint32_t ppireg; + uint64_t ppibit; =20 assert(id < GICV5_NUM_PPIS); ppireg =3D id / 64; --=20 2.43.0 From nobody Sat Jul 25 09:48:57 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=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1784623922; cv=none; d=zohomail.com; s=zohoarc; b=hQD/6Vf8UPqTImGCFKFFMsAySDA+DSSHHMnwRU3FxctCANQbsKfxjm7VNZu+u2peR2l6ZYuvpwujElV0p+bT378izpecakquM98wGQC3VCEuyLKlYTnjhSbLsFoNhTovmn4/0WgVcTgbzMHmw7T20wiOkXl/tCxGEaAj/sWgf+M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784623922; 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=tCar3TZ1LsBwAlO7WsEkLyf5Y2Y7u1oPE70SMZ0kqBY=; b=ZVX8G7z7MMJE7KBwac7iNSP7W6onnAJrVfv6DEum7Lr6tsoGBaydvxCkVgAx/0HA+prchPQXWdNCbLrClgWLouKG39PPdeXkwpPwjpF/nHjPLUA/d0IwRD33/CILBnGYHquH4hzHiggJtD7T9AUEota2GmmBauwL8dBlAlNB/dw= 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=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178462392225639.37720954913232; Tue, 21 Jul 2026 01:52:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wm6Bq-0005Ol-4Y; Tue, 21 Jul 2026 04:51:02 -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 1wm6Bo-0005Nn-Ik for qemu-devel@nongnu.org; Tue, 21 Jul 2026 04:51:00 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wm6Bn-0005gL-3K for qemu-devel@nongnu.org; Tue, 21 Jul 2026 04:51:00 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-49555a0e68bso12902455e9.2 for ; Tue, 21 Jul 2026 01:50:58 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4956537c7desm68707245e9.7.2026.07.21.01.50.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 01:50:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1784623858; x=1785228658; 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=tCar3TZ1LsBwAlO7WsEkLyf5Y2Y7u1oPE70SMZ0kqBY=; b=D4jLkO0OQOBbCoGBBH7pFBmaTLCmgojf8oPinISUmbaewgtLEbE6Ji8OCW/rdsDYhL BLku5VOTAJqAQqxyfgY3vYSztTYVbCN37SXYw06ow2jl1n/t8LYWbAPLPdmvQFOcJpyC wBeqqEPrMAcseTjDryn76csIBJWKyE3WxeqILspKNH2hplDrdMJ5rbubBDPBPAsr/REa Wlz6p9OIhtl71ozQS38rwc0Ka4LgV1Pg4rnkxmJIZmzx9B57CKVc0ee8I0q48vR7JXi8 xz4wvAffLQfDFOLMah5FssoEpMQC3p/ZYyDhgSplB+FVRS/ZKkdGpez8CSGBXIqL5LQq X4UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784623858; x=1785228658; 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=tCar3TZ1LsBwAlO7WsEkLyf5Y2Y7u1oPE70SMZ0kqBY=; b=b4t/UIqa6RJY88D/zrM7AkjhiKcfzLEcdIk6rmqrUV6anDHnIkiXi1j2vWswYQnXJf MxjosXj4zvUNTdQlHn9Gzuf9FkJppfGLne21AY2cKa9JGoJy7tUZd1FVgpkbvNHHtD+1 Z9lHdlpUBs40eLTwkB5VfBSu3avm7IyGW/kTBUKEQR0+tiNYaBrnMR0VSusGvgOLDmjg wgDFvmj8Cqx7TwVuhp3cWmuPPkPWp+ruZ99q6mkYaNQZUaZiBU12OJbWg8E/u6+ZXEt6 D8oRJw6kTVKwxqh5aP3bXwy5Scj+6dnI7ATKzWa03WLjV8RzGMp/I2SiTtIdFg+S2nS7 D22g== X-Gm-Message-State: AOJu0Yzs39Xs85Xn4FtmMUbz5ZBCtvvGufLrMG7uoYitNOFE1VzAOYmH Cr1qMyq5Kdt6zlcJv/UqN7ud9G5ezY0Mzr2VPaUgWFrzj5M0zDIfTVX2zErszgaHgYKX3zf7Z8g MEahq2NnbMA== X-Gm-Gg: AfdE7cnDIVTNucgjaH+uZUKyR3e5Zrp2/e4oVO+OYvIZrMi9xzWUDJY4SOC6uv7gQmh VHeKF/dxfGIO+uVkocGRrPJJeU+IOqvNurgMnvWvqQI14lwO6+BqpgemGH/oZ/E0TNYnPFi7Bdy 1fd/nkM2w32xUoKE3WrUbToQxTEj3XRbxsGh3ZNmZo/u7ggfCloDO3AoKGaPg6T6rB1VSKY28lJ i6qsAChWkqze9SzNcrJsOBbAZy41bkeRsBPxa9M656Tzvqsq5aLC97HznemqjqDlu99d+pw2s7L Ejzsow7zDtRaayPVuHLe7BSXda1xcnpzYcqoMPogH5ksxeWdKsHhfLWy9L1LBPDsyBKuMQAsHkw OD68+hW/OurXxKgNjN2H5trpfRCa7Lj66F8exdcMLhO9yX80t4cfcQDdwdiNiMRuOvSewTIp09r heDf10ajm4jHyNDlyXoFQbbPkFJ+IFOU4OJjRjvgElBF9IoOc74wF5hkd/7uUllgTD+9WoXR2hh c6oBBFrKUKLaVj8PsoGQQ== X-Received: by 2002:a05:600c:524c:b0:495:4e17:cad5 with SMTP id 5b1f17b1804b1-4954e17caeemr190912105e9.26.1784623857449; Tue, 21 Jul 2026 01:50:57 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 04/16] target/arm: GICv5 cpuif: Writes to ICC_APR_EL1 can change IRQ/FIQ Date: Tue, 21 Jul 2026 09:50:38 +0100 Message-ID: <20260721085050.421257-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260721085050.421257-1-peter.maydell@linaro.org> References: <20260721085050.421257-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::329; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, 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 @linaro.org) X-ZM-MESSAGEID: 1784623923823158500 The ICC_APR_EL1 register values change the current running priority, which we use in our calculations in gic_hppi(). Changing them can affect whether we have a HPPI, and so the value of the IRQ/FIQ outputs. We need to trigger an update in the register writefn. Fixes: 9bd90bddb79 ("target/arm: GICv5 cpuif: Signal IRQ or FIQ") Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20260714091806.3568281-3-peter.maydell@linaro.org --- target/arm/tcg/gicv5-cpuif.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/arm/tcg/gicv5-cpuif.c b/target/arm/tcg/gicv5-cpuif.c index 8e2a08fdb6f..a6e6c440849 100644 --- a/target/arm/tcg/gicv5-cpuif.c +++ b/target/arm/tcg/gicv5-cpuif.c @@ -495,6 +495,7 @@ static void gic_icc_apr_el1_write(CPUARMState *env, con= st ARMCPRegInfo *ri, GICv5Domain domain =3D gicv5_logical_domain(env); value &=3D 0xffffffff; env->gicv5_cpuif.icc_apr[domain] =3D value; + gicv5_update_irq_fiq(env); } =20 static uint64_t gic_icc_apr_el1_read(CPUARMState *env, const ARMCPRegInfo = *ri) --=20 2.43.0 From nobody Sat Jul 25 09:48:57 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=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1784623959; cv=none; d=zohomail.com; s=zohoarc; b=UB3TEY8DLZXUr+eaTMbf2ZKW+AvFXd5s5pAO/+3lM8DFgo5y9QDy7xrXmgcFgvTOfI8Bx6QlVX1EMIWARH6pRXmYoXYhEvUZUF7sV+Zu3YkSi7WHH/kS26ZWphbhFHJHcdgJ16NxEVL3gRuwhWNeawTPEw7aIU29+E8aAipTHFY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784623959; h=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=wyDVo0Oy7ludu4ybUH/QsUXKNrzdkD6NiRMRp1tTo+w=; b=OzDkh0tZg2ykOCMsLNivC+VV1XWgziDBaaiX8sNZPlYcF95s+oa1FiJ91Ut6aTGtAjtmGxwU6zqhZwtg7Z6ae29xj6OYwTPi33ykmJQsQdaSGkCYFTNJAyWnMGysReB+0SXj7/06ANUJs56OtMqMeEV5tkKttIWrNONkwCXTNU8= 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=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1784623959798865.4428987303702; Tue, 21 Jul 2026 01:52:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wm6Bs-0005Pn-NH; Tue, 21 Jul 2026 04:51:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wm6Bp-0005O6-Nn for qemu-devel@nongnu.org; Tue, 21 Jul 2026 04:51:01 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wm6Bo-0005gd-9n for qemu-devel@nongnu.org; Tue, 21 Jul 2026 04:51:01 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-490cf322ed0so78316795e9.1 for ; Tue, 21 Jul 2026 01:50:59 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4956537c7desm68707245e9.7.2026.07.21.01.50.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 01:50:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1784623859; x=1785228659; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=wyDVo0Oy7ludu4ybUH/QsUXKNrzdkD6NiRMRp1tTo+w=; b=IrgEhYhdmdDYr0sdgdmX2p32K0xFR4/SUiR9ag5NI1Qttt3R97QX4P1fJiKygR+Wux HXbqpKE6sIE/JqXV+sNsi6EX2NfSPAsNaVeiTUHuXKuN3MjWi3x+FiUSPKJkr1jst6pB 2U4S4ZyMWchfj4dUpmRvcm476H535ayQI9t9fZ/xcAM2s2aEA1xQpvtDzMM1DVFv2RlF hQ6b2FMnMMR9r0IPa7EzxlFPstNJ+5HtTtcNqgk7ZLHd7oewKrWmV4Xfg0VxIQICQESr l6scDB0KoIUuQ+ric+aev0HJ7jVDVpB2A968iywFDHsGu9zA4aaDCEAyItBsRxMyelE4 TqfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784623859; x=1785228659; h=content-transfer-encoding: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=wyDVo0Oy7ludu4ybUH/QsUXKNrzdkD6NiRMRp1tTo+w=; b=cDRHU6pdBcDOwNz6RUkZt+2VzbXd5ERjSnHFAo29moYA95KEcsjCQzr9xK+1EgTHoR tI5TsyGwfJYbzv0sc+6tKQnt/hWjhBmtE8YFLdC06YTPduh7WXq5M5NW8haOkEUC686Z wqsCqeVlgJWhauK52gMRu59xffp1pfLoDt3W2e06I0eQNzwCVicliWAVKUATJG5ToaEh E+L8ZsNPeyR51qgA1zgrfCxP9rac/noRVLTgLNMFf7dcej7Yoi+hCuODdO4Qqq4Af/f6 77GlpSsQSvr5yGuwOwtCPSHzmw1+UxIL9kBX1oAPiNUP4wHCedscqe28I/x9hPan/jSR 0iDg== X-Gm-Message-State: AOJu0YyqOAs6Si1yKw1RIZZ6SljqBKEYa0s1dYhZM2cvcAxuU6Rtxhsj mFUnk4o/NUs6vTU5Su+JM3uaoPkctCWnXPZh+8R/v7BLgMV5PRklDFky9j4cjzx86PtZEA176DC GSJM+Unz5gg== X-Gm-Gg: AfdE7cmHu7a2E95ZLxmfqwVGr83H2gg+PoPWRiL6Xu2c80Y8Cy1im32Hk816G/j3cen k4vXCurmA/mPKO2kkrxnfF0PTAdu7algNoCVqD4mrXbOErtNC/eSVCHWJsMSO0mSHmT/+qZfyxL RwSi0Z0nUI2LVsp+ETJPMNCrsZbxaEScCtd7S5vg2ZWUrm1tAuHwlUN80LQBa4CG5bzoJVY6qXV egpIDq/oi04n5Rql9BsbXnvmlhTYdXPNb/F1WJPfvsbmvNSP4+rwXqz+oMcnnuPzmngxMuvRxys MF3vhqtTioDoz+qdI8PG+hkK+geyC0xWhaqITtO33q77ohkeAv6w2EL/JcVvUVZ9SxKtykgBRlm 0Ah2CqeYipN6GvD9e1BtBlDTaeII0n6oyiJNjzwcp66JWJI+bYnqt8+X29o5xGcZic2pbxVZRpB D6G1brovQUTRa2QzVE5sNgESqivwnwDXj21MDh6HhLkgszXWov0+USk+LXBhtgBwyWyZO8+8mdg lgI6obOgRE= X-Received: by 2002:a05:600c:4f12:b0:493:f0f5:f2d2 with SMTP id 5b1f17b1804b1-4954a3d0ceemr210844225e9.1.1784623858648; Tue, 21 Jul 2026 01:50:58 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 05/16] target/ppc: Remove unused helper_lscbx() Date: Tue, 21 Jul 2026 09:50:39 +0100 Message-ID: <20260721085050.421257-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260721085050.421257-1-peter.maydell@linaro.org> References: <20260721085050.421257-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::32b; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, 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 @linaro.org) X-ZM-MESSAGEID: 1784623960007158500 Content-Type: text/plain; charset="utf-8" The helper_lscbx() function isn't called anywhere. It used to be used by the PPC 601 CPU support; we removed that in commit 005b69fdcc in 2022 but missed this helper function. Fixes: 005b69fdcc ("target/ppc: Remove PowerPC 601 CPUs") Signed-off-by: Peter Maydell Reviewed-by: Amit Machhiwal Message-id: 20260709095056.1803725-1-peter.maydell@linaro.org --- target/ppc/helper.h | 1 - target/ppc/mem_helper.c | 28 ---------------------------- 2 files changed, 29 deletions(-) diff --git a/target/ppc/helper.h b/target/ppc/helper.h index e99c8c824b4..6b2d19a3ad9 100644 --- a/target/ppc/helper.h +++ b/target/ppc/helper.h @@ -54,7 +54,6 @@ DEF_HELPER_FLAGS_2(dcbzl, TCG_CALL_NO_WG, void, env, tl) #endif DEF_HELPER_FLAGS_2(icbi, TCG_CALL_NO_WG, void, env, tl) DEF_HELPER_FLAGS_2(icbiep, TCG_CALL_NO_WG, void, env, tl) -DEF_HELPER_5(lscbx, tl, env, tl, i32, i32, i32) =20 #if defined(TARGET_PPC64) DEF_HELPER_4(DIVDEU, i64, env, i64, i64, i32) diff --git a/target/ppc/mem_helper.c b/target/ppc/mem_helper.c index 119dc1df233..787ba2cdec5 100644 --- a/target/ppc/mem_helper.c +++ b/target/ppc/mem_helper.c @@ -367,34 +367,6 @@ void helper_icbiep(CPUPPCState *env, target_ulong addr) #endif } =20 -/* XXX: to be tested */ -target_ulong helper_lscbx(CPUPPCState *env, target_ulong addr, uint32_t re= g, - uint32_t ra, uint32_t rb) -{ - int i, c, d; - - d =3D 24; - for (i =3D 0; i < xer_bc; i++) { - c =3D cpu_ldub_data_ra(env, addr, GETPC()); - addr =3D addr_add(env, addr, 1); - /* ra (if not 0) and rb are never modified */ - if (likely(reg !=3D rb && (ra =3D=3D 0 || reg !=3D ra))) { - env->gpr[reg] =3D (env->gpr[reg] & ~(0xFF << d)) | (c << d); - } - if (unlikely(c =3D=3D xer_cmp)) { - break; - } - if (likely(d !=3D 0)) { - d -=3D 8; - } else { - d =3D 24; - reg++; - reg =3D reg & 0x1F; - } - } - return i; -} - /*************************************************************************= ****/ /* Altivec extension helpers */ #if HOST_BIG_ENDIAN --=20 2.43.0 From nobody Sat Jul 25 09:48:57 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=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1784623962; cv=none; d=zohomail.com; s=zohoarc; b=nC3GHK94oTOMoAEFrx8xW3sKAkHK6yODc2+xQ3IuNhUn2czToBdhexh4SN96WqMCjzyn98BhQK1+2PVdbhRArJUV0OQX0UqBo/STjvZN04IhWU/ULja0mFFhpN/Ful9ffVMT808wvPTIvIrMy9ovChEQGbF9nADDRSnvBLYuGKw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784623962; 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=pWtBag4wvA9vYOnCp1HwRngJudddkIzftxnQ5jssfsI=; b=Cos4VCQYXID85tO5APXthrY/SIImOCzBb2eOsZ2fZpSnebq2jpydYGTgMNk6heEvIp1vqZjvegc8UvUGnSkuuD6uNl6gEDWmgzurVcYnhNfHovofuYXH47TOFc76GJkqaVz5re9XuXk/x2tmyC52bFrtr3Z2pclTL3WLlpkV+ps= 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=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1784623962048803.4734442275353; Tue, 21 Jul 2026 01:52:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wm6Bt-0005QI-Nr; Tue, 21 Jul 2026 04:51:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wm6Br-0005PP-Cn for qemu-devel@nongnu.org; Tue, 21 Jul 2026 04:51:03 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wm6Bp-0005gt-OB for qemu-devel@nongnu.org; Tue, 21 Jul 2026 04:51:03 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-49556f97a9dso16147405e9.1 for ; Tue, 21 Jul 2026 01:51:01 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4956537c7desm68707245e9.7.2026.07.21.01.50.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 01:50:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1784623860; x=1785228660; 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=pWtBag4wvA9vYOnCp1HwRngJudddkIzftxnQ5jssfsI=; b=TVW7DS7ap9o9O64AVZ9HnxbzQ4YH7hEtO3lnD9lioE2Dxu1TPt8iKUKMv6UG8xj3QG B0lrX74YfekAaHclCM7tmeM9S7SVevlTyuwFb7r6xgK7RTtycey9xH33INocUr0s0iHc 9BW4zaOhLjDNB3/t5YknqyiPkc05tNYE1O3VR/KpD8Bw0Mt3jQBK/48ShLf+GM3/F9Fv WRVt2ulN/l6+RMRwD1wXaWR0m3mXBOQzpkTZ93i/iw1OVQ2DZ4/At4JzLv4koGErmUqH +3pUKHPXndxWfknFyPH19u6nNz9PlUNT3tlNS/JNxfZpyfe4lUjNJCg5vQs16BfLUxkJ etxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784623860; x=1785228660; 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=pWtBag4wvA9vYOnCp1HwRngJudddkIzftxnQ5jssfsI=; b=em6RlCbKXOUf6fJJRC9z1+0IcjiFii4YwAJ2gDGq2RGa1nkAQRi3K77UtTAYCQJsn1 A5gOvl9/xJoqjhAye63sg9yN0J5nHRwhJnbhVZn3OfF5Xw2V8vTs8x8ynY4/FnYgh6hK 8Wyp/4+bC20jko4Pfl5sm19DnUlUa5z6tSY1PUSYkvl1cXOc5WsnGm+vsuReCRWOqKk/ ejoKVm8zuh/MMg8Rof+8/z0wnCdk3EwDDLAJo78H7Lu9zclLQC08H6ezBJP2BqOOo1QJ m/Okn2iGpV5vs/EaBnTgIcRM6KL/prAx01P4gXoel5fBrFVAMxMjAIA/G/nQVBqEqR1w bY7A== X-Gm-Message-State: AOJu0Yx0wrpxBIPSJjaBOT3GXePq7VRSru+/X4iO+euGDj+RCz3bdF82 EKM6N1MxMjVAKPaB7djRoFkxlxzT22/KByM+8BCHNB8pvCxRykwtjK+9onH7BLqndFd0zjHHqjd RfPsUW94akQ== X-Gm-Gg: AfdE7cnpwM2JKGPriHWmeaKwq1L4uBSNZY9IY6w2uHuUIlJafUJox8B5nL+HikEsvL9 cgD9dpsZM7tccOQ6ZBxHHWoS3ofjx3jUK2+PJHpWvLGzHr+HLsGDu6IOH+2FUYuyr1gSkVmd13q Hyzj21zIsb+GrMoisJFkLgOQt3JTMoxsc3OK1AOI1VidyWomtGwV5ghqZhVvs8sJzSUw9dlJNNx YKbdVSsuhvEXHqPSinmyatv3ENdZH9S9byRAnEPmEvnjl3+3IgyZXj3QcJ92CLT5WxuvvGf/1VB byz8EAOEyoIwmLD5LbU4ga/YPvQt6dtJ+PETIRrkBENpW4tUMFPjTzLbaV+ra7tO7U7sg37ab8b oh8QJFwuVMOY3RatmZej19Ul0qSq7nOM5EouLfYg/0GLq1tvV5bgRT1rek4HmV7wUvuXea4+phb MfhJFczz5FSV6lhtxFchGr8eAwTEp0j4MAVeY+kpJglACVqLV6blEiD0+/xo2GSBdQmMxgzHgRi cRCbckureM= X-Received: by 2002:a05:600c:8b37:b0:493:e4ce:acd0 with SMTP id 5b1f17b1804b1-4954a3d0967mr196037115e9.1.1784623859986; Tue, 21 Jul 2026 01:50:59 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 06/16] target/arm: Fix testing of raw mtx value Date: Tue, 21 Jul 2026 09:50:40 +0100 Message-ID: <20260721085050.421257-7-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260721085050.421257-1-peter.maydell@linaro.org> References: <20260721085050.421257-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::32e; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, 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 @linaro.org) X-ZM-MESSAGEID: 1784623964072158500 From: Richard Henderson MTX is always a pair of bits, one for each half of the address space. Testing it like a boolean is incorrect. Introduce raw_mte_check, a mirror of the similar mte_check function that applies when MTX is passed in MTEDESC. Fixes: 8912ceced815 ("target/arm: load on canonical tag loads ext bits") Signed-off-by: Richard Henderson Message-id: 20260717161430.37264-1-richard.henderson@linaro.org Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Peter Maydell --- target/arm/tcg/mte_helper.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/target/arm/tcg/mte_helper.c b/target/arm/tcg/mte_helper.c index dca4ef5a942..ad4ad5b4ccb 100644 --- a/target/arm/tcg/mte_helper.c +++ b/target/arm/tcg/mte_helper.c @@ -317,6 +317,12 @@ int load_tag1(uint64_t ptr, uint8_t *mem) return extract32(*mem, ofs, 4); } =20 +/* Like mtx_check, but simple mtx bit pair instead of MTEDESC. */ +static bool raw_mtx_check(unsigned mtx, unsigned bit55) +{ + return (mtx >> bit55) & 1; +} + uint64_t HELPER(ldg)(CPUARMState *env, uint64_t ptr, uint64_t xt, uint32_t= mtx) { int mmu_idx =3D arm_env_mmu_index(env); @@ -330,9 +336,11 @@ uint64_t HELPER(ldg)(CPUARMState *env, uint64_t ptr, u= int64_t xt, uint32_t mtx) /* Load if page supports tags. */ if (mem) { rtag =3D load_tag1(ptr, mem); - } else if (mtx) { - uint64_t bit55 =3D extract64(ptr, 55, 1); - rtag =3D 0xF * bit55; + } else { + bool bit55 =3D extract64(ptr, 55, 1); + if (raw_mtx_check(mtx, bit55)) { + rtag =3D 0xF * bit55; + } } =20 return address_with_allocation_tag(xt, rtag); @@ -387,7 +395,7 @@ static inline void do_stg(CPUARMState *env, uint64_t pt= r, uint64_t xt, /* Store if page supports tags. */ if (mem) { store1(ptr, mem, allocation_tag_from_addr(xt)); - } else if (mtx) { + } else if (raw_mtx_check(mtx, extract64(ptr, 55, 1))) { canonical_tag_write_fail(env, ptr, ra); } } @@ -420,6 +428,7 @@ static inline void do_st2g(CPUARMState *env, uint64_t p= tr, uint64_t xt, uint8_t *mem1, *mem2; =20 check_tag_aligned(env, ptr, ra); + mtx =3D raw_mtx_check(mtx, extract64(ptr, 55, 1)); =20 /* * Trap if accessing an invalid page(s). @@ -504,8 +513,8 @@ uint64_t HELPER(ldgm)(CPUARMState *env, uint64_t ptr, u= int32_t mtx) /* The tag is squashed to zero if the page does not support tags. */ if (!tag_mem) { /* Load canonical value if mtx is set (untagged memory region) */ - if (mtx) { - bool bit55 =3D extract64(ptr, 55, 1); + bool bit55 =3D extract64(ptr, 55, 1); + if (raw_mtx_check(mtx, bit55)) { ret =3D extract64(-bit55, 0, 1 << gm_bs); shift =3D extract64(ptr, LOG2_TAG_GRANULE, 4) * 4; return ret << shift; @@ -573,7 +582,7 @@ void HELPER(stgm)(CPUARMState *env, uint64_t ptr, uint6= 4_t val, uint32_t mtx) */ if (!tag_mem) { /* Storing tags to canonically tagged region: fault. */ - if (mtx) { + if (raw_mtx_check(mtx, extract64(ptr, 55, 1))) { canonical_tag_write_fail(env, ptr, ra); } return; @@ -630,7 +639,7 @@ void HELPER(stzgm_tags)(CPUARMState *env, uint64_t ptr,= uint64_t val, if (mem) { int tag_pair =3D (val & 0xf) * 0x11; memset(mem, tag_pair, tag_bytes); - } else if (mtx) { + } else if (raw_mtx_check(mtx, extract64(ptr, 55, 1))) { canonical_tag_write_fail(env, ptr, ra); } } --=20 2.43.0 From nobody Sat Jul 25 09:48:57 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=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1784623885; cv=none; d=zohomail.com; s=zohoarc; b=DkH/RFc5lSrozMXMmpcUNqVJfRO2S2ZJ86aa/uKPRuR/4y6fgCi+LxZ/FGR63VqmqiFhMA4lOkIVx4nruHKaHOErZZutmzxyxw9u3NnzUSXd+Mo5ana2lK2GyA5tU6PStNGFvQAep2Vw9aeYAVx4iMCilQkXb4v9OUCcO49v5Q0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784623885; 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=e2xGdu7KC0H8+/hf7XCFT3If/VGw9Iofr2FEjydtDnU=; b=YYVZIkmyoRVZzghwZKE88PzLOnIEJUFwdEXZ7TXdLrNfRvTVrznGRBGlmU2QqH2ATvtJYEFZy8w2G5T7dMz2hJl49Xf4N9w5M8mAzn4qn8qFm3hSOjcJNRlKKcWK5ykotNox8OxKYC26qAo8OwJtcuAJiYdMJuo8ll5ecX/44Ak= 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=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1784623885633476.1040123486724; Tue, 21 Jul 2026 01:51:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wm6Bu-0005QS-4R; Tue, 21 Jul 2026 04:51:06 -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 1wm6Bt-0005Pq-22 for qemu-devel@nongnu.org; Tue, 21 Jul 2026 04:51:05 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wm6Bq-0005h1-J1 for qemu-devel@nongnu.org; Tue, 21 Jul 2026 04:51:04 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4954f5e8020so14240455e9.2 for ; Tue, 21 Jul 2026 01:51:02 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4956537c7desm68707245e9.7.2026.07.21.01.51.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 01:51:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1784623861; x=1785228661; 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=e2xGdu7KC0H8+/hf7XCFT3If/VGw9Iofr2FEjydtDnU=; b=qjpvC5lFjSJn3/0c8Z51QY6wjrSfocw3BLQU7g7Y9KxMCKvfaHK4FJnK9sWNG2b4Oy QpsRtkveMMQgFMnJ2W+ksgAxqkoIuzTOJ5NVp4aIlhT7YomQGYJHJoFAM+Y8URUEXYkj H/g7GEpbxG2VaKneMfJ1YXPnoRnjh7cNCHRV3YQOKqgka6wWILkZkNK0MdNspPWT7hQx 7VtzMhxTY2W5YKanNHHAIXfEZ491O9O87Rlm4pcCQpIX3M8K7PwBUeDHElIFo4YkItyc cWaMn4KIonUMvhbxZFm0o/F03NtXiewtfwL9yHhSRmFoi9sr0kQEHn7SIzqUSiGIjErJ Nwcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784623861; x=1785228661; 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=e2xGdu7KC0H8+/hf7XCFT3If/VGw9Iofr2FEjydtDnU=; b=UQ86QTy3HUbhVMQkabq6qDmcHgbCR6QJg07QJR3a4GnVJ6KYvMH3vCEtLo3KIJo1Pf YThT0gYGNaloUKOSvmMaV48GQdrSUTGflWSio0NYTISidU7/48F1yguOs6eT0l43TaY+ Ged9FEH4Kbeezp+Occr6mdiPJLIAUiYZ/G6Tpw10XhGbA4o3+ZRvQ8TmlNyPYR6ycN0j hdS4092CqRMGEUzgN2Ibe5NM11yssRtFx5VyGiOho1AI4OPqBjR1cz77Rf3CCSr6eaZC olfJyXmouFWylPuuoBrpZnf71yJAtieF70YHsxsY+EDsm41U5WIBvZ8X72EFzzdkMKgX arJQ== X-Gm-Message-State: AOJu0YzGo28FN1cpgd3zPwQQq5djdlIKXZz1a2zaOlXtvXqU+f9j+5c5 uFelArFSo0vuvumtdRBD1T1YLkn2W5y4CYSx9mLNJmEiMmWAXdo1LaiW3y+GDpb8RTNSbEbmbbu 9nXtJE00Mmw== X-Gm-Gg: AfdE7cm8+8BXCme3XxCpT+w+Zin5ZUY0tXrIajphVJ4oC50y5bi+FnzQkFGE02iBEGH 3j8d/7HEth6MPXzJl8ZBu1xtWO8OcH1GZClvE8sKpJ+zZOY1f7usfFVYueDOCjUWskHjiPZIfg0 UIFRMe6b6vncm/w1ewLjnNw0SlEt06NvZzy8GLvBhu5KrBja/6t0/wdCakS/fXd+ucLeDi5uG2y 1EEtyk2i/A1bQ8aKizrsn8ycu+x9jrUl9N3MZki9ErsUHKIAzkbOowFAQqI9xBhum7cEKES+si0 HaUyahrX8I7f5yntZe6C8LgO7/WSzUBhmSaylUb1/ViCnaQM44fmDJ1Ga7q1jWV4/AwwfhSbUgW a5GKWW2dktV7iISsTIIJzlxUnDk7jmOBKYBEhdi0/7aM2gFCN8Ggyc+tZ/ktEfNLtHnL+QWELFx 0KeT1YnRFatHD3KASyyhuM1744IRWRoCEmw30AfCaGjjPKctsfXFRQ3aP6gSK9844hlzyRPaTuV ZqOWrU71jE= X-Received: by 2002:a05:600c:4f92:b0:493:bd2a:93be with SMTP id 5b1f17b1804b1-4954a3d0ce2mr191243805e9.6.1784623860996; Tue, 21 Jul 2026 01:51:00 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 07/16] hw/dma/soc_dma: Remove soc_dma_port_fifo support Date: Tue, 21 Jul 2026 09:50:41 +0100 Message-ID: <20260721085050.421257-8-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260721085050.421257-1-peter.maydell@linaro.org> References: <20260721085050.421257-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::335; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, 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 @linaro.org) X-ZM-MESSAGEID: 1784623888785158500 Our current single OMAP SoC doesn't call the soc_dma_port_add_fifo(), soc_dma_port_add_fifo_in() or soc_dma_port_add_fifo_out() functions. Remove them, plus the soc_dma_port_fifo handling that only those functions needed. The motivation for this is that it removes a lot of code that is careless about the fact that the largest possible DMA transfer is more bits than will fit into an "int" variable, and which does direct accesses to host memory pointers into guest backing RAM without doing bounds checks. Deleting this code means we don't have to audit and update it. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20260710105907.2570621-2-peter.maydell@linaro.org --- hw/dma/soc_dma.c | 105 +-------------------------------------- include/hw/arm/soc_dma.h | 24 ++------- 2 files changed, 5 insertions(+), 124 deletions(-) diff --git a/hw/dma/soc_dma.c b/hw/dma/soc_dma.c index d5c52b804f8..8ba531feea4 100644 --- a/hw/dma/soc_dma.c +++ b/hw/dma/soc_dma.c @@ -29,33 +29,6 @@ static void transfer_mem2mem(struct soc_dma_ch_s *ch) ch->paddr[1] +=3D ch->bytes; } =20 -static void transfer_mem2fifo(struct soc_dma_ch_s *ch) -{ - ch->io_fn[1](ch->io_opaque[1], ch->paddr[0], ch->bytes); - ch->paddr[0] +=3D ch->bytes; -} - -static void transfer_fifo2mem(struct soc_dma_ch_s *ch) -{ - ch->io_fn[0](ch->io_opaque[0], ch->paddr[1], ch->bytes); - ch->paddr[1] +=3D ch->bytes; -} - -/* This is further optimisable but isn't very important because often - * DMA peripherals forbid this kind of transfers and even when they don't, - * oprating systems may not need to use them. */ -static void *fifo_buf; -static int fifo_size; -static void transfer_fifo2fifo(struct soc_dma_ch_s *ch) -{ - if (ch->bytes > fifo_size) - fifo_buf =3D g_realloc(fifo_buf, fifo_size =3D ch->bytes); - - /* Implement as transfer_fifo2linear + transfer_linear2fifo. */ - ch->io_fn[0](ch->io_opaque[0], fifo_buf, ch->bytes); - ch->io_fn[1](ch->io_opaque[1], fifo_buf, ch->bytes); -} - struct dma_s { struct soc_dma_s soc; int chnum; @@ -67,11 +40,6 @@ struct dma_s { enum soc_dma_port_type type; hwaddr addr; union { - struct { - void *opaque; - soc_dma_io_t fn; - int out; - } fifo; struct { void *base; size_t size; @@ -129,20 +97,7 @@ static inline enum soc_dma_port_type soc_dma_ch_update_= type( struct dma_s *dma =3D (struct dma_s *) ch->dma; struct memmap_entry_s *entry =3D soc_dma_lookup(dma, ch->vaddr[port]); =20 - if (entry->type =3D=3D soc_dma_port_fifo) { - while (entry < dma->memmap + dma->memmap_size && - entry->u.fifo.out !=3D port) - entry ++; - if (entry->addr !=3D ch->vaddr[port] || entry->u.fifo.out !=3D por= t) - return soc_dma_port_other; - - if (ch->type[port] !=3D soc_dma_access_const) - return soc_dma_port_other; - - ch->io_fn[port] =3D entry->u.fifo.fn; - ch->io_opaque[port] =3D entry->u.fifo.opaque; - return soc_dma_port_fifo; - } else if (entry->type =3D=3D soc_dma_port_mem) { + if (entry->type =3D=3D soc_dma_port_mem) { if (entry->addr > ch->vaddr[port] || entry->addr + entry->u.mem.size <=3D ch->vaddr[por= t]) return soc_dma_port_other; @@ -173,15 +128,8 @@ void soc_dma_ch_update(struct soc_dma_ch_s *ch) } dst =3D soc_dma_ch_update_type(ch, 1); =20 - /* TODO: use src and dst as array indices. */ if (src =3D=3D soc_dma_port_mem && dst =3D=3D soc_dma_port_mem) ch->transfer_fn =3D transfer_mem2mem; - else if (src =3D=3D soc_dma_port_mem && dst =3D=3D soc_dma_port_fifo) - ch->transfer_fn =3D transfer_mem2fifo; - else if (src =3D=3D soc_dma_port_fifo && dst =3D=3D soc_dma_port_mem) - ch->transfer_fn =3D transfer_fifo2mem; - else if (src =3D=3D soc_dma_port_fifo && dst =3D=3D soc_dma_port_fifo) - ch->transfer_fn =3D transfer_fifo2fifo; else ch->transfer_fn =3D ch->dma->transfer_fn; =20 @@ -251,61 +199,10 @@ struct soc_dma_s *soc_dma_init(int n) } =20 soc_dma_reset(&s->soc); - fifo_size =3D 0; =20 return &s->soc; } =20 -void soc_dma_port_add_fifo(struct soc_dma_s *soc, hwaddr virt_base, - soc_dma_io_t fn, void *opaque, int out) -{ - struct memmap_entry_s *entry; - struct dma_s *dma =3D (struct dma_s *) soc; - - dma->memmap =3D g_realloc(dma->memmap, sizeof(*entry) * - (dma->memmap_size + 1)); - entry =3D soc_dma_lookup(dma, virt_base); - - if (dma->memmap_size) { - if (entry->type =3D=3D soc_dma_port_mem) { - if (entry->addr <=3D virt_base && - entry->addr + entry->u.mem.size > virt_base) { - error_report("%s: FIFO at %"PRIx64 - " collides with RAM region at %"PRIx64 - "-%"PRIx64, __func__, - virt_base, entry->addr, - (entry->addr + entry->u.mem.size)); - exit(-1); - } - - if (entry->addr <=3D virt_base) - entry ++; - } else - while (entry < dma->memmap + dma->memmap_size && - entry->addr <=3D virt_base) { - if (entry->addr =3D=3D virt_base && entry->u.fifo.out =3D= =3D out) { - error_report("%s: FIFO at %"PRIx64 - " collides FIFO at %"PRIx64, - __func__, virt_base, entry->addr); - exit(-1); - } - - entry ++; - } - - memmove(entry + 1, entry, - (uint8_t *) (dma->memmap + dma->memmap_size ++) - - (uint8_t *) entry); - } else - dma->memmap_size ++; - - entry->addr =3D virt_base; - entry->type =3D soc_dma_port_fifo; - entry->u.fifo.fn =3D fn; - entry->u.fifo.opaque =3D opaque; - entry->u.fifo.out =3D out; -} - void soc_dma_port_add_mem(struct soc_dma_s *soc, uint8_t *phys_base, hwaddr virt_base, size_t size) { diff --git a/include/hw/arm/soc_dma.h b/include/hw/arm/soc_dma.h index bcdb91425a5..e1d75bb3baa 100644 --- a/include/hw/arm/soc_dma.h +++ b/include/hw/arm/soc_dma.h @@ -25,12 +25,10 @@ =20 struct soc_dma_s; struct soc_dma_ch_s; -typedef void (*soc_dma_io_t)(void *opaque, uint8_t *buf, int len); typedef void (*soc_dma_transfer_t)(struct soc_dma_ch_s *ch); =20 enum soc_dma_port_type { soc_dma_port_mem, - soc_dma_port_fifo, soc_dma_port_other, }; =20 @@ -57,8 +55,6 @@ struct soc_dma_ch_s { hwaddr vaddr[2]; /* Updated by .transfer_fn(). */ /* Private */ void *paddr[2]; - soc_dma_io_t io_fn[2]; - void *io_opaque[2]; =20 int running; soc_dma_transfer_t transfer_fn; @@ -82,33 +78,21 @@ struct soc_dma_s { =20 /* Call to activate or stop a DMA channel. */ void soc_dma_set_request(struct soc_dma_ch_s *ch, int level); -/* Call after every write to one of the following fields and before +/* + * Call after every write to one of the following fields and before * calling soc_dma_set_request(ch, 1): * ch->type[0...1], * ch->vaddr[0...1], * ch->paddr[0...1], - * or after a soc_dma_port_add_fifo() or soc_dma_port_add_mem(). */ + * or after a soc_dma_port_add_mem(). + */ void soc_dma_ch_update(struct soc_dma_ch_s *ch); =20 /* The SoC should call this when the DMA module is being reset. */ void soc_dma_reset(struct soc_dma_s *s); struct soc_dma_s *soc_dma_init(int n); =20 -void soc_dma_port_add_fifo(struct soc_dma_s *dma, hwaddr virt_base, - soc_dma_io_t fn, void *opaque, int out); void soc_dma_port_add_mem(struct soc_dma_s *dma, uint8_t *phys_base, hwaddr virt_base, size_t size); =20 -static inline void soc_dma_port_add_fifo_in(struct soc_dma_s *dma, - hwaddr virt_base, soc_dma_io_t fn, void *opaque) -{ - return soc_dma_port_add_fifo(dma, virt_base, fn, opaque, 0); -} - -static inline void soc_dma_port_add_fifo_out(struct soc_dma_s *dma, - hwaddr virt_base, soc_dma_io_t fn, void *opaque) -{ - return soc_dma_port_add_fifo(dma, virt_base, fn, opaque, 1); -} - #endif --=20 2.43.0 From nobody Sat Jul 25 09:48:57 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=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1784623954; cv=none; d=zohomail.com; s=zohoarc; b=SmgVAjYWDvtjiYSec9tfz4ZO78T/RjThdIREUHvuDE9TkLSurDvcWSRzPcEHkK8+3QGUBRtfjL2Ddk+Qn82r5g4F37vMlqLi2+LHOB8uXNaIuXF++teAgOAnJVRtyuxlOb5NNdlyVCTx4in1bGwxvo+iCUZM4FR5Mxg89Vku3HA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784623954; 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=p2SdnMPSFNDw640OsqVyUvCx8izUmKjYNV5y9Iu1/e8=; b=ign/hzn924IqJkxMvciRLH7G4eho9KNSgKWo/+id4B+Zu0ithPa9Y1TjSJNWTxMixdGYVNJjouVHpW6OM6nBpHea4tS84/r1ZMHK4hBDHwOY7fwLaQ78imtiz2PYVc61iK35DdrrBhY0X308h1NGxu9RBU3avxujGT2bdYnzFRs= 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=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17846239543251002.4901870834543; Tue, 21 Jul 2026 01:52:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wm6Bv-0005Qz-8j; Tue, 21 Jul 2026 04:51: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 1wm6Bt-0005QN-T5 for qemu-devel@nongnu.org; Tue, 21 Jul 2026 04:51:05 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wm6Br-0005hD-FV for qemu-devel@nongnu.org; Tue, 21 Jul 2026 04:51:05 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-490cf322ed0so78317235e9.1 for ; Tue, 21 Jul 2026 01:51:03 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4956537c7desm68707245e9.7.2026.07.21.01.51.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 01:51:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1784623862; x=1785228662; 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=p2SdnMPSFNDw640OsqVyUvCx8izUmKjYNV5y9Iu1/e8=; b=ViJLz6cUceIDtsJQpvtkQO7iLUvj4b3I1PjeywNNd2YzQVwixwz5OMGDDz2pL3HJKJ g2ofNFG75I/+CVfdb45kmJm0jMuMNzP1yOuGNGbCaP2dSfHha7fiI13nvF+oIZvBhHB6 M5Yuq4NEyNjZSHlDNtL2JX45Yn2dS+KO7Wu/ikSmIEHBhXstaZL0KsLduPjBUzHplE7+ z+mgsksAZKytFJVW96GEuNN+8TQPrCP1WF9pmT0XiXL89U+BnhjMFwIZWWOh57yo53KP DMfBQ0rshy5XJ2BDbCUARBvrSZ6PS3VjOJmPcUuVP8VAifFFoIpiQPI+X5M339xKnmL8 zZGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784623862; x=1785228662; 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=p2SdnMPSFNDw640OsqVyUvCx8izUmKjYNV5y9Iu1/e8=; b=CnIuSX6H0JHJ4D/VMxeF2Enzhu3MUVRQcHanu7PJ+u3pqf7MMi0z4DKRFBuKk30uD7 h3RWhAf/s3jCk0A7K7VD915YPaOzKfLm/4IhxWaIXXg0akTDV5Ksy1MfGR8SAXQCuXIN tzdN37IU1B/YaX2M/PhemN3vZw/rJuNCpboMjQjcPBS117h/49UaiF605frXKb4qORts 6O4zMABxj9YFXP/TB3jYLvzzGPepnP2uLeFumnX8NwvtTUJrqp9mcD897PKaturpSUNn TqbyRxoEdPAzYUC0QOk7fcbe8Qdd7j7bMQoY2FpsyazHR2bBf1WIzkq7IxxFFWMqANIz 4jIA== X-Gm-Message-State: AOJu0YyEeN9EvwJ5J4yTkKzz02Oi2Kg0SLx6uwrzmXTfkJAsstO2VuhY ZjuD6LGDtSGTGtWy0NVqiAjF2ddt+arWMveBo7+wy4Ose/TTlJWbgKC+++DDj3/EnNrs0791csH 8NnCaxjUmIQ== X-Gm-Gg: AfdE7cmuS6Fgt/fSwhWBKOxphIWMzdipEBpA3AnL78rNV8msh3dQ6F9IumU7pQOcOIc pQChlEK5joRnydokMWyGPdraCDHskv6ZuO5zhwlxUMyh1pFPElqNP4kuIRgpjGTBGS6zUngfwF1 Fxwiw1Ga3k0/erY73815mJyYQlNhiePdUDZFGUGYpYISxzYtWy49DCVm89LReOMH5AybXAd8F+f k7JaxDXnI6X9fWxaXF+ORrU/qaxZgcu3REPxWXzQn20QRxH0bCSYCddHQQ7umxlefaQoWoWve6X ZjYz6Rf1xJAwW+EkvYSc5N8B5QVOX1rJovj833BMNFS+CJQ2SuFfHDpX4L5A9HKTP9CpbLu0JCU UmMsyeSUgyq+2MSkGwKa07BwMKuabhyWOTuAKpB1Q4p/R0V2CMEnW9uMD0u/kGImH41HeWOpCjp piVARPGNgSx0fUA/F7GwDrCp/6ROxgmG6iaVp/NXpqLRswqXMAmfVgFsjEqtDnDPj25ldeVuvwB CqAzLbY+Os= X-Received: by 2002:a05:600c:4512:b0:493:bc4a:fb56 with SMTP id 5b1f17b1804b1-4954a50e92bmr193757495e9.39.1784623861912; Tue, 21 Jul 2026 01:51:01 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 08/16] hw/dma/soc_dma: Simplify soc_dma_ch_update() Date: Tue, 21 Jul 2026 09:50:42 +0100 Message-ID: <20260721085050.421257-9-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260721085050.421257-1-peter.maydell@linaro.org> References: <20260721085050.421257-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::331; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, 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 @linaro.org) X-ZM-MESSAGEID: 1784623955968158500 Now we only have "mem" and "other" as soc_dma_port_type values, we can simplify soc_dma_ch_update(): either both src and dst are mem, in which case we use transfer_mem2mem and set update to 1 to tell omap_dma_transfer_setup() to update all the guest-visible src/dest/count information to indicate a completed transfer; or else we use the omap_dma_transfer_generic() function, and we set update to 0 to tell omap_dma_transfer_setup() that the transfer function will be updating the src/dest/count. Signed-off-by: Peter Maydell Message-id: 20260710105907.2570621-3-peter.maydell@linaro.org Reviewed-by: Alex Benn=C3=A9e --- hw/dma/soc_dma.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/hw/dma/soc_dma.c b/hw/dma/soc_dma.c index 8ba531feea4..ff513383886 100644 --- a/hw/dma/soc_dma.c +++ b/hw/dma/soc_dma.c @@ -121,19 +121,14 @@ void soc_dma_ch_update(struct soc_dma_ch_s *ch) enum soc_dma_port_type src, dst; =20 src =3D soc_dma_ch_update_type(ch, 0); - if (src =3D=3D soc_dma_port_other) { + dst =3D soc_dma_ch_update_type(ch, 1); + if (src =3D=3D soc_dma_port_other || dst =3D=3D soc_dma_port_other) { ch->update =3D 0; ch->transfer_fn =3D ch->dma->transfer_fn; - return; - } - dst =3D soc_dma_ch_update_type(ch, 1); - - if (src =3D=3D soc_dma_port_mem && dst =3D=3D soc_dma_port_mem) + } else { + ch->update =3D 1; ch->transfer_fn =3D transfer_mem2mem; - else - ch->transfer_fn =3D ch->dma->transfer_fn; - - ch->update =3D (dst !=3D soc_dma_port_other); + } } =20 static void soc_dma_ch_freq_update(struct dma_s *s) --=20 2.43.0 From nobody Sat Jul 25 09:48:57 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=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1784623943; cv=none; d=zohomail.com; s=zohoarc; b=SW6ZyLNtmO/FG6/BpMjhZnUsvO7QjnnAIhhVe9l9KksbNh70mJqVNbhdTgORW2rMgJrIFTrvKPH6tf/Q4DPlaTYE86dLX2TeXt9l1EYUBSPbqHFo83gyLnUlwPED8vxvLMlfTiBNhfMSU97qrSCxeUtwFhaWITEoxHVckV5rKcs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784623943; 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=FKIxkzQI1zH0yFEHRdQ3Fup7bYf/06pJKhM3oPGWdhA=; b=LjGOWaH3PFwYiLhyeRwOttpR7/tC04CkILEReV/ImarmPBVPQHZ3jxAaUDtf9iLzu/rweTb0fepzDDxt4dFkBk8NODtbaQ61WnM3EGqzL67IDpkLL1Bt49nR3cW6BwswrMEhsfYkb8JpIDqpsMfXiDg4MCeipfNk9LL46nnoTec= 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=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1784623943740275.4785665747776; Tue, 21 Jul 2026 01:52:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wm6Bv-0005RA-Hu; Tue, 21 Jul 2026 04:51: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 1wm6Bu-0005QW-4R for qemu-devel@nongnu.org; Tue, 21 Jul 2026 04:51:06 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wm6Bs-0005hS-CV for qemu-devel@nongnu.org; Tue, 21 Jul 2026 04:51:05 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-4954afac04bso34360755e9.0 for ; Tue, 21 Jul 2026 01:51:03 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4956537c7desm68707245e9.7.2026.07.21.01.51.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 01:51:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1784623863; x=1785228663; 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=FKIxkzQI1zH0yFEHRdQ3Fup7bYf/06pJKhM3oPGWdhA=; b=PpIwiZBHJgRLJYiM87Vb32TC9BUZ3MbiPcyLFpDv/Xdz2yDKkFkbmMwBE1XTx75AUP lP1B4ZmfZ4eZ7ROrR97sRuXbJ0/nNK2OSItxJrXwgN3uUtJkEc8Do/5R4lwIu/IASZZD KUpDb5HMjz//C1HZwEejvc1Pe7CK+AsnX0lU1TJSNL0D5cxDoLjiVjt8OyG5va6OIASL iACSHMuWruQfvCh+oEhAaK7Xsmy2JFaXQdAJTZ2b7trW4lT7VXhKJhNkZUGR7wOkvFOm 88M8mi4UcTTuTtoA5nfBGzOHYiQ/9pn64BhdYFde+nSu3GdRjt/ZfCnppdTOVJCoW9Fd A4NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784623863; x=1785228663; 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=FKIxkzQI1zH0yFEHRdQ3Fup7bYf/06pJKhM3oPGWdhA=; b=PQJbUejKl2zklNLhuP15T6ARFueRPq5FQLFy1raeDGiSgSp5gCKCg+yaFHQTPtvrUG +LbhR+Z4wC06ngpIdf7A9U4fRUkYhpbvS6WSe9tAGlR/EWIA2jStA3hILElFAqWEWdLs LyNBwwzCpOXw2CqiMsil3dm68GvkopvIs73yioIffws2s5Ow2KsMvsS+7Nvfst2nTxFy ql0q9t2Tmy7b2V4yMpnYBIYRBC89xdomg99fcnFZUxb8ch/PGP53EMm1//8xVMQ8ND84 jJt0GyrJARmNYqzXJsmc9OiqX+mC/zvajoBI7nPlBcGHMACUtVYVXIoZtZpa+ex9lb2n 4akg== X-Gm-Message-State: AOJu0YwkSRjKJAKM5Svl5LRh5B/A2P3NKsFK/Da2yZmD3uKEFMzV0grh FN/Y1TPOE/kZINnGO3GaxZVbOVmw+ktbco8U6qXoqFXaguw3r5I/0hXRhIu5I7ns1cT7uGj27Hr ANO2XnBMcEQ== X-Gm-Gg: AfdE7cmew1h+qif+tfz5sIOsjpj64C7uvdEL5KlY8gASW/cfGiKBxXeLer6hjRlMAQR gRgLgG87uHu242gLMShOtnzOBzpw4WVtPtj2bREM5MWKO7opw310EuWuYbYdTWvaOAYF5Fpt9lP Hg8lAZThLrrDSZWRmFd7Sm6rWpn+xnZU7tWVaS21pdRm5O/y3Sv3Pd3PtuV1nkfXx4X9R1D8cJS 8bZVqNhb5Ei+JJr6A7MdlwJ7MhbGm2ofuxUo8IeVG7r2nwwv9WeCZQoUzukOhOQDNeqokbBbUvv vlnfuqDtLEKA9IU0kQEElmjMZCuJFjCDllN3HaviIpzcuqMq9pFuyiswlNCslOMAgUxvVCFJ6mB 6/x6BckqhpqZDM6J3hpRsGVgwpVLWcJ7Nqp9yIONLNP1/bDcg2Rz5iMwbcTFlBFgH+Cj+maZXUT fUu35TgxMuHXp/lE7Nm0cvWe7WTzDuIt9vKlo0Uzqk9XsKZNp8nbOB34O0+4Hn6QOMzSNE9IPYy NDrC/zzSe8= X-Received: by 2002:a05:600c:4f81:b0:495:5b4a:53b7 with SMTP id 5b1f17b1804b1-4955b4a5c0amr102105205e9.19.1784623862983; Tue, 21 Jul 2026 01:51:02 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 09/16] hw/dma/soc_dma: Remove union from memmap_entry_s struct Date: Tue, 21 Jul 2026 09:50:43 +0100 Message-ID: <20260721085050.421257-10-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260721085050.421257-1-peter.maydell@linaro.org> References: <20260721085050.421257-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::32b; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, 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 @linaro.org) X-ZM-MESSAGEID: 1784623945964158500 There's only one field in the union inside memmap_entry_s now that we've removed the soc_dma_port_fifo handling. Simplify by removing the union. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20260710105907.2570621-4-peter.maydell@linaro.org --- hw/dma/soc_dma.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/hw/dma/soc_dma.c b/hw/dma/soc_dma.c index ff513383886..bbcd2bdcd56 100644 --- a/hw/dma/soc_dma.c +++ b/hw/dma/soc_dma.c @@ -39,12 +39,10 @@ struct dma_s { struct memmap_entry_s { enum soc_dma_port_type type; hwaddr addr; - union { - struct { - void *base; - size_t size; - } mem; - } u; + struct { + void *base; + size_t size; + } mem; } *memmap; int memmap_size; =20 @@ -99,7 +97,7 @@ static inline enum soc_dma_port_type soc_dma_ch_update_ty= pe( =20 if (entry->type =3D=3D soc_dma_port_mem) { if (entry->addr > ch->vaddr[port] || - entry->addr + entry->u.mem.size <=3D ch->vaddr[por= t]) + entry->addr + entry->mem.size <=3D ch->vaddr[port]) return soc_dma_port_other; =20 /* TODO: support constant memory address for source port as used f= or @@ -107,7 +105,7 @@ static inline enum soc_dma_port_type soc_dma_ch_update_= type( if (ch->type[port] !=3D soc_dma_access_const) return soc_dma_port_other; =20 - ch->paddr[port] =3D (uint8_t *) entry->u.mem.base + + ch->paddr[port] =3D (uint8_t *) entry->mem.base + (ch->vaddr[port] - entry->addr); /* TODO: save bytes left to the end of the mapping somewhere so we * can check we're not reading beyond it. */ @@ -212,12 +210,12 @@ void soc_dma_port_add_mem(struct soc_dma_s *soc, uint= 8_t *phys_base, if (entry->type =3D=3D soc_dma_port_mem) { if ((entry->addr >=3D virt_base && entry->addr < virt_base + s= ize) || (entry->addr <=3D virt_base && - entry->addr + entry->u.mem.size > virt_base))= { + entry->addr + entry->mem.size > virt_base)) { error_report("%s: RAM at %"PRIx64 "-%"PRIx64 " collides with RAM region at %"PRIx64 "-%"PRIx64, __func__, virt_base, virt_base + size, - entry->addr, entry->addr + entry->u.mem.size); + entry->addr, entry->addr + entry->mem.size); exit(-1); } =20 @@ -246,8 +244,8 @@ void soc_dma_port_add_mem(struct soc_dma_s *soc, uint8_= t *phys_base, =20 entry->addr =3D virt_base; entry->type =3D soc_dma_port_mem; - entry->u.mem.base =3D phys_base; - entry->u.mem.size =3D size; + entry->mem.base =3D phys_base; + entry->mem.size =3D size; } =20 /* TODO: port removal for ports like PCMCIA memory */ --=20 2.43.0 From nobody Sat Jul 25 09:48:57 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=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1784623959; cv=none; d=zohomail.com; s=zohoarc; b=fE+pbG9yOTsGMzpZMyl07akiIbf/ZAqraTe7gfmZOjz2CknqjLO/Xn9Pp7f69MlknH02Zn/b8YpMYQSQ5hsCDZEqM91QEhr4uFPuuv/CfvAWzvGWaDggtzE4ZW9TCIMsbUs4kBik7SEJpRGyj70Za8Vki8lTfmyCykbmmNzHD2Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784623959; h=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=2OH8VSOIHdDNZWpR3lhruykF7B4xhDvib/Al3Gjf0HA=; b=ZxueVu1W9bUraVEy2adDWBFvuvwzTDSZxpU+OXcXSdlBl23XFyXkA/0XJOscezzNWBAVTJspt5FZSueMaP4L0J2caeR2djntuXCypaBpO8UMUDNmALchXCG2hlV6qezjCp1bhvL5T47VHngfLkmqwtAbc6R26HOoLVi6FCa3i6Q= 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=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1784623959483944.9830889254548; Tue, 21 Jul 2026 01:52:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wm6Bz-0005Sq-Jr; Tue, 21 Jul 2026 04:51:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wm6Bv-0005RQ-U4 for qemu-devel@nongnu.org; Tue, 21 Jul 2026 04:51:07 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wm6Bu-0005hk-7E for qemu-devel@nongnu.org; Tue, 21 Jul 2026 04:51:07 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-47f703a9d05so1458105f8f.0 for ; Tue, 21 Jul 2026 01:51:05 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4956537c7desm68707245e9.7.2026.07.21.01.51.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 01:51:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1784623865; x=1785228665; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=2OH8VSOIHdDNZWpR3lhruykF7B4xhDvib/Al3Gjf0HA=; b=gJEi6Le6zerxNlIgWzR3ILyEfp2H6ikWrrHDzS+1ueE4se5NsOcn3GpLJTwDM1Dfrr Bsx6d8McEyXvB2zAuJL+ZGk7sOwWh2/NIjBRnVEtC9GQsgubgHQya0vEcmRmhzq5ebh7 X688HVdUtaoNWP7E4+Blk2tyEX5nKetIvCTcquLbFDZpQfnWPQ88PvdgVk3zlvxqiX8I LcIQwo9I0Cu76oMC/Y/pc59+TXxCi3Ar8/x6S1PhDNJ0lq0D74k1tJFSreWrNOzmNsB2 hiQ71Ivqeiu8K9tDklnNtNUxqpnimNz/isqP96b9STZ628jvf2pkWH70ohkExZ4EKOFJ o/Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784623865; x=1785228665; h=content-transfer-encoding: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=2OH8VSOIHdDNZWpR3lhruykF7B4xhDvib/Al3Gjf0HA=; b=STGI2elaPLHO9mPUseoWybw6e9ZkIxwmCetz35c3R9WEu5UHkalBxI/eYLf5z3e+Rv KjH6aksZrqSDb2p/C2obblCwyiNPIfOCfDhclwnOOP8PSa0bIXkk4OJ2CUkVOXCiBKnV sE2fXi2A9yGklAPIcZdVoskuP5qzlbUJh2den5bpJPwWHuyepbshiDK4jvif5MIj8hdL i+uKb71dUwTjW6fPo2A/jMPK2wl2obDgJbp5+I/KJT5EEtTvR9lKw2VCQZJVw8nwNnVO Mj4/u84iUYEmDcff157joAWPv2RW33VeDhM+zmXdekHvXxm1TmFFGUsXjfOggGu30jLD qQUQ== X-Gm-Message-State: AOJu0YzXzNQO9HLx/U8tt4sbWrViJkp0xNH7JyzlzJCo680ElZVu1+wx VYVivY41y62kcPPleEpiZoYilNahBYr1gbZOeEsmmyXuVKwNkrLRjkmHR9JbwR5WcgEeyC6h9Dn ClMOvp234yg== X-Gm-Gg: AfdE7cnSMh+93kbcoTqlpL7nTN5L7l5FO/hIFCpIxSF3Hm4fXkpSOdzIo81o00eKyqu tQtwYkVvW6Lcyums6lun9wgTUb6yZt3RaCuInGl77W+yhapAOMizztLLnPxhKl04jMT+TymD6VO LJHKwqcmlcvGYFR+nLu1g1eupSezPefejLhb3tSuqgMtxpLs3eN0ztBbNDMSo8ZrYkcpk/t9mKp YPcy4kHZdCkzDU4M8ZuyqyvT7PV8O3f2Bdb6tubi5aZm1z4peG28xl9zaWTsV2NBIm/aa8DnTXQ JSqKVHGpszicjO1FeAQbrMgZIyJCjXhVuWeOCiMXI8AnL0ljgjlwsQe1M+rex3R+G/2m5YFw9B9 1LThwr7r8lvm1h81h8j9v6c4IkHcF1IPGfGzefuRNTLPH6KdjZzl96HQE1zLbGp14Uk7/Sx2ilj eLvJiNgCmbVqngD8C2InWN5wtIXB8715km3JMWy5GxVZ6fAb9MF25oAJIj3y/IMCnd1lDLB3wvX PIGzlxkjrs= X-Received: by 2002:a05:600c:b8d:b0:493:a613:56b2 with SMTP id 5b1f17b1804b1-4954a3d0d5fmr205377895e9.8.1784623864706; Tue, 21 Jul 2026 01:51:04 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 10/16] hw/dma/omap_dma: Be more careful about overflow in transfer setup Date: Tue, 21 Jul 2026 09:50:44 +0100 Message-ID: <20260721085050.421257-11-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260721085050.421257-1-peter.maydell@linaro.org> References: <20260721085050.421257-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::431; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, 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 @linaro.org) X-ZM-MESSAGEID: 1784623960013158501 Content-Type: text/plain; charset="utf-8" In omap_dma_transfer_setup(), the maximum number of elements we can transfer is 0xffff * 0xffff =3D=3D 0xfffe0001 (because the max frame count and max elements per frame are both 65535). However, we store total element counts in 'int' variables, and use INT_MAX as a "bigger than any valid value" sentinel, and when performing arithmetic with the total count of transferred elements we are not careful about avoiding overflows. Fix these: - use uint32_t rather than int for the local variables tracking various element and frame counts - use UINT_MAX as our sentinel - calculate new packet, element and frame counter values using arithmetic on a local uint32_t, rather than doing it in-place on local variables that are only 'int' because the actual counter registers are 16 bits - use 64-bit arithmetic when calculating how much to advance the source and dest pointers and the total dma->bytes transferred Note that since soc_dma_ch_s::bytes is only 'int' this can still overflow; we'll fix that in a subsequent patch. Signed-off-by: Peter Maydell Reviewed-by: Jim MacArthur Message-id: 20260710105907.2570621-5-peter.maydell@linaro.org --- hw/dma/omap_dma.c | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/hw/dma/omap_dma.c b/hw/dma/omap_dma.c index 77f14414989..14b310bf404 100644 --- a/hw/dma/omap_dma.c +++ b/hw/dma/omap_dma.c @@ -391,7 +391,7 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_s= *dma) struct omap_dma_reg_set_s *a; struct omap_dma_channel_s *ch =3D dma->opaque; struct omap_dma_s *s =3D dma->dma->opaque; - int frames, min_elems, elements[__omap_dma_intr_last]; + uint32_t frames, min_elems, elements[__omap_dma_intr_last]; =20 a =3D &ch->active_set; =20 @@ -403,7 +403,14 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_= s *dma) __func__, dma->num); } =20 - min_elems =3D INT_MAX; + /* + * The maximum frame count and maximum element count are both 0xffff, + * so our worst case possible number of elements to transfer is + * 0xffff * 0xffff =3D=3D 0xfffe0001. We can therefore keep element + * counts in a uint32_t and use UINT_MAX as a sentinel value for + * "not set" / "condition does not occur". + */ + min_elems =3D UINT_MAX; =20 /* Check all the conditions that terminate the transfer starting * with those that can occur the soonest. */ @@ -413,7 +420,7 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_s= *dma) if (elements[id] < min_elems) \ min_elems =3D elements[id]; \ } else \ - elements[id] =3D INT_MAX; + elements[id] =3D UINT_MAX; =20 /* Elements */ INTR_CHECK( @@ -465,7 +472,7 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_s= *dma) (a->frames - a->frame - 1) * a->elements + (a->elements - a->element)) =20 - dma->bytes =3D min_elems * ch->data_type; + dma->bytes =3D (uint64_t)min_elems * ch->data_type; =20 /* Set appropriate interrupts and/or deactivate channels */ =20 @@ -528,8 +535,9 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_s= *dma) =20 /* Update packet number */ if (ch->fs && ch->bs) { - a->pck_element +=3D min_elems; - a->pck_element %=3D a->pck_elements; + /* Can't overflow: worst case min_elems 0xFFFE0001 + element 0xFFF= F */ + uint32_t new_pck_element =3D a->pck_element + min_elems; + a->pck_element =3D new_pck_element % a->pck_elements; } =20 /* @@ -537,13 +545,15 @@ static void omap_dma_transfer_setup(struct soc_dma_ch= _s *dma) * can skip part of this. */ if (dma->update) { + /* Can't overflow: worst case min_elems 0xFFFE0001 + element 0xFFF= F */ + uint32_t new_element =3D a->element + min_elems; a->element +=3D min_elems; =20 - frames =3D a->element / a->elements; - a->element =3D a->element % a->elements; + frames =3D new_element / a->elements; + a->element =3D new_element % a->elements; a->frame +=3D frames; - a->src +=3D min_elems * a->elem_delta[0] + frames * a->frame_delta= [0]; - a->dest +=3D min_elems * a->elem_delta[1] + frames * a->frame_delt= a[1]; + a->src +=3D (uint64_t)min_elems * a->elem_delta[0] + frames * a->f= rame_delta[0]; + a->dest +=3D (uint64_t)min_elems * a->elem_delta[1] + frames * a->= frame_delta[1]; =20 /* If the channel is async, update cpc */ if (!ch->sync && frames) { --=20 2.43.0 From nobody Sat Jul 25 09:48:57 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=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1784623938; cv=none; d=zohomail.com; s=zohoarc; b=WQk2QKC8smMM2kczamyRIhvpqlch5pUfNM8eT2nRvkSN9vSAkG5R0Hkq54Sx11XLDidvvZjg7uGyJbxJCOmMQ8XP3ubiILOzkiHRGOKAXQFkkqAdqdR37sXIfuN/8zrwR3qu9Q30M9XLK4iKa9x4jqchhMFc0OGTvwXIyfxp5t0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784623938; h=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=a4MdhOXFCu6xM17u7XgcNGHi/henMeTFTDgKO2L9cts=; b=jq8TDZJvlpMWigJF1LXv0b2Z6j+ON5lhAQo40fJ7sYn1JR0JTwwL8USBv4tjGe+ewPsWX5TUVsGFaZErr0Zu5JVYUT2Fl+LBjaq1vJD2tecUntg19vXvBpaa/rbzSPjAVRZK8js6ASYQUTCKChPPAwx0jFwwXaOA0+KMVc0/fAQ= 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=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1784623938230408.3721846516703; Tue, 21 Jul 2026 01:52:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wm6Bz-0005Sv-OO; Tue, 21 Jul 2026 04:51:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wm6Bw-0005Re-TG for qemu-devel@nongnu.org; Tue, 21 Jul 2026 04:51:08 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wm6Bv-0005i6-Be for qemu-devel@nongnu.org; Tue, 21 Jul 2026 04:51:08 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4954df200ddso21967805e9.0 for ; Tue, 21 Jul 2026 01:51:06 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4956537c7desm68707245e9.7.2026.07.21.01.51.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 01:51:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1784623865; x=1785228665; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=a4MdhOXFCu6xM17u7XgcNGHi/henMeTFTDgKO2L9cts=; b=ehwNAegHyDWmabC20qNHTr7UmoXGF2jFf9mrZY/+TPe53NCBQjKoy/b+q90eWi2Mpf tIzP3AmurLFkfBucYRFfpY5ICe4fwNgDDWVdJIkA05Wf7JExlphceivCmb0a8awmsAKx OUIuRL81GQAgG8ltqpk4E1QQqDtx99unfQTOcwrFPAGxj5kMaIwaF6MjygChb2LyLnAo 4Yi5MNIryuhlddaXce3w5E2aeudliOyoPVs9uR9zMVrMXUTHfWYFQ/29a9ixBaLq6wtI PqxrzWuZK9pEZwjukdVgxyw0ZcUmqOFbgIbviU+MzOnygr5x5LXL7G4OZxsDbjZiRAwn eUYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784623865; x=1785228665; h=content-transfer-encoding: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=a4MdhOXFCu6xM17u7XgcNGHi/henMeTFTDgKO2L9cts=; b=fhJBqYBfPdTRIkeHO/23+Xql+BpsS3Ew1bVx8FhiWdSPlBhjBymFaRO65MRq/Mlwnu Pkt3Eepjo+muC8tRJNooauit1Yx/mIMhrraCdkBCFPUxWJzxSBtgtrj5Y2SItL5qkwQU GsQ4DVxmH+/6kHnyAtIXQoUy6p5pJ+vee5k0P/A4wU8SDCu/oHwgYtxjKGkpHVwFDIgG zFv5vn0yhKAs+HJua8fCfO9YOo0vG31DzFjSEd+6o6HhgyVEq2w06/3JpkW4+2ZdriXk SMxCz+9qxthqgupmNEJRSTJZvCXfYGYxGR0brTWYZeDUnQpaps2xmyer1qD/7BOyt10v 72lA== X-Gm-Message-State: AOJu0YxHKT0RXHyQVO65wtPCXdaPAplXRX2yLGdrbqVRhbdePyGY3SjJ 6SOby8f0l2YUl94qsywMhP/bbebW9/dLpVjeEb3oLZK1eSUnecS3THfdcVBlSNOWuBamf+0ghSH mFK18BVKSgg== X-Gm-Gg: AfdE7cl57OVbbQC2jnbIeKfY6xoYfya6QuRvp/b6MQclQ6D7ovMqGXfb8sBT8oVASH7 xa6+5GcdAmvZ1A9qpuP/rDfD9mMQWjTpY3XXOZXjMS4YHHP8OktlesZi1/x4HvDGugyjNwcIdYi 9Rwo41W8W/A8ddF5SrGdV7nUmikmS3OyIPeDq8vtl4QBA4hAwXi9NmYSqi26we1p/4UZb/SdD6m ZxiA3hbNlbZ4DDM6IbqXR2cWLfsc809ID1XC332A3uu5VukjgeGa5N6qPYAafzhNyqRQIEbJvwh Z7USM2UUzhhXi2N7LMOWt6VA/Chkky1NJX89UKRLUm0nnJt/72UiNMZdFQiE3+rqVpEWTFP4dfN napBitE+ioZg1SZIZb+NTL6OQi6qSsbYUNJFkCCPDw6HVYVk0W5MtGMe9LNsXj7Eb2OcqUjs4fm QYKkY7RQzVcEl81IjwdR660n7U7newD+xb2mqB9OcLd2hszhI+DSjutLADWFZWQuQFn0SAdxytR lU88KVkYEw= X-Received: by 2002:a05:600c:4746:b0:495:4d07:4fcb with SMTP id 5b1f17b1804b1-4954d0784c6mr176970345e9.36.1784623865551; Tue, 21 Jul 2026 01:51:05 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 11/16] hw/dma/soc_dma: dma bytes is uint64_t Date: Tue, 21 Jul 2026 09:50:45 +0100 Message-ID: <20260721085050.421257-12-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260721085050.421257-1-peter.maydell@linaro.org> References: <20260721085050.421257-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::32a; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, 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 @linaro.org) X-ZM-MESSAGEID: 1784623939951158500 Content-Type: text/plain; charset="utf-8" The worst case number of DMA bytes that omap_dma will ask us to transfer is 0xffff * 0xffff * 4 =3D=3D 0x3fff80004, which is slightly larger than fits into a uint32_t. Move the byte count to uint64_t, and adjust code that passes it around to also use uint64_t. Signed-off-by: Peter Maydell Reviewed-by: Jim MacArthur Message-id: 20260710105907.2570621-6-peter.maydell@linaro.org --- hw/dma/soc_dma.c | 6 +++++- include/hw/arm/soc_dma.h | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/dma/soc_dma.c b/hw/dma/soc_dma.c index bbcd2bdcd56..1b93aaf5655 100644 --- a/hw/dma/soc_dma.c +++ b/hw/dma/soc_dma.c @@ -49,11 +49,15 @@ struct dma_s { struct soc_dma_ch_s ch[]; }; =20 -static void soc_dma_ch_schedule(struct soc_dma_ch_s *ch, int delay_bytes) +static void soc_dma_ch_schedule(struct soc_dma_ch_s *ch, uint64_t delay_by= tes) { int64_t now =3D qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); struct dma_s *dma =3D (struct dma_s *) ch->dma; =20 + /* + * Worst case delay bytes is only slightly larger than fits into + * a 32-bit integer, so this won't overflow. + */ timer_mod(ch->timer, now + delay_bytes / dma->channel_freq); } =20 diff --git a/include/hw/arm/soc_dma.h b/include/hw/arm/soc_dma.h index e1d75bb3baa..b5ad9743be5 100644 --- a/include/hw/arm/soc_dma.h +++ b/include/hw/arm/soc_dma.h @@ -49,7 +49,7 @@ struct soc_dma_ch_s { int update; =20 /* This should be set by dma->setup_fn(). */ - int bytes; + uint64_t bytes; /* Initialised by the DMA module, call soc_dma_ch_update after writing= . */ enum soc_dma_access_type type[2]; hwaddr vaddr[2]; /* Updated by .transfer_fn(). */ --=20 2.43.0 From nobody Sat Jul 25 09:48:57 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=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1784623968; cv=none; d=zohomail.com; s=zohoarc; b=KgxvZxTq3ZbaQuO1+a6rb6lpdgc/icrzZ9dSZL36/yujngp5s8z+dAgyb0IE39lkAbTGuO0iKeQSXFHW9hB31gnHrLMZLINuzbbzUu3jteB3r0e/IsqttJx7sIDNpm7PWQg8Y9pK3tpjiYIjIewr3CfwEBj0tCdv5HHjiANP+cI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784623968; 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=wPrsV4wAJyGV760kc6/AjOJs1U2QCwOhs/FYcCXkgfM=; b=LCZ3238mi575Pz/JL8wV+z5lxO9iL4+xa6pUs2Jx8wPAS6aEUhr1VJkJ5e7jMR0qvSLLHiI51sOdFCiNGwkLN3eI6STLixxJL2ub27IIEV2EeLNevwJEkpuq5nvJB/nEw262GVZj0AC9HxUPoKKKXwWX5a4lM/YF7m4pw2dcS/U= 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=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1784623968422962.2558759647669; Tue, 21 Jul 2026 01:52:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wm6C3-0005Tr-PR; Tue, 21 Jul 2026 04:51: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 1wm6Bz-0005SL-3q for qemu-devel@nongnu.org; Tue, 21 Jul 2026 04:51:11 -0400 Received: from mail-wr2-x00.google.com ([2a00:1450:4864:30::]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wm6Bw-0005iS-91 for qemu-devel@nongnu.org; Tue, 21 Jul 2026 04:51:09 -0400 Received: by mail-wr2-x00.google.com with SMTP id ffacd0b85a97d-4700bd8aed1so879752f8f.1 for ; Tue, 21 Jul 2026 01:51:07 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4956537c7desm68707245e9.7.2026.07.21.01.51.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 01:51:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1784623867; x=1785228667; 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=wPrsV4wAJyGV760kc6/AjOJs1U2QCwOhs/FYcCXkgfM=; b=VKSPFOPdAChja9nCU9BssIPW2LTd3H0K8ZJOAPhqSeo1Z2n0VBJ4L+XAZrjswga5Dq Ljr73+Jq5woOozotpx6WAUcqM1pzMo2UBqnyCvS5kDHwRxXmls8ZYRpnOQfRGVQH8Xhu LJ3viLzsikfa71bbniHPJ2SbUlFt9/EDo/LxPxLu9q7p5Skl6Xvpwie6qZ5lrdKIH90o 2Lgaq7AoAjYQKnyNpIQqgm4JYD48b3XNzhAzgtcAnS3teThCpUw1T8LBYTImpTbREhCM te014lIdUepLHSQo2Wcjr6RA0yZnDrOyiVAWZuZCEqeiuYg3QFg7wB3eRE0NjctSfZFc xGAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784623867; x=1785228667; 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=wPrsV4wAJyGV760kc6/AjOJs1U2QCwOhs/FYcCXkgfM=; b=G0boLkc4kYE6YqLtz7reZb7cpe+pQfCHElabIFxr2ZA5pZdKx+ustty9QsICGLjo7Q 5vkNrDTEsZ+Et/0UAI5Q02Ke58Kzh/SQ7Bn7puPzROjn7rJyBLyuDw9pHM8QPYNkEPuO wyuaRJcY18FBt50DYA8lbhrYMGb8/jG7lJVjygYxw3qy9hR37hfVOBAfP632uyHS2oTD w+1+W2WDj4eKIOimUyNlEKRXibqkUFf9n6kXdhjN8/z6waLEUabB0odhrkthTzdvTbFr Yly6hmxVggt3YJk/urij/km4YURzhdxscza0czxo7SWQvRB+j73OwES/WWXYNRU8y9o/ nK6Q== X-Gm-Message-State: AOJu0YwhNoHgJ8WPCCa2ViQyf1Hy4UK64XGqcETOnR86in7tksveWTbB ulHTgFAT6waqh2EaHkvKopyXrhM/T6Tqw1D0YBYjHql0z7lrWlPPZHlTUlpRR6fEoVq/qDtCeRY Z1jvfbZutZb26 X-Gm-Gg: AfdE7claSut61zzN3mogzAIBFU8Ner1GvgzHY4rK9vVMbOxZMolm1UPvUy7ZEJNfJxK XcOWjWZhUMNT82H0AWyEcITyXrgXJn7mXell9kM9pikmQtco25s9JUYteHkNJwNenlZEuMirPTb cwyd8gRQEvo0OxBqwHG2l19gbZxAwza6a2Uif38ezVWsSxA4fyjevUZYk8F/uSeAk0q2u2vUzrx G4YgNpPgJWWTYQOVc23a5LZ4gK50HHWENGml0oyC1T4ocD5yYbgoZcjUS3KBiqRNKB4fg1ndHjS 2TlHMx9UxHEX5yzW4MxNGVApeEkDOnMDLctjTE2LIyOyQDrM7bbnJxkoDkwHp7AyhcAq0gnbXnd OkW22nu9R05Sk3NEyWAIcFdHi8QuISJ5moxlWqMCn+8cqABL2/IXyATIpYsxSpGt1slNFKXsrQm DrzI0D0lbMJSLa/XXk1ehA18T2LvIqhb+mYXcMvV6pvatb1BUiy5RnvoivCALwlLSJ5rao4sDtZ O95oEbtV0g= X-Received: by 2002:a05:600c:3b88:b0:495:495f:bc30 with SMTP id 5b1f17b1804b1-4954a3391femr195729495e9.12.1784623866445; Tue, 21 Jul 2026 01:51:06 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 12/16] hw/dma/soc_dma: Use physical_memory_map() for mem2mem transfers Date: Tue, 21 Jul 2026 09:50:46 +0100 Message-ID: <20260721085050.421257-13-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260721085050.421257-1-peter.maydell@linaro.org> References: <20260721085050.421257-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:30::; envelope-from=peter.maydell@linaro.org; helo=mail-wr2-x00.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, 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 @linaro.org) X-ZM-MESSAGEID: 1784623970310158500 The soc_dma code has a fastpath for when DMA transfers are from RAM to RAM. The current implementation of this has the caller of soc_dma_port_add_mem() pass the underlying host address of the RAM block that the DMA port is connected to (obtained via memory_region_get_ram_ptr()). Then the actual transfer function does a simple memcpy(). This has several problems. Most importantly, no bounds checking is done on the address and size passed by the guest, so the memcpy source and destination might be outside the backing host RAM entirely. Secondly, because the DMA access is done via this back door, there is no updating of the dirty region when memory is written this way (there is a TODO comment in omap_dma.c noting this). Fix both of these by making the memory to memory transfer function use physical_memory_map() to get the host addresses for the memory copy. That function will automatically give us the bounds check that we want and return a short length if the transfer would run off the end of the RAM MemoryRegion it starts in. Since the OMAP DMA documentation states that it's a guest error to misprogram the addresses so that they fall outside the range that is valid for the particular DMA port being addressed and that this can result in guest memory corruption , we don't need to loop for short transfers, but can simply log them and continue. Note that we don't need to update addresses or bytecount here in the transfer function, because when soc_dma_ch_update() selects transfer_mem2mem it also sets ch->update to 1, which tells the omap_dma_transfer_setup() code that it is responsible for updating all the guest visible fields to match "transfer completed". (We use physical_memory_map() here to match the use of physical_memory_read() and physical_memory_write() in omap_dma.c; making the DMA controller use an explicit AddressSpace would be a separate cleanup task.) Together with the preceding commits that fixed some integer overflow problems, this fixes the "guest can provoke a bad memcpy() operation" reported in issue #3204. Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3204 Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20260710105907.2570621-7-peter.maydell@linaro.org --- hw/dma/omap_dma.c | 5 ----- hw/dma/soc_dma.c | 51 ++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 48 insertions(+), 8 deletions(-) diff --git a/hw/dma/omap_dma.c b/hw/dma/omap_dma.c index 14b310bf404..1a3ae747269 100644 --- a/hw/dma/omap_dma.c +++ b/hw/dma/omap_dma.c @@ -559,11 +559,6 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_= s *dma) if (!ch->sync && frames) { ch->cpc =3D a->dest & 0xffff; } - - /* - * TODO: if the destination port is IMIF or EMIFF, set the dirty - * bits on it. - */ } =20 omap_dma_interrupts_update(s); diff --git a/hw/dma/soc_dma.c b/hw/dma/soc_dma.c index 1b93aaf5655..6e325122d9e 100644 --- a/hw/dma/soc_dma.c +++ b/hw/dma/soc_dma.c @@ -20,13 +20,58 @@ #include "qemu/osdep.h" #include "qemu/error-report.h" #include "qemu/timer.h" +#include "qemu/log.h" +#include "system/physmem.h" #include "hw/arm/soc_dma.h" =20 static void transfer_mem2mem(struct soc_dma_ch_s *ch) { - memcpy(ch->paddr[0], ch->paddr[1], ch->bytes); - ch->paddr[0] +=3D ch->bytes; - ch->paddr[1] +=3D ch->bytes; + /* + * Memory-to-memory transfer: do the whole thing in one go. The + * hardware spec says that it is invalid to program the OMAP DMA + * controller with addresses that don't match the port (i.e. to + * ask for a transfer to/from a memory port with a physaddr that + * isn't within that port range) and that if you do then the + * transfer continues and memory can be corrupted. So we can map + * both source and destination, and treat short mappings and + * failed mappings as a guest error. + */ + hwaddr srclen =3D ch->bytes; + hwaddr dstlen =3D ch->bytes; + hwaddr srcaddr =3D ch->vaddr[0]; + hwaddr dstaddr =3D ch->vaddr[1]; + void *srcmem, *dstmem; + hwaddr xferlen =3D 0; + + srcmem =3D physical_memory_map(srcaddr, &srclen, false); + if (!srcmem) { + qemu_log_mask(LOG_GUEST_ERROR, + "soc_dma mem2mem transfer: could not map source; " + "guest error programming source port/address\n"); + return; + } + + dstmem =3D physical_memory_map(dstaddr, &dstlen, true); + if (!dstmem) { + qemu_log_mask(LOG_GUEST_ERROR, + "soc_dma mem2mem transfer: could not map destination= ; " + "guest error programming destination port/address\n"= ); + goto unmap_src; + } + + xferlen =3D MIN(srclen, dstlen); + if (xferlen < ch->bytes) { + qemu_log_mask(LOG_GUEST_ERROR, + "soc_dma mem2mem transfer: could not transfer all da= ta; " + "guest error programming src or destination addresse= s\n"); + /* Continue to transfer whatever did fit in the port window */ + } + + memmove(dstmem, srcmem, xferlen); + + physical_memory_unmap(dstmem, dstlen, true, xferlen); +unmap_src: + physical_memory_unmap(srcmem, srclen, false, xferlen); } =20 struct dma_s { --=20 2.43.0 From nobody Sat Jul 25 09:48:57 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=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1784623928; cv=none; d=zohomail.com; s=zohoarc; b=es/VQCo1khTQqUzeq8Wgsu2/GVyy40Xgrz2sil5us/2BodHwgyAF/GG86FoexTQDjp0BtuD/+3ytGjpMEOHVXhNqoLjIup3u8zebfGBBXAH6N8oLRBaA4ETPcaPEd4CqcjH9X2NN+lPjBtv5TNSM9pJ2eIYV3a9WpDZSCwiLs2g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784623928; 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=ZIBpVhCtB4kCVzqzRgaDhWrdDjmNisBtYqwZMNexmQg=; b=evDCwXnclFlI/9/NzR1TZU//rM8EfaAd8suhMk0TxNpGLTV3DQaFR6ZUhsRrPcuB2XCdLvxJpTFqhytxu4BIz20Be7zi4YlCqpeVv3ZKxVGBHLebNLPIene+YJ7+f3XKX9EUulDQ6tvACD3UaHtu9KbVCfHaGrw/xd4SH0i9bSE= 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=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1784623928276816.6482909338606; Tue, 21 Jul 2026 01:52:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wm6C4-0005Tz-5j; Tue, 21 Jul 2026 04:51:16 -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 1wm6Bz-0005Sr-Iz for qemu-devel@nongnu.org; Tue, 21 Jul 2026 04:51:11 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wm6Bw-0005ie-W7 for qemu-devel@nongnu.org; Tue, 21 Jul 2026 04:51:11 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-49546c690ffso30921035e9.2 for ; Tue, 21 Jul 2026 01:51:08 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4956537c7desm68707245e9.7.2026.07.21.01.51.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 01:51:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1784623867; x=1785228667; 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=ZIBpVhCtB4kCVzqzRgaDhWrdDjmNisBtYqwZMNexmQg=; b=CDlIE/dbZ7KZua6HqppgYVpGRrUAlbzHvmJCLLagPOP/6z2KNaU6gfAvsPzmKM3O3s R546LvlnQxQPzWsm0CHhNLfzOcDm5QgXbhrxH88UMCO7ewZZLA91MgkWbVTGziyWAJwH qdJ3SmxnSeotraZQ0ekNM4Krbl9f0soCBbcGc7AGsln/UspEopBHvU8tynqIfw91dn3b vRG/tlpJwZJ3UFnChvjvZ4R5n0WWPAkDw4fFm8MzJcEnGw+PUjiRU5TMaJXwDq8JgERt aLU1pxgiAIBln0J5DMnPK6WbKfee+mtE4Nz10gHDJg83yogSYm+P5jjSEaK/ZVCGM1XJ v4TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784623867; x=1785228667; 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=ZIBpVhCtB4kCVzqzRgaDhWrdDjmNisBtYqwZMNexmQg=; b=EOvCUT6wUTEU+DNcqJt3oZP9iqEoqLsX35xuIdRPlopmupZ2k8y/1t/j+bWFnfZ/O2 gweiPWkfAjjk6hJPBuB7N/nQzvX+Tn4QLj2rhoK/s8V15srKs+kjhuMlpr5HFadlZZsN 5brJw9xg7UFEhQ3Io1b48l9tAnYG9x77Mz5gbT5zXx7AcxVOgblOgXZHBxxLC0AzYHS0 O6xRH7SlQ1bhtVUIkKPpnVcH2Fdpa1YFlctCEHkUu11WYuXH4cLU21yEdfOKQ1ojcwzh AZzS0b9rXuYOAarr0b0rA7E0otYM094DhNLZoBk1/YbCQ63DoxT0ZwXbqrmTq9wiq8K2 uq7Q== X-Gm-Message-State: AOJu0YxQ1l2dcqYDI+gN5iueT7aImK1enINLg5akquff5BZEmdxRrA7o J4D+VLoa0lGt20CppCque8Qg1N0CnE/j4wky0i3VLcdzU1XPSv3NwTncJ1d6Ys3nR+pqZ5breCm TNYLytQ1MZQ== X-Gm-Gg: AfdE7ckM7+oQUC463gMPDLDESkvEdL8ncSxFU5QVNTnJiUbGp+VZSYquruJchM1TSt2 5Ioz5f8HfmwXa6/N2D44uRnAN1eEEPPIpq8r0K6Os06OXdswSVZA29j83O6y58f5QbZEgJydzGW 9ZGUgnGb0pprmu5+8OBq7QfKw1yd2nAxRK7VfeFw6DUu1Zo1RsvgiQxANZbxysVgAcnVfcpYRSb iOAoUYo9/IPplr8Jlx8uiJrxG7kw5HtkHDwupiZ+5Vlp5iKR9kCDKa6kg8txJ/prHExY3FXJcEg JnhaWCXBY73X7AegyyvTQ/9nuvS/ONwUQIEocS9gSi4BS+Pec+ZMV0rKJLhtlW7Prtx3DtgmycB O+oDgRaV92EblIlY88/Z/5z46HdGDPXah3AZ6LlXQ5iOFGbTJHdue0FKBDua5kHOKzv6uKWlhN4 E+0RqUQSCWPmWDGgVsnHEDapl9ntEf0fDJN09G9D28DVbHleDQEpRegrAATwU6Du6YTVDZ+DUdf UXxHdgyTk/rFBhxl5fsAg== X-Received: by 2002:a05:600c:3113:b0:495:61aa:523c with SMTP id 5b1f17b1804b1-49561aa56admr64056595e9.17.1784623867484; Tue, 21 Jul 2026 01:51:07 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 13/16] hw/dma/soc_dma: Remove unused mem.base, paddr fields Date: Tue, 21 Jul 2026 09:50:47 +0100 Message-ID: <20260721085050.421257-14-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260721085050.421257-1-peter.maydell@linaro.org> References: <20260721085050.421257-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::331; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, 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 @linaro.org) X-ZM-MESSAGEID: 1784623929987158500 Now that transfer_mem2mem() uses physical_memory_map(), the soc_dma_ch_s::paddr field is unused; remove it, and the code that set it, and the memmap_entry_s::mem.base and the soc_dma_port_add_mem() phys_base argument that were passing around host pointers to use for setting paddr. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20260710105907.2570621-8-peter.maydell@linaro.org --- hw/arm/omap1.c | 6 ++---- hw/dma/soc_dma.c | 9 +-------- include/hw/arm/soc_dma.h | 7 ++----- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c index 44f9dd67c36..9e739a07122 100644 --- a/hw/arm/omap1.c +++ b/hw/arm/omap1.c @@ -3799,10 +3799,8 @@ struct omap_mpu_state_s *omap310_mpu_init(MemoryRegi= on *dram, s->port[tipb_mpui].addr_valid =3D omap_validate_tipb_mpui_addr; =20 /* Register SDRAM and SRAM DMA ports for fast transfers. */ - soc_dma_port_add_mem(s->dma, memory_region_get_ram_ptr(dram), - OMAP_EMIFF_BASE, s->sdram_size); - soc_dma_port_add_mem(s->dma, memory_region_get_ram_ptr(&s->imif_ram), - OMAP_IMIF_BASE, s->sram_size); + soc_dma_port_add_mem(s->dma, OMAP_EMIFF_BASE, s->sdram_size); + soc_dma_port_add_mem(s->dma, OMAP_IMIF_BASE, s->sram_size); =20 s->timer[0] =3D omap_mpu_timer_init(system_memory, 0xfffec500, qdev_get_gpio_in(s->ih[0], OMAP_INT_TIMER1), diff --git a/hw/dma/soc_dma.c b/hw/dma/soc_dma.c index 6e325122d9e..ff890149ee8 100644 --- a/hw/dma/soc_dma.c +++ b/hw/dma/soc_dma.c @@ -85,7 +85,6 @@ struct dma_s { enum soc_dma_port_type type; hwaddr addr; struct { - void *base; size_t size; } mem; } *memmap; @@ -154,10 +153,6 @@ static inline enum soc_dma_port_type soc_dma_ch_update= _type( if (ch->type[port] !=3D soc_dma_access_const) return soc_dma_port_other; =20 - ch->paddr[port] =3D (uint8_t *) entry->mem.base + - (ch->vaddr[port] - entry->addr); - /* TODO: save bytes left to the end of the mapping somewhere so we - * can check we're not reading beyond it. */ return soc_dma_port_mem; } else return soc_dma_port_other; @@ -245,8 +240,7 @@ struct soc_dma_s *soc_dma_init(int n) return &s->soc; } =20 -void soc_dma_port_add_mem(struct soc_dma_s *soc, uint8_t *phys_base, - hwaddr virt_base, size_t size) +void soc_dma_port_add_mem(struct soc_dma_s *soc, hwaddr virt_base, size_t = size) { struct memmap_entry_s *entry; struct dma_s *dma =3D (struct dma_s *) soc; @@ -293,7 +287,6 @@ void soc_dma_port_add_mem(struct soc_dma_s *soc, uint8_= t *phys_base, =20 entry->addr =3D virt_base; entry->type =3D soc_dma_port_mem; - entry->mem.base =3D phys_base; entry->mem.size =3D size; } =20 diff --git a/include/hw/arm/soc_dma.h b/include/hw/arm/soc_dma.h index b5ad9743be5..fdae7a29c2e 100644 --- a/include/hw/arm/soc_dma.h +++ b/include/hw/arm/soc_dma.h @@ -53,8 +53,6 @@ struct soc_dma_ch_s { /* Initialised by the DMA module, call soc_dma_ch_update after writing= . */ enum soc_dma_access_type type[2]; hwaddr vaddr[2]; /* Updated by .transfer_fn(). */ - /* Private */ - void *paddr[2]; =20 int running; soc_dma_transfer_t transfer_fn; @@ -83,7 +81,6 @@ void soc_dma_set_request(struct soc_dma_ch_s *ch, int lev= el); * calling soc_dma_set_request(ch, 1): * ch->type[0...1], * ch->vaddr[0...1], - * ch->paddr[0...1], * or after a soc_dma_port_add_mem(). */ void soc_dma_ch_update(struct soc_dma_ch_s *ch); @@ -92,7 +89,7 @@ void soc_dma_ch_update(struct soc_dma_ch_s *ch); void soc_dma_reset(struct soc_dma_s *s); struct soc_dma_s *soc_dma_init(int n); =20 -void soc_dma_port_add_mem(struct soc_dma_s *dma, uint8_t *phys_base, - hwaddr virt_base, size_t size); +void soc_dma_port_add_mem(struct soc_dma_s *dma, + hwaddr virt_base, size_t size); =20 #endif --=20 2.43.0 From nobody Sat Jul 25 09:48:57 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=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1784623940; cv=none; d=zohomail.com; s=zohoarc; b=NC9/bffXiCiKlTmNvo+wwFTZSMAD1h9G+AeXVLPZOqE5QbHVUAMNZiM79sbVak1DNRhuutZiDY9Lug8YK87lj7TyDJTnLnbkdWofDq6fnc4tC2ixnW1X2jgq6VB60lkyAg5najAsHFvb5AkhFT+N7oTR/RreMlzbDvLKiKbAuhE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784623940; 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=wnFuMaGFc/9sU6GfqW0ud+aPvT0FGc61xYGm2SDQqU0=; b=JHBRa3sKDznWGGJDnJg18oedESLSshILI3jsA73YhGul9343jEPu2b/AR8C7nNGQozbLejkADpcUddHlheJ9MO/wwxOPNFl5VLB9kD6dafjukkJ5y542EWmHMjA07nseAPkAyWSjE6NFbA5CI2wyWqX/D8H9S4w3FRuleduv6BI= 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=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1784623940878741.0973053890675; Tue, 21 Jul 2026 01:52:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wm6C4-0005Tv-3Q; Tue, 21 Jul 2026 04:51:16 -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 1wm6C1-0005TQ-Hz for qemu-devel@nongnu.org; Tue, 21 Jul 2026 04:51:13 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wm6Bx-0005in-Mr for qemu-devel@nongnu.org; Tue, 21 Jul 2026 04:51:12 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4953e04ef16so51609135e9.2 for ; Tue, 21 Jul 2026 01:51:09 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4956537c7desm68707245e9.7.2026.07.21.01.51.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 01:51:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1784623868; x=1785228668; 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=wnFuMaGFc/9sU6GfqW0ud+aPvT0FGc61xYGm2SDQqU0=; b=ZIBfJrVa/zjUdNv6MLWBgG/iTT+ogkBASBnak/JGoGyMVWz/6IUZWlW13VmeN0IUup 57VlV4tOlOV0YpWjcjajpyLPyJcwbjtHgpx/ujhHsSrHmA93i3pbKkHDXWxZQU/6Sfdh EIS7ARFjngWCYSQEEis7hBXRVfISaRVUOS7rEwrsu0AAwXO9hGcmvlZ7dSxIGzESABMe p8tZXOH0/7SQOSEHlfzo8rP7UMKrPOMvVpfXYbFS97kC+lnL0RTFEHFhev/84Yl5RH1k yn+k49b+es1YvWtqxXWyFpsEO45+6nZQ1pYTqbrtElatmaDyJ2YlVAnLP9VY38g+pCaS lREw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784623868; x=1785228668; 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=wnFuMaGFc/9sU6GfqW0ud+aPvT0FGc61xYGm2SDQqU0=; b=DLFBw+n0PAC64+GLvdmRGHDhKh3MPg/arnY2UXCSlVicVuqs5JY8vtvIxtGcg0FwZU NWS4ZYuLQ9ukS4hJuAMAt8IJUOuhYP5gIk0rIlFC0r3Pys6PoXMJ4F510jyySiUoD3Iz ja7+dxTyeAxUULfme0b4WGrAAHBfS3iGoVrthyQ8EEiB8wucz452gY18es/eHr88FIt8 VrUR/MIjq1CZDpSJ0STcQ4dJ3nWSBP03/yudYWqKAWqRYQOUveSVj6SyG4TF8iGmy9Ec 0RxvqyhnX0qFPcnbQ0q4FYgYrSwPYJd7HSuWAgODq/sr1pQOE+fqinqWIuVnJdjhCzoA kzxA== X-Gm-Message-State: AOJu0Yz7uM4NT92hYnNgMVFSv7SLrnOVis3vJPCKZX+lizx0DkUwyJ7H PJPJpP2miIqf+Zo5uvnIrwMQ7x1u/oAqSrvlZLayta8kNherJ7uuLQlyPJVte6S5tqUcFw1rHvN kB2V1CVjeew== X-Gm-Gg: AfdE7cnVH5MD3LbKmd9vdx39DiTZ/7yJyh9gRVsePC5cOmI1on1S/1TkzuRZfBbantG J+0DDcRw9qDF2hewBz4+VatBBpL/SpAry3VBfvB0J3Ca1BUw8aQWlnioUUPxu+xmoY1aUo4ktg6 blWERe00IQDVMmbdTwPrJYBx25YDMvjEAyAH+bvqJppnVarKREDJoBlL9gyuuFRANeXyfsP+JDH 5tOf5vDiEMPiWlkTJB0Glhjlra2Fvabbuzm2tTU/NtsUzhQFHG3OwW3B9SwOTda7mW0DuHdi/eL 6sPUQPgK/aimz3xnAcgJJ8QA0D0X/8/oFF5uXw/V804RbUND/WnL6zy1Q7LyizuBOfDU7U9pVHG TWp8Dya2ObFymWZsHdQFW7vBI8kYsFCGC44lQdWjKTrrJEjGscGpUwlLIUwn7O8WzoF1ThkSd7E FyYTB29mUPuSWYNe1up9g+fqqal5XlWoCV9b75bv2CW2ZsVaU8bT3vM9cNCYvtx/BVOs3EP4GB8 Z3v1dNRL8E= X-Received: by 2002:a05:600c:4f92:b0:495:f31:7340 with SMTP id 5b1f17b1804b1-4954a3d06e4mr188805355e9.5.1784623868302; Tue, 21 Jul 2026 01:51:08 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 14/16] include/hw/arm/omap_dma.h: Move to include/hw/dma Date: Tue, 21 Jul 2026 09:50:48 +0100 Message-ID: <20260721085050.421257-15-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260721085050.421257-1-peter.maydell@linaro.org> References: <20260721085050.421257-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::32a; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, 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 @linaro.org) X-ZM-MESSAGEID: 1784623941914158500 omap_dma.h is the header file for hw/dma/omap_dma.c; it fits better to put it in include/hw/dma/ to match where we have the .c file. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20260710105907.2570621-9-peter.maydell@linaro.org --- hw/arm/omap1.c | 2 +- hw/dma/omap_dma.c | 2 +- hw/dma/soc_dma.c | 2 +- include/hw/{arm =3D> dma}/soc_dma.h | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename include/hw/{arm =3D> dma}/soc_dma.h (100%) diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c index 9e739a07122..0f78cbd4104 100644 --- a/hw/arm/omap1.c +++ b/hw/arm/omap1.c @@ -32,7 +32,7 @@ #include "hw/sd/sd.h" #include "system/blockdev.h" #include "system/system.h" -#include "hw/arm/soc_dma.h" +#include "hw/dma/soc_dma.h" #include "system/qtest.h" #include "system/reset.h" #include "system/runstate.h" diff --git a/hw/dma/omap_dma.c b/hw/dma/omap_dma.c index 1a3ae747269..16575e73b78 100644 --- a/hw/dma/omap_dma.c +++ b/hw/dma/omap_dma.c @@ -22,7 +22,7 @@ #include "qemu/timer.h" #include "hw/arm/omap.h" #include "hw/core/irq.h" -#include "hw/arm/soc_dma.h" +#include "hw/dma/soc_dma.h" #include "system/physmem.h" =20 struct omap_dma_channel_s { diff --git a/hw/dma/soc_dma.c b/hw/dma/soc_dma.c index ff890149ee8..4feb22e6ea3 100644 --- a/hw/dma/soc_dma.c +++ b/hw/dma/soc_dma.c @@ -22,7 +22,7 @@ #include "qemu/timer.h" #include "qemu/log.h" #include "system/physmem.h" -#include "hw/arm/soc_dma.h" +#include "hw/dma/soc_dma.h" =20 static void transfer_mem2mem(struct soc_dma_ch_s *ch) { diff --git a/include/hw/arm/soc_dma.h b/include/hw/dma/soc_dma.h similarity index 100% rename from include/hw/arm/soc_dma.h rename to include/hw/dma/soc_dma.h --=20 2.43.0 From nobody Sat Jul 25 09:48:57 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=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1784623941; cv=none; d=zohomail.com; s=zohoarc; b=QXKgZikLnvhOJFCElEwBh1P6oI8Mc+icf5y+cHEb/9qT3pYvzCusNkbvqDBLosbV9VPyLKtnfLcgVD8w9bs0eOQqZ4etP+aJ/A6eQxPRoFgZm42HYlUP6f7YF9h6/FioVej5q+mX+A/l+hc8mMUq00eN965yHQ1krNcStNhGFzU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784623941; 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=hbE+1TFJ2PollExrCKISYsmaeN1UnHb+b/ard1c1p80=; b=QQsRIbz9ePobbYpjGZqscih2amLeQEooCEpga6ZOs1oSGZziP1NjKoKgfyBhR6EOh9psYr9m6HEuLsEyl8xk5xYM9PazfmouIde2WZkvYvjco53C5jyC/pE3XDGDql2St2o6VppEvBVuGbAra0wzyqjBOmNH/s349j4L8Ug3FwU= 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=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1784623941352265.16662828891504; Tue, 21 Jul 2026 01:52:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wm6C8-0005VC-Pq; Tue, 21 Jul 2026 04:51:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wm6C1-0005TR-IW for qemu-devel@nongnu.org; Tue, 21 Jul 2026 04:51:13 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wm6By-0005iu-Ri for qemu-devel@nongnu.org; Tue, 21 Jul 2026 04:51:12 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4954dff6536so23961215e9.0 for ; Tue, 21 Jul 2026 01:51:10 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4956537c7desm68707245e9.7.2026.07.21.01.51.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 01:51:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1784623869; x=1785228669; 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=hbE+1TFJ2PollExrCKISYsmaeN1UnHb+b/ard1c1p80=; b=WszsefPiXEOJaNxHP7MVtzpa9XziW6XcH3EVv0V7TqJcNwfDFJk8eDf56Dh0KPUFSX SCQN8Xb/wJsZdzzskE20Z6Qh3r9TDJ/c8V2sXAYXxg+Mlc0+JiG7oJjxBergpQIw1cSz PwbptvPffcwmAwHgsTjmup0Vwoxc6oy0xntTI3cDCQbfkn6Nkiyi0jPtohg7Hfo23N/n eRTUPC09Gj7ZU+P4EmG4Gf8qf9rQknr1vj8xf84SFiBm4ZK1zS6XKxXR3o/i46cg4W/T QoJlZmiLb9l2qTvB6YoXl9b4+cac3sc+8XmWNGVj5U9QVzFLByA54uNn69V6tOVasbL6 30tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784623869; x=1785228669; 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=hbE+1TFJ2PollExrCKISYsmaeN1UnHb+b/ard1c1p80=; b=Hgx58lqJCNLOGiHb/P7hHEa+DESUagWqT2SKkD3d/CMH3MF7AF7vfPnl+FDsFv/q2d jTFwqes5e7RBGBDb1o88B9gRmbxvKtwS/7RJlo7bLSZ7QV66wwJamEKoWnvC1tXCFIzL gtYiz3ItNxXMQ8lLSSyNQZpvXnMGJuA4Spgkdr8AW/gZ0IFnOxMfHRpsXV87iLWhj5s9 IMmbNO46SDSPAO13LPfgRk6e7weSN1H4mY2iX7Nx2LEuXuHXc2Jh2GO3MTFrYrGeMJ3Y etxDu6yPbKBiVn73w67J+S6Kv2h53qBmTdYrZL1k8/Ix1sslc9T4etRA5g279INYKd+G golw== X-Gm-Message-State: AOJu0Yy3ImqW8XazL57onS1iDTK9LXISIZxnWyQ2No7i1It7ASeaKFbu MjdyJmTci8zxIpfrPxiuw8i8rO94bArYe0dhcLOJVgPCoIksA/CpDNWlCqDWc7aqaGdhvUSksFZ tCdeVwc14sw== X-Gm-Gg: AfdE7ckPo1e5Fi8i26v9Uf2evfn6euvqMq0U7QFZdw0NSbybGnSpMyS64goVc+AL5BF 40tgNAT7dB25pdnxZlZ0wRRBWcc21P9J7Z2YUCaHvoVlmHStWhm9p2W/w6GiJ6j/hqYRSnjojQX TGsQj8qI9hdcdNnXtFJnKolj6P87/V0pai1tiy6BLyHXla6d/ahUx0JBlpV24uHDLW11aanxhXN 0WkoH2KPVeab2gyKpqAabtL8cr0YXUXNRHCXfwaowzCBKUAqxGHrmhL7GZfOYuIvG+kcx2asSO8 Eyph++3AXNqtgawD9ONwhUySmPh/D8lF/OJ7/epGMOc2vlSCDHmPZq4e5rDUqnfpMOroXtJwIQF C3aSZiAtNnMQoegA46kB0270W3zZqlQLARtY9Rt9AKFhYBtreweiIBGbnEdedmVSwoQROaTSZ6i 1dg2wVXk7F7ju3zU/WCG+2DiF7uyr/faI3VfgmMWd4WmDRHdntSfX+obrz6Kwgcii9Iqg1Om0Xz 4aAPpE+lsU= X-Received: by 2002:a05:600c:3b8c:b0:495:5039:391c with SMTP id 5b1f17b1804b1-495503939b1mr165187515e9.26.1784623869221; Tue, 21 Jul 2026 01:51:09 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 15/16] MAINTAINERS: Add soc_dma to OMAP section Date: Tue, 21 Jul 2026 09:50:49 +0100 Message-ID: <20260721085050.421257-16-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260721085050.421257-1-peter.maydell@linaro.org> References: <20260721085050.421257-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::32f; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, 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 @linaro.org) X-ZM-MESSAGEID: 1784623941936158500 The hw/dma/soc_dma.c code appears to have been written with the idea that it abstracts out DMA transfer operations from the details of a particular DMA controller device. In practice, it's used only by the omap_dma code and I would not today recommend trying to use it in any new DMA device. Add the files to the OMAP section of MAINTAINERS so that patches can be cc'd to the appropriate places. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20260710105907.2570621-10-peter.maydell@linaro.org --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 74fc43f5f20..a28935c8986 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2205,7 +2205,9 @@ M: Peter Maydell L: qemu-arm@nongnu.org S: Odd Fixes F: hw/*/omap* +F: hw/dma/soc_dma.c F: include/hw/arm/omap.h +F: include/hw/dma/soc_dma.h F: docs/system/arm/sx1.rst F: tests/functional/arm/test_sx1.py =20 --=20 2.43.0 From nobody Sat Jul 25 09:48:57 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=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1784623951; cv=none; d=zohomail.com; s=zohoarc; b=QTPS6tyhLquLUWw6U6QCKZYKx4N5SKWxgQyUw0dGXBfUlLdt4MNHhDzHCZXceN5aEg/tz3ZRHJNjZf/qXnc43byTbLNYH9xAz0M+iGm09ie3jtCRcCNE4uOD0+erDZwNAwDDj7bYUvqF5QFgZhqNUgVubE2PUQZH9Oqd6gbuaAI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784623951; 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=bR4BTeae6fNCOYDibcfJEvLoEeC7E2KT02d4gc9TIoo=; b=jrhsv252Hg4uxwbFC+sG9GD1KmW6oKSSJOYuzTLg/Vo95+MmfvGhsrz5v1rQy/RNgiLIw8dNJPcan8gRh7KQmkmnUr8Lrgv7dAygdnzP9mkj7K3eWSEBLpu0Q8WpDhIzg8tNKWLzNFIx8DYyESKCTyog2vzWunX3BrIScxSAhkI= 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=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1784623951799573.3410860506942; Tue, 21 Jul 2026 01:52:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wm6C4-0005UR-JM; Tue, 21 Jul 2026 04:51:16 -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 1wm6C1-0005TU-N8 for qemu-devel@nongnu.org; Tue, 21 Jul 2026 04:51:13 -0400 Received: from mail-wm2-x09.google.com ([2a00:1450:4864:31::9]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wm6Bz-0005j0-LO for qemu-devel@nongnu.org; Tue, 21 Jul 2026 04:51:13 -0400 Received: by mail-wm2-x09.google.com with SMTP id 5b1f17b1804b1-49553b57612so5577895e9.1 for ; Tue, 21 Jul 2026 01:51:11 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4956537c7desm68707245e9.7.2026.07.21.01.51.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 01:51:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1784623870; x=1785228670; 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=bR4BTeae6fNCOYDibcfJEvLoEeC7E2KT02d4gc9TIoo=; b=GZ/p56hqKhFElzo9Nbs10pf5ObvIdkaVtVjEN1rl2WvkX32MQqgGLUDpWS7sil0yiv nzqYZeeJm8ubuxFZLSZ4ocbPJsp4S8oKBDoiDoPUD3FINmhbjsaD2SA92y+rn4Zw8FML hRPO6edNV2FaVe+3kT8doWhP5qVKODWpp13gQoaPuVTMhxwMQHfCa84byrdFjViZMGFI 0ihI2v7WfUOq/LPZeJ0Fw/Yda/DjcV89vdxildPMVg6bRuI9b1lnecUFR9V/w8WE+e7C euMlwp80+ONr77lfQYEQPc7vUH6YFuS88YTCxtcWYHWWsQyj1nQhRUyyfEqHcEh9dWU3 MqTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784623870; x=1785228670; 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=bR4BTeae6fNCOYDibcfJEvLoEeC7E2KT02d4gc9TIoo=; b=Dxk5rBrVojZ5wzUD1hqkV/lsvEN4RfS8FQyjCoYUjEDNZxVs0h2FLA2QFjzgvZyYuB VwIvMKKjYOsgp3VQVJpm/bZo2DgoxmKKaNUKV6h+8OBlJ/36UQT2sRUt2pj8+DgvOXEr Y5eTiH/C2AIFhq1ewIzAjSG1w2D6mZPN5QPgE13jplr0fiYyMuDaa5gOlXxTc5dd9WpF krLqtVeozAlfeiLBjvAFuZbQv/efS6KookVVXBVR2ViNJJxRy7qj50AD4aPyZZ8I2tzD ++FB+zvZwLOEH/9QpiKIg8Wn6CCyVUJHWXStFjnXCuuWwqQx8bMxnoj1SOf/CrvnUMhq Wznw== X-Gm-Message-State: AOJu0YxsRI8G8Ywjn8hK/npZ6AG099rOgGrEG2EXJA2JAQg8RaihuDtY Xe1ynEE+W9wEh7Tv77BopYkf4QEk0xnXUDMav4QpFlbVMjiVpmoUKHfZU49nPBZHz2/RJzicot4 JGbVnLEr1LvHK X-Gm-Gg: AfdE7ckpIv6fbRLuAqpxfsmxzHIzT9o0ujtI82koK2VelU07R+tpZnjdsiw34yFfKal qLqy73nqwhUEqpT/HwC0fyl5GoRLaeZ5yjqwHhibCEUzxCcFgo+TS/1EQAQeK34lbS28lVt1aDs u3Yim5NkKOQNqkAGrU4RtX1lAOVB5twvby8K+S+oA+WQdQP48D1dU3n6ZlwdojpZdAiE6EyQZwr PAxCEaKndk6v8UE8icpZugRh/x++LGYitzwJ4iJHLGOEexOvU8BG90QZuICmynUNCq3kvAZtLXq 6wbAtQenTJnLGxmSiD1Bf81guMFZSjuv076LxS9lf+ZBqlW1p6uZFFkY6eAopoRXvU7oUMTjQXq PNG+bl3fBTw+jATmfyEXFx6RWk8bRe66IsgOVSaIyQZbJDxfITieXf349MAAtlli7p2Fa6bxlXH b8g+lX1TM6TLAgTK9WPH7u63tSeXE+sJ6fl02P4jP6ebeEKX8Yrm3m9VwXSlOzdo7bh3fR7nuLl bSmX2I+wYY= X-Received: by 2002:a05:600c:1509:b0:494:6baa:ccef with SMTP id 5b1f17b1804b1-4954a3dcaa5mr124856015e9.11.1784623870232; Tue, 21 Jul 2026 01:51:10 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 16/16] Revert "target/arm: Build cpu32-system.o as common object" Date: Tue, 21 Jul 2026 09:50:50 +0100 Message-ID: <20260721085050.421257-17-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260721085050.421257-1-peter.maydell@linaro.org> References: <20260721085050.421257-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:31::9; envelope-from=peter.maydell@linaro.org; helo=mail-wm2-x09.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, 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 @linaro.org) X-ZM-MESSAGEID: 1784623952076158501 In c8bea1276c we moved cpu32.c and built it as a common object. The commit message says "cpu32.c only contains CPU types used in 32-bit system emulation". However, this is incorrect -- it contains 32-bit CPU types used in both system and usermode emulation. (The case where we don't need these CPUs and which we were using ifdefs to avoid is specifically the AArch64 usermode qemu-aarch64 binary.) The effect is that qemu-arm lost all the named CPU types except the M-profile ones (which are in cpu-v7m.c). This reverts commit c8bea1276c85855b2e088b740737d043c8556d58. Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3962 Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier Message-id: 20260720100312.119894-1-peter.maydell@linaro.org --- target/arm/tcg/{cpu32-system.c =3D> cpu32.c} | 10 +++++++++- target/arm/tcg/meson.build | 5 ++++- 2 files changed, 13 insertions(+), 2 deletions(-) rename target/arm/tcg/{cpu32-system.c =3D> cpu32.c} (99%) diff --git a/target/arm/tcg/cpu32-system.c b/target/arm/tcg/cpu32.c similarity index 99% rename from target/arm/tcg/cpu32-system.c rename to target/arm/tcg/cpu32.c index 6e983900899..8220d785f5b 100644 --- a/target/arm/tcg/cpu32-system.c +++ b/target/arm/tcg/cpu32.c @@ -1,5 +1,5 @@ /* - * QEMU ARM TCG-only CPUs (not needed for the AArch64 linux-user build) + * QEMU ARM TCG-only CPUs. * * Copyright (c) 2012 SUSE LINUX Products GmbH * @@ -13,9 +13,15 @@ #include "cpu.h" #include "accel/tcg/cpu-ops.h" #include "internals.h" +#if !defined(CONFIG_USER_ONLY) #include "hw/core/boards.h" +#endif #include "cpregs.h" =20 + +/* CPU models. These are not needed for the AArch64 linux-user build. */ +#if !defined(CONFIG_USER_ONLY) || !defined(TARGET_AARCH64) + static void arm926_initfn(Object *obj) { ARMCPU *cpu =3D ARM_CPU(obj); @@ -740,3 +746,5 @@ static void arm_tcg_cpu_register_types(void) } =20 type_init(arm_tcg_cpu_register_types) + +#endif /* !CONFIG_USER_ONLY || !TARGET_AARCH64 */ diff --git a/target/arm/tcg/meson.build b/target/arm/tcg/meson.build index 573e8b5af48..227e674ae2f 100644 --- a/target/arm/tcg/meson.build +++ b/target/arm/tcg/meson.build @@ -30,6 +30,10 @@ translate32_d =3D [ arm_ss.add(when: 'TARGET_AARCH64', if_true: gen_a64) arm_stubs_ss.add(files('stubs32.c')) =20 +arm_ss.add(files( + 'cpu32.c', +)) + arm_ss.add(when: 'TARGET_AARCH64', if_true: files( 'gengvec64.c', 'translate-a64.c', @@ -82,7 +86,6 @@ arm_common_user_system_ss.add(when: 'TARGET_AARCH64', if_= true: files( =20 arm_common_system_ss.add(files( 'cpregs-at.c', - 'cpu32-system.c', 'gicv5-cpuif.c', 'psci.c', 'tlb_helper.c', --=20 2.43.0