From nobody Sat May 30 17:44:13 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=1778566958; cv=none; d=zohomail.com; s=zohoarc; b=VvooOOcpKDShmioIK0uDkE0P1qXO7QQ9MjeqVnIIgU8GPhPWvu/1dLFTgpExYQvllHlSJGehLA/aNNgrpB9jR+xEZyURFT+v51hOPcreK4rX88Yo8NFERFVNdMCkDxYcisO2Tk9dqa+eIyaJpON5KHbwjHxrjblcHGTHk3m4CFQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778566958; 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=CzFrN52xeD/rKozWspEAMehNfHxgV2xjJ/hvz+/wxcg=; b=G0DEaTyq6+wLjfHgpoztTWT6OJkA4d8WvhPu6o7EcO7C1TFc1F8uvGichYupl8TjHoSdPb4X4nhulD8LEDhAWH3tiRZJ2UOW51sXlyrzjZOvU6hXMIW99rBGJBNOrj0JDuvSXZxgQG4fxn+tI5LtNcWuvEJnwN+uVtA3g62gUxw= 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 1778566958216344.7257042982375; Mon, 11 May 2026 23:22:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgVK-0000cW-Bj; Tue, 12 May 2026 02:22: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 1wMgVC-0000bL-CF for qemu-devel@nongnu.org; Tue, 12 May 2026 02:22:00 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wMgV9-0003ov-Ml for qemu-devel@nongnu.org; Tue, 12 May 2026 02:21:58 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-44b052142e1so2804155f8f.1 for ; Mon, 11 May 2026 23:21:55 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4549120eb95sm29569044f8f.20.2026.05.11.23.21.51 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:21:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778566912; x=1779171712; 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; bh=CzFrN52xeD/rKozWspEAMehNfHxgV2xjJ/hvz+/wxcg=; b=QTo0X7ppc1AfXfj4wESNqXglwnBa6l0UgNK/XLu6IHgpDbgUjvDJjXIxZ/wQ64LXUH nyta0guKX8iUDzSFmMoDDnq43LMMYGzDA+C5h70y/gW/HjUkB5dEjVeGCa4MTdKR/yZE 2dLJPoAtRwYOP7Ak3XruMWn6txBcO4SCg1s8D7/8MU5C/GY2+t3Pz/yduOM0hOqcJxN1 MV0zSnIeR1Xu2kSDELo8SMwnZciLLjvnEs40BfX6OBvA2Qx4p7Bg0oubKAAyLMFmYKLo ViFPP6MgB8jVvLptgh+P0dWm9Zpfa+rPhYtN/PkCB7wCHHfi2gs50gSQMZV2Ty+tW+q0 /SlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778566912; x=1779171712; 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; bh=CzFrN52xeD/rKozWspEAMehNfHxgV2xjJ/hvz+/wxcg=; b=ohEpppT3ekXrgo1VeCRV0mW+HDF2RZjVsdP6jkdEv45LifqC9QfVbw55QZA3JC+Sfs +qzpGKeLudk1OtfUnek229ikT8CuVTlLOGAPIHQYerGtSXfBDNeQzYN0tGYGC4uiQ+r4 UN7lP/JHe3yQt3FvSjYrt5LlfA0AcczYBfXxIz/U3CYn7V+bGtyKpGDrSeieBhanVv2R tjaCFHV7rC9YiGk901eVovN1aSUhm3vxVhMWA9V836gVoxqRA3HoZV/+C4ll1lvRAntl Qd2NRyOMhlCsL0weN/XYP6j1LjGHHNSsAY0EDt44ELCIBT/B10XXzW55kui3HAmziinB 20wg== X-Gm-Message-State: AOJu0YwzoVLrqsc8wdp1k5876yoGclrt+YKh4rvbknij72xs/mnviRzA 3C2m/N39IN1kmzVQj/aqJ64o6oGoFo0mVN//2w9+9hUs3cq1eDj9i0HgWykBaF+9VeR3EqTbTN3 N6rfogp8= X-Gm-Gg: Acq92OEd7eQFL3s3jkrS5spxCdRKMOoAEe2Z2CTSUWhgqyqTbgsptEvYyJwwkb9GtoL lqdf3Dcr+bNjcs4jL4kMiUKYuq7Ry17N1d5A+TEiaKYvQ5C7tmJy+88FQ/vyBI0OKh44+EqdsHL 75E2hBM8x5klFnNgu5VL4KFWxDMu3mcLUZPN3QquEPlRihB4d4evj5HWsUrwzSgOKJvN42mnEnI LF3OfBRxXL7yGVGh6PgstBtly3tk/kE3zQT07KINQZpHsmBjTsXxqDWdizPBQEnf14LEgeZ6mqW 5c3KiIURMyaQkI2H1LXD18wHkLLebIcqzYgi7zUPxb+LmDotEEoX3ywmkOmDx33pEJWDlQYbTKJ +PYRMZ37vTNqZ5fXz+Hxt+4OEmK/xzhlO2UAVj02PLPZu3JlEZ9nWpfltvaEOuFZMRn9IEEkVhG Cr+i8arLPtw4YqKr5I09xiENuLiQAfL3BDKg8UsxR8LNuMXMjWzwF58cTuocBUy1wTBWZAGa/Y X-Received: by 2002:a05:6000:310e:b0:43e:aa88:f1a1 with SMTP id ffacd0b85a97d-4568ca51624mr18282841f8f.30.1778566912236; Mon, 11 May 2026 23:21:52 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 01/41] hw/display/cirrus_vga: Fix packed-24 color-expansion transparent pattern fills Date: Tue, 12 May 2026 08:21:02 +0200 Message-ID: <20260512062142.67998-2-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.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: 1778566959053158500 From: Peter Maydell The Cirrus Logic VGA card has "pattern fill" blit modes where it repeatedly copies an 8x8 source pattern to the display. For the "color expansion" subtype of these, the source pixel format is an 8x8 monochrome bitmap, and the destination can be any of 8, 16, 24 or 32bpp. We implemented these wrong for the 24bpp case, in a way that results in a complaint from the undefined-behavior sanitizer about a shift by a negative value. For these pattern fills, the GR2F register includes a field which specifies how much to skip at the start of each scanline. In the 8, 16 and 32 bit cases, this field is 3 bits and is a count of pixels to skip. We get this case right. However, for the 24 bit case, the field is 5 bits and is a count of destination bytes to skip. We tried to add support for 24-bits in commit ad81218e40e27 ("depth=3D24 write mask fix (Volker Ruppert)") in 2005. However we got this wrong, because when we need to skip, for example, 30 bytes in the destination, this is 10 input pixels but the whole pattern is only 8 pixels wide, and we ended up with a negative bitpos for the first bit to use in the pattern. Fix the bug by masking srcskipleft in the 24-bit case so that it correctly gives the first pixel to use in the pattern even if we skip so many pixels that we have wrapped around to what would have been the second copy of the pattern to the destination. This patch was produced based on the information in the CL-GD5446 Technical Reference Manual, specifically sections 5.8 "GR2F: BLT Destination Left-Side Clipping" and 9.4.8 "Pattern Fills". Cc: qemu-stable@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3377 Fixes: ad81218e40e27 ("depth=3D24 write mask fix (Volker Ruppert)") Signed-off-by: Peter Maydell Reviewed-by: Junjie Cao Tested-by: Junjie Cao Message-ID: <20260410183249.4046456-2-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/display/cirrus_vga_rop2.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/hw/display/cirrus_vga_rop2.h b/hw/display/cirrus_vga_rop2.h index b208b7348ad..8be35ec6e20 100644 --- a/hw/display/cirrus_vga_rop2.h +++ b/hw/display/cirrus_vga_rop2.h @@ -191,10 +191,29 @@ glue(glue(glue(cirrus_colorexpand_pattern_transp_, RO= P_NAME), _),DEPTH) int x, y, bitpos, pattern_y; unsigned int bits, bits_xor; unsigned int col; + + /* + * Copy from an 8x8 monochrome pattern with color expansion. + */ + #if DEPTH =3D=3D 24 + /* + * For packed-24 modes, GR2F bits [4:0] are a count of destination + * bytes to be suppressed for each scanline, which we keep in + * dstskipleft. Our srcskipleft is the number of pixels to skip + * within the 8x8 source pattern to match up with that number + * of suppressed bytes. As the pattern repeats every 8 bits we + * take the number of pixels mod 8. + */ int dstskipleft =3D s->vga.gr[0x2f] & 0x1f; - int srcskipleft =3D dstskipleft / 3; + int srcskipleft =3D (dstskipleft / 3) & 0x7; #else + /* + * In all other modes, GR2F bits [2:0] are a count of how many + * destination pixels to suppress for each scanline, which is our + * srcskipleft. We get dstskipleft, the number of bytes to skip, + * by multiplying this by the bytes-per-pixel. + */ int srcskipleft =3D s->vga.gr[0x2f] & 0x07; int dstskipleft =3D srcskipleft * (DEPTH / 8); #endif --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778566963; cv=none; d=zohomail.com; s=zohoarc; b=ZuoAjrsCqzBGKTL7DA/UFnViwPnnDOj9aSbNVbZW+RdUwS8Sxln6xstNYU2v2hAu+WvIkEKitQaEpce5bzVgZZXfc5z0dFYZqs7pN9ynGuP0desNfuoSowHOm09fTOpatHqHKuzUBsDzIR1cBKTI5VkoHWzf7dRMKpH4H6RIoF4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778566963; 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=WSk/dEbGgvaUxswyZj17bvNUE0aNKyiM/+UL1KCae38=; b=nor7YARbUWUzSco6Ylr4TwWasqgNcwwavhoTCViLkoDocgaDFEcL10hkCxy6WMCzSz/Q5yki5I99Lo6CqO1qZzjHM+1RwAn88bb7+4ipVlWkh3Lx46bzaRg0K4GMpSkf9wUuulkuT5+NiuXlk6r9IZE+Is8mW21fOuSzmBwYLo4= 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 17785669629941006.1489397676197; Mon, 11 May 2026 23:22:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgVi-0000eh-Bn; Tue, 12 May 2026 02:22:32 -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 1wMgVI-0000by-17 for qemu-devel@nongnu.org; Tue, 12 May 2026 02:22:04 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wMgVG-0003sM-0X for qemu-devel@nongnu.org; Tue, 12 May 2026 02:22:03 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-488af96f6b2so60762135e9.0 for ; Mon, 11 May 2026 23:22:01 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48e8e64385bsm12211345e9.12.2026.05.11.23.21.58 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:21:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778566919; x=1779171719; 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; bh=WSk/dEbGgvaUxswyZj17bvNUE0aNKyiM/+UL1KCae38=; b=r/BCHLmyK5xzvrB3/q90I5gAn8f+f/+ezOlvQR55SzUV8hP7GYPHfzaSDa3AtQp+bf dMruiOHQTPWcjxEtgGuQZF+Rjz7dQCuvE9KhxbeIc/0E8ub7ungJTRL9+H8GEWinU3VQ S9wdAP5N7M5/vpspTIp0V70tiiOVuZHJaP0RBqpcfFrhqozS0JOEGYNDHoaT64BJIvQH 0nFTBEcCyAF9ry9AqxwF1YOPtTxitf4a0mbZZUS3nLqz8HsDo5E6Fo/XhQ7bhatkb9kq AqOJEBPG4ukh5tTS1atNvnMGdKecZuK0R4F38DGUy/s6ikGCKv99a3KrnY6aNpkcWhtQ yazA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778566919; x=1779171719; 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; bh=WSk/dEbGgvaUxswyZj17bvNUE0aNKyiM/+UL1KCae38=; b=ETzGJTf6g9lHuzrkHyEUAfrS5mOVjHCpJRGUXAx2oCI2u1Yz8epJg3cOxIn652hS6s wmtA9BbTIeaeLxK0MtIh4yXmf617TgHzftg2/WGqxkF5siZjKwkNgi0C+m0Vexw8r+Vk umi1lyElC4vb3xz39jp1Ev4EAvjT/iTVFNwTP/tu5dKNd21GNaN7q+I43vYpvgpLQ41O NL4FVA17ourjp8Jj34hP90S7XZi7AIbvuaVZlX7/5XkKYkPlh3kFmy/nrej6YRddU2KZ TUGwn2vnAuN1erVJihFHkiisvy3VZ26YjoVPLG92dJpdxRC+XKFI8mXDtGdnCuaE8lo9 ftwQ== X-Gm-Message-State: AOJu0YzcrHW8vukKQr32+gw1T6X0WCOD3CH0B2vro6vK7m9GRAYABj2E kSl+meYRNXyQfSFJ1UNiOB7UMdDGUprLOiz8n//24ZZC98OHEPr9XeETaolowznj0RIPde/cp46 88fxMTV8= X-Gm-Gg: Acq92OHbVlPoo0A5isoDUjmQD+VOrzr+58Mj2wxxPdOFRUoK7D2xYAwkcAfZX7JGtSz IODQQ1JqqD2XptUbmnzghUMvOnL4u7q132X8IxDfI/aqbEaeQkKRfBO9A5VuG5nzQstluM8ukuC bKr76SdLN2ffJbpHSvix4+AVvzDFHlRPOp201tNSjxjpBUaNTZh9pq0wabx2OKy64wNFF31dlru DQAdY+SQYuR59iuYdaytvTNN1DsWgoLyVbpEnIrd6PsVAwuYjogrsF5rePW4O4YyyYk16w/lus0 x/hJ8QJTyyM/ZDvUQixdIdZH0tmp08H+qHsa8eTWGPJHlSbyJaHJqhLZjg9zneZHIAJgIq1zjzd hHlX479UDDLpXSFqbIyu+RnPoX01EyRQnuu0eaE9LNX3+/1YT3yVX91ghWu7jteS3nS+h7QFSdD /wOZPFarGvXDtIMw7A+ygGnvaN3jdpTgqiZTtL9BVpJUCWzBETyCezpU7SWCtpkUOms2G7B2mz1 hBzQ2VyaYY= X-Received: by 2002:a05:600c:3011:b0:48a:568f:ae6d with SMTP id 5b1f17b1804b1-48e73f1baebmr102503375e9.8.1778566919252; Mon, 11 May 2026 23:21:59 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 02/41] hw/display/cirrus_vga: Fix packed-24 color-expansion transparent copies Date: Tue, 12 May 2026 08:21:03 +0200 Message-ID: <20260512062142.67998-3-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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: 1778566964858158500 From: Peter Maydell For the "color expansion" subtype of raster operations, the source pixel format is a monochrome bitmap, and the destination can be any of 8, 16, 24 or 32bpp. For these pattern operations, the GR2F register includes a field which specifies how much to skip at the start of each scanline. In the 8, 16 and 32 bit cases, this field is 3 bits and is a count of pixels to skip. We get this case right. However, for the 24 bit case, the field is 5 bits and is a count of destination bytes to skip. In commit ad81218e40e27 ("depth=3D24 write mask fix (Volker Ruppert)") in 2005, we updated the code to (attempt to) handle the 5-bit mask case. However, we don't do the right thing when the 5-bit mask indicates that we need to skip more than 8 bits of the input bitmap: we will right-shift the 0x80 constant completely off the right hand side, and will be off-by-one for all the source bitmap loads. Fix this by calculating the whole number of input bytes we need to skip and the residual number of bits. In the 8/16/32bpp case the bytes to skip is always zero. Cc: qemu-stable@nongnu.org Fixes: ad81218e40e27 ("depth=3D24 write mask fix (Volker Ruppert)") Signed-off-by: Peter Maydell Reviewed-by: Junjie Cao Tested-by: Junjie Cao Message-ID: <20260410183249.4046456-3-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/display/cirrus_vga_rop2.h | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/hw/display/cirrus_vga_rop2.h b/hw/display/cirrus_vga_rop2.h index 8be35ec6e20..33f9b3b6134 100644 --- a/hw/display/cirrus_vga_rop2.h +++ b/hw/display/cirrus_vga_rop2.h @@ -108,12 +108,34 @@ glue(glue(glue(cirrus_colorexpand_transp_, ROP_NAME),= _),DEPTH) unsigned int col; unsigned bitmask; unsigned index; + + /* + * Raster ops where the source is a monochrome bitmap with + * color expansion to 8/16/24/32bpp destination. + */ + #if DEPTH =3D=3D 24 + /* + * For packed-24 modes, GR2F bits [4:0] are a count of destination + * bytes to be suppressed for each scanline, which we keep in + * dstskipleft. We want to track the number of whole bytes + * to skip in the source (always either 0 or 1) and the number + * of bits within the byte to skip. + */ int dstskipleft =3D s->vga.gr[0x2f] & 0x1f; - int srcskipleft =3D dstskipleft / 3; + int srcskipleftbits =3D (dstskipleft / 3) & 0x7; + int srcskipleftbytes =3D (dstskipleft / 3) >> 3; #else - int srcskipleft =3D s->vga.gr[0x2f] & 0x07; - int dstskipleft =3D srcskipleft * (DEPTH / 8); + /* + * In all other modes, GR2F bits [2:0] are a count of how many + * destination pixels to suppress for each scanline, which is our + * srcskipleftbits. We get dstskipleft, the number of bytes to + * skip, by multiplying this by the bytes-per-pixel. In these + * modes we never need to skip an entire source byte. + */ + int srcskipleftbits =3D s->vga.gr[0x2f] & 0x07; + int srcskipleftbytes =3D 0; + int dstskipleft =3D srcskipleftbits * (DEPTH / 8); #endif =20 if (s->cirrus_blt_modeext & CIRRUS_BLTMODEEXT_COLOREXPINV) { @@ -125,7 +147,8 @@ glue(glue(glue(cirrus_colorexpand_transp_, ROP_NAME), _= ),DEPTH) } =20 for(y =3D 0; y < bltheight; y++) { - bitmask =3D 0x80 >> srcskipleft; + bitmask =3D 0x80 >> srcskipleftbits; + srcaddr +=3D srcskipleftbytes; bits =3D cirrus_src(s, srcaddr++) ^ bits_xor; addr =3D dstaddr + dstskipleft; for (x =3D dstskipleft; x < bltwidth; x +=3D (DEPTH / 8)) { --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778566984; cv=none; d=zohomail.com; s=zohoarc; b=jTMC4SAd1d7Jj+k0PkZW3vK4ZgrAaxF0iykbH3Wt8KdNrKAf+YpnQAFjjJeCZXua1iwuqzmSSG0YVLTGqmM11wrRF1eQdusuGlM0an/56YH599s2tr/r8gpdl6+IuKLLyuIkilwWS6UbXj8czzvE9DvBsHkOMtHIXJcyGYvuwT8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778566984; 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=HuuYKa/kjUo7WM3wtJMj9mulhPP2Z1kO/T6hVsMPENA=; b=Srif3g1tKDuZGldOPWvofSx7lIj8MgD0KOTFJpDNxoVKMp0TR0qcculMmaeWHkhqq+k80DDo1UdcEGDqiJsr62u469E239BSGc/fFPa91LRWNslPTDlQaeEuRvRolsIbHx3Qy8W+xzLEpbWQVXA69pzk0RkOEhhxk4eN0P/9YuY= 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 177856698406590.02763380233523; Mon, 11 May 2026 23:23:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgVt-0000gX-DH; Tue, 12 May 2026 02:22:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wMgVO-0000eI-Su for qemu-devel@nongnu.org; Tue, 12 May 2026 02:22:21 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wMgVM-00045N-Qe for qemu-devel@nongnu.org; Tue, 12 May 2026 02:22:10 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-43fe608cb92so3185992f8f.2 for ; Mon, 11 May 2026 23:22:08 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4548ec6aea4sm35355504f8f.10.2026.05.11.23.22.04 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:22:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778566926; x=1779171726; 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; bh=HuuYKa/kjUo7WM3wtJMj9mulhPP2Z1kO/T6hVsMPENA=; b=OJdo/fuE2uVmLgAKXZSiH+OkLEBOt5ztIsGN08iUC/Ea7mumHdmWGoYxc9XLJS0tZ0 VN9g6OTU0rrL5fuuWI2qdxJJW1iz5vYe2UwpRsNSQ1W0nQPdurHmrdL+KXV/nQ6cZ4yA iMD9biDcmdwj0tmmcqTPxh8g5TUlzdsmZXVIaB8k1z+SKIBRrGJpTAH9S+z893cmcyD1 DNXfx/qNhuXKaJO0FYEEaNJnVlQEkrIDnE/P0+Z3ttkuxSfBPUL0Ksvb3Prd23fwKrMb qIJ8QAgIF7nslEfKwMd9Rz8Dgzh3gNhjrCWfFNZ5VPzcphWA0HMhNypUej8iVZ2s8QyQ hsbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778566926; x=1779171726; 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; bh=HuuYKa/kjUo7WM3wtJMj9mulhPP2Z1kO/T6hVsMPENA=; b=tSyJqrupWCrQC8JZQ+ftN0i3yFLG4mNl3MTAtRdOL4XqLwylraf71nauONI28w8Vr7 VaaWHX2GbpnDw4faZXPVln+ghqKfsw+MLQJEcoROOAifiurSBS9tZicji6JHuqqLP84l WTEsj/5osDAjSV3r8uPrBUddrRFGZLL5i/9+Alh41Mo8Ms/yds4RbSDSGpArMHcQW2Mf Mj+ncY9u+0qaSSvRIT/zTcDzjutNtGVypivcoyXOPrnVUcfRjJzCP8WTTtTeDbgFYKmm ls1b4RfPhiq82SHnHV0pKatI3KMuGcQNOzK88wUux8jIW7lSVPXFPmCXFRvrE9HYLJA8 zirQ== X-Gm-Message-State: AOJu0YwVhq4dYgAHuohMSWwjsZHfBMQM3a7MIXnJVomiu5sZ1cTdk1+n vKaG4LRrUuummUgngA9K3dzb4dE1MMxk5Ae/pcQaBVwaTATt/qahbk+tyfBLY+PbVaIvbxPqCal Y3IHdb5Q= X-Gm-Gg: Acq92OFBnUuN1iuziptSHZo8ABIXHVkKDalUR9gb7RB83o+zZ0YOR4QLDh61bkoNVu2 wRc5sbCg7zt7rsndY576dBd2btoljcp/G1WUc893D2elDwM43OM6GvHvnYPsJ4j+Z08jrAOwdsV znfj+UCu4FCmWALEILVgwVjVTeYRx+OtyjlbBEqfZWRejcP//2niRxgOzmpWXpWpCbWmwPQqKMT 4SAMhgd7Y7FWG0Z8cSQbTM0j7uVMBYylimZu7cXJgVUJHbISy4Jt5/nxQFOdNhQEJhnNbcOU6RR UmgrMYG0fcqHyryC15ru5AtqL6pJbRpcpaNV6QJ4yqWvXsSMUw5ZfKvEHj5XYnDgu7maK4L497J fBaXhD5fd+pOua3JlVK5RF5+V86rEiwJiFPeOJDcDdli/ANsg1lddqRK0mQToU0YbDoHbX6q5IF sE2cpAvcPwOAN0aaod4y2ON/Io/GT6cqhHnrzS3ErLI9gJhEwYrxaBG70+sWMcDIU/obXGf8OZ X-Received: by 2002:a05:6000:3103:b0:44f:da83:2030 with SMTP id ffacd0b85a97d-45463d88e5dmr24896701f8f.41.1778566926189; Mon, 11 May 2026 23:22:06 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 03/41] scripts: mkemmc.sh: Fix output pollution on missing images Date: Tue, 12 May 2026 08:21:04 +0200 Message-ID: <20260512062142.67998-4-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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::430; envelope-from=philmd@linaro.org; helo=mail-wr1-x430.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: 1778566984870158500 From: Jan Kiszka Reorder the redirections so that the 2>/dev/null can actually take effect. Signed-off-by: Jan Kiszka Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Jerome Forissier Message-ID: Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- scripts/mkemmc.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mkemmc.sh b/scripts/mkemmc.sh index 429388213c6..3d8546cdaa6 100755 --- a/scripts/mkemmc.sh +++ b/scripts/mkemmc.sh @@ -40,7 +40,7 @@ process_size() { alignment=3D$3 image_arg=3D$4 if [ "${image_arg#*:}" =3D "$image_arg" ]; then - if ! size=3D$(wc -c < "$image_file" 2>/dev/null); then + if ! size=3D$(wc -c 2>/dev/null < "$image_file"); then echo "Missing $name image '$image_file'." >&2 exit 1 fi @@ -102,7 +102,7 @@ check_truncation() { if [ "$image_file" =3D "/dev/zero" ]; then return fi - if ! actual_size=3D$(wc -c < "$image_file" 2>/dev/null); then + if ! actual_size=3D$(wc -c 2>/dev/null < "$image_file"); then echo "Missing image '$image_file'." >&2 exit 1 fi --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778566974; cv=none; d=zohomail.com; s=zohoarc; b=TKPX5uG5aKotUiLoOy7yTCOD27crXzEZYfi/Z87+7QgeaJVisSyBVxa1az9omokVz6yuPxBPWIRhBhLeVHUp7WxSzWK6JvozNEwkpOTKC2i2yvFCe6plza8hB918V0JbvdRCF0kJypHm1JyM2FP1r3EhKqY/99XZS2bBQS61vvU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778566974; 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=4+O/G90CzsbTg/n65ZUZn83pml2yX70Uu8nT+gwXYMs=; b=PtEj3ZvxuN5oxVEfql185yCqTwShbmYEz9A8T5H95pxo/JKdN3JG7R4nJR0Xb/Kbx1pYngkq0gOogZPQbQE7LKWtOTPQgEAg6lTxRkAtewpVNq7yGlrFk3P5yun5GbP7sKVo++MJaSuPnXd9EV0+EQ7OE1lagFPnE1QkV99cNh0= 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 1778566974128832.4628892893484; Mon, 11 May 2026 23:22:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgVx-0000pN-BF; Tue, 12 May 2026 02:22:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wMgVW-0000eg-GF for qemu-devel@nongnu.org; Tue, 12 May 2026 02:22:25 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wMgVU-00047o-Or for qemu-devel@nongnu.org; Tue, 12 May 2026 02:22:18 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-488a14c31eeso34988125e9.0 for ; Mon, 11 May 2026 23:22:15 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48e8f3cf0cdsm15897265e9.2.2026.05.11.23.22.11 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:22:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778566933; x=1779171733; 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; bh=4+O/G90CzsbTg/n65ZUZn83pml2yX70Uu8nT+gwXYMs=; b=rC+Tv+xWzrBoXrWAe3v6zeEBhPJNp9RAW2YbaYei+HnYyPhnm38EuVURUIMyQjmpxQ BDk/zQ5BjdkMbcEFSo9kJcbQhJRPaFZGc88rCUN5khw8rKlHRVvk6kOe4PoOT9/PoyZY zOz6UZSs8teMxyajg9g6S6zzjKXR1nRLaYmT3l1xyTlicpL/bW9SIqSsWyCYtkcYfsE5 t/q5+vajTxaCWQYQi/msBwtbehrbx65EUk1EWVSP1piN4OnnmRlZ89qd4DGnXWyH9Rwk v1qAMSaSumld3ybVPObgsiytnLOl3ZUcXua7pV7Otzr42m+D2yJ618ov1JO4gk7EdZ+X tNZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778566933; x=1779171733; 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; bh=4+O/G90CzsbTg/n65ZUZn83pml2yX70Uu8nT+gwXYMs=; b=qfK6DEUyoN0e38lr0fTfLwui+BOADu1eQoS43cBBLuaIOsU/SJNwSMSu/ze9303ARg jNdoRN5LyHf0+ZiG55ofUtMNYNR3CwneP8nN4jimceCHd4SCD7zpeVhbU+MOdFlwwIri 6JYMoANSSHYzYo3Sexj6nY6tL3D8tjHiJHZ4JelS9jjZNT3Zz3cMXN3Xw3KhIc1tz2L6 JgOxfGTVTy8ueoA6pOecR/HcJjqPZOJJiflaeazWGEksJExMGR5F4eR42cXUAt3qU/Ja cJpnFB+29S32vWB+6QQGwnFZ3X9itb7R2mlll7nN/sNiO2HwfPZBDRWrvqsVrb8NluHO RqGg== X-Gm-Message-State: AOJu0YwBk+Fq0SDClQnKrCj9RnfoZD/inOUqt5RojZxIkX4rj2hMHhWh NUl0ASkQy5zKSbQ+DUrkA+op/l0RiPj74Y9WzUrSiu+QxnXLUfQTUuC8rKbjFXw9yK2zd2wITac Gs0UY+8k= X-Gm-Gg: Acq92OGRXDy85wRotmbMhmaqxgv49vyn661e3J3XGS3j2/5idOlXNcFv96/51QrqBOU lhtYl65ffZmdxTWOyyRjRkaDfsdLsVT1o9vIVzXjPT1Itd5WlhtqDb4FvKlczvLnVk4v3iCLF1B 6wqqB2dfL5sL5hAXmd4fPdiuQZbk8V9H5Z6EwqSYpj2ywmsqd6hS4I/IbiaThv3qPs4h1YtkwpF mD/FpPdXPhWRqA+gPH0GV6jcGhB+qWxr19bQRzwPq0W1METgGFVX4w8vs1ZaPAQvfQJgygzWfAp U/MtuPZEcoJCIst6lkMF9DDjduwVf4+FJF5Ni4LmKfET3R404sNmbjGWP42u5KTDW334jj8ueT4 B7iN7t/gP/IoHcK9qhMVlrPP+xHANYDbhuOiyNxx6idO/BZxjFucbm5N86Z+F8mbqm3phrGiCYY NdrQbw99JrVNIyV2HlNs5Y7Jh4a5jOZX1nlujtIei5oqtBaop/S59G+Q6vtLDdOijGC3gdLyJ1 X-Received: by 2002:a05:600c:350a:b0:489:2005:b36e with SMTP id 5b1f17b1804b1-48e676ac333mr255592705e9.19.1778566933022; Mon, 11 May 2026 23:22:13 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 04/41] hw/sd/sdcard: Add support for pre-setting the authentication key Date: Tue, 12 May 2026 08:21:05 +0200 Message-ID: <20260512062142.67998-5-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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: 1778566974896158500 From: Jan Kiszka In contrast to real eMMCs, we are not (yet) persisting the full state of the device. This particularly includes the authentication key used for RPMB access, complicating testing of firmware images which do not support initial provisioning of the key. One way to address this would be, e.g., extending the eMMC disk image with a special sector to store further state. A simpler approach is used here: Add another device property that allows to specify the authentication key, bringing up the eMMC as if the key has already been provisioned before. This is how to tell qemu to use the OP-TEE test key: -device emmc,[...],auth-key=3DD3EB3EC36E334C9F988CE2C0B85954610D2BCF866484= 4DF2AB56E6C61BB701E4 Or use this for machine-configured eMMCs: -global emmc.auth-key=3DD3EB3EC36E334C9F988CE2C0B85954610D2BCF8664844DF2AB= 56E6C61BB701E4 Signed-off-by: Jan Kiszka Reviewed-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Ilias Apalodimas Reviewed-by: Jerome Forissier Message-ID: <9fab19ee4c755f9cb2abf55494541fcadff46cbd.1776231967.git.jan.ki= szka@siemens.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- docs/system/devices/emmc.rst | 23 +++++++++++++++++++++++ hw/sd/sd.c | 23 +++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/docs/system/devices/emmc.rst b/docs/system/devices/emmc.rst index e62adfd68ed..e7d67c809d5 100644 --- a/docs/system/devices/emmc.rst +++ b/docs/system/devices/emmc.rst @@ -53,3 +53,26 @@ SDHCI controllers while assuming that the firmware needs= a boot partitions of -drive file=3Demmc.img,if=3Dnone,format=3Draw,id=3Demmc-img -device sdhci-pci -device emmc,drive=3Demmc-img,boot-partition-size=3D1048576,rpmb-parti= tion-size=3D2097152 + +RPMB Authentication Key +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +A private shared key is used for authenticating requests of the host to the +RPMB. A real eMMC stores this persistently and permits no reprogramming on= ce it +is set. QEMU emulates key programming but does not persist the key state +across restarts. To emulate the state "key is set", the eMMC can be created +with a user-provided key via the ``auth-key`` property: + +.. code-block:: console + + -device emmc,[...],auth-key=3DD3EB3EC36E334C9F988CE2C0B85954610D2BCF86= 64844DF2AB56E6C61BB701E4 + +This sets the well-known test key of OP-TEE on emmc device creation. In ca= se an +eMMC is instantiated by the machine model already: + +.. code-block:: console + + -global emmc.auth-key=3DD3EB3EC36E334C9F988CE2C0B85954610D2BCF8664844D= F2AB56E6C61BB701E4 + +A key always consists of 32 bytes that have to be encoded as hex numbers, +left-padding with zeros as needed. diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 58275e7fa19..ebe6e35b15e 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -205,6 +205,7 @@ struct SDState { QEMUTimer *ocr_power_timer; uint8_t dat_lines; bool cmd_line; + char *preset_auth_key; }; =20 static void sd_realize(DeviceState *dev, Error **errp); @@ -3132,6 +3133,27 @@ static void sd_realize(DeviceState *dev, Error **err= p) "The RPMB partition size must be multiples of 12= 8K" "and not larger than 16384K.\n"); } + if (sd_is_emmc(sd) && sd->preset_auth_key) { + if (strlen(sd->preset_auth_key) !=3D 64) { + error_setg(errp, + "Authentication key must be 32 bytes long, " + "encoded hexadecimally"); + return; + } + + char *pos =3D sd->preset_auth_key; + unsigned int n; + for (n =3D 0; n < RPMB_KEY_MAC_LEN; n++, pos +=3D 2) { + int chrs; + if (sscanf(pos, "%02hhx%n", &sd->rpmb.key[n], &chrs) !=3D 1 || + chrs !=3D 2) { + error_setg(errp, + "Authentication key contains invalid characters= "); + return; + } + } + sd->rpmb.key_set =3D 1; + } } =20 static void emmc_realize(DeviceState *dev, Error **errp) @@ -3156,6 +3178,7 @@ static const Property emmc_properties[] =3D { DEFINE_PROP_UINT64("boot-partition-size", SDState, boot_part_size, 0), DEFINE_PROP_UINT8("boot-config", SDState, boot_config, 0x0), DEFINE_PROP_UINT64("rpmb-partition-size", SDState, rpmb_part_size, 0), + DEFINE_PROP_STRING("auth-key", SDState, preset_auth_key), }; =20 static void sdmmc_common_class_init(ObjectClass *klass, const void *data) --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567036; cv=none; d=zohomail.com; s=zohoarc; b=TaSaGgW9cfsi9H3F0HBPJEnFEavAN2i340JVQN3fdLY9KbjtjjDA4INmY8POcBSAGIBZArOEVRq/XAlBv9UiZnaIReWhguD3kPgmVHeJybWZEE9ldUnllvxBBae6ReL0eiCP7Lod9ZFAgicO+jUpo12JM0A/LE35Alkw5EX2Z/s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567036; 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=5jEu6kZH+X4N8CYk2mmHCjcBwozvzYS5Uh+w2RSCMmk=; b=HdW7RkY2niUWgx96FfH80t9J1ODKosqnhQxseikaBj6lunGDFxV3WsmQit7kWFR/GkqKlsLz9p8P/uAduiGHypHuBSxnXqs6G5Z21N28u8YuBeDw957w8hNus41zXXZA4nYI6ewKo00RY1SQNs3hkGVtBNtcIokOBD1CILBt220= 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 1778567036240971.0263619922574; Mon, 11 May 2026 23:23:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgW0-0000rb-Ow; Tue, 12 May 2026 02:22:48 -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 1wMgVe-0000fD-5m for qemu-devel@nongnu.org; Tue, 12 May 2026 02:22:30 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wMgVb-00048e-Uf for qemu-devel@nongnu.org; Tue, 12 May 2026 02:22:25 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-488ad135063so40790375e9.0 for ; Mon, 11 May 2026 23:22:23 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48e8f4470d8sm10083285e9.31.2026.05.11.23.22.18 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:22:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778566941; x=1779171741; 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; bh=5jEu6kZH+X4N8CYk2mmHCjcBwozvzYS5Uh+w2RSCMmk=; b=lXEbo24d0677fd6uE8sX6Bd/hIC6jlso8l9bY9CnRsq8qkif4crRy9pPaUj8STwcTb kUzcIUbJoY9PfentETzxKX8h2MNUwc3kFjK++UVeEY0GED30HM/MF0X33TcQDtFJV9wI UuK8pCJJy3aJRD7Zsbmto4uYgYfgXkQiEAN9totGFc7f8b+0hTrRw8nwmNZJ74JABwmV 5/aolenKhuB/IjUxRkjb3is0LEJQXaZ8SPbCryphYGGcXRpQXAt8M45VQgL7rcTIhh35 HvUn1JltVLZ2Xk/fDhXwnPjSvkmyD85pgvsQZKnWHkLuEYvY9gJvXM1w3XUb+4+nkvcM 2PVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778566941; x=1779171741; 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; bh=5jEu6kZH+X4N8CYk2mmHCjcBwozvzYS5Uh+w2RSCMmk=; b=BMmsd3PPPSUn4xm94dbh6ZZ71mfQqtyprAFRSpwamasG9oJKRsb3ipw6KwKO4eA1sO 4CvVAbwtg44lcUkfq/sTaPQctB6bjx5EsRVsycEVDxkZSg8yIcoSGHiSA5SMA4gPVpy4 EIO6YZ3LOmYFpe/uPdnmALEFwY8JBwIXwgT2L1Vt1doObH1EyO+hLo/7Nn9zXQ6GOR04 WAPnwfr5GbPDhYMGXyQJrcfUvcP17zwxf/mUmlBnHcZ9HJofCEu80d7tvpBpk7DUodbt hKHDnumpfdBvIW1518d/VlqKz7AkGRehEtjDn8DeXQAR3TRnA+qncwG+afKiWK8kN0fR szBQ== X-Gm-Message-State: AOJu0Yy9wSPf/Z8No3cxLRj4TdA96la54/jS5r5wGozwBj3UYK5aryYH 5eNeItasL/hdVdqaucNbzK1LC+YKU0zdR/l5GsJib2gv8mxcClRfjTYebejbBVq25R8CWdWh+ON VFiA+mX0= X-Gm-Gg: Acq92OFtvFILi6jN9OMc8XyGBBZOFA/ATO8nVzj7ZGSnpKAgoU6G/eUrAdAP9zbQsie nxnd7JD5vBH1BBPy214CwC2m7Ky5UtcRMh7N/5F3H15n27Rg5RNkR3SeCxBX3nWgzZuVXEiipX0 lx18GfN/FqF4OibLATIHFv4/CIWOGa1t9AMv+ife78raqIdIg4MTar73VEkTG6qwQy5KQEAjmdn 6l/16j+vxkqBemWEApZY+ZncuYgFJ+sXfSz/9hKg/PLl9Xepuir2eaO0pbFigTUgjiN7oObJOGP ncYSP8hjYxcLfA9OP6/7XvNDweiF+b9xo2bafIMpKeB6mCSGgNTqDZHwumkwxqeI/LiUwqxCcDX wAvx/kSxy7Q9IBvJxNRIz6Il+7p/lDerCLVQKko5xjfW5zN8LbT1z3k04/YjQll+3KXWMlzocrj eBE6HstTNUVih4m7mN2EnKbMrLYmXU5UzZVhZQp2D2W0ZS6NMAP0dgC2aMUbzpmJqoLRZ2aXnl X-Received: by 2002:a05:600c:1d18:b0:48a:8cb6:88b9 with SMTP id 5b1f17b1804b1-48e51f44621mr419040675e9.22.1778566940502; Mon, 11 May 2026 23:22:20 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 05/41] hw/sd: Switch read/write primitive to buf+len Date: Tue, 12 May 2026 08:21:06 +0200 Message-ID: <20260512062142.67998-6-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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: 1778567037277158500 From: Christian Speich Currently, read/writes are broken down into individual bytes which result in many function calls. This is quite bad for performance and since both the layer below and above work with larger buffers, it should be corrected. This patch is the first that switches the corresponding interface over to use a buf+len instead of a single byte. However, for most cases the implementation still only reads one byte and is then called again with the remaining buffer. Optimizations taking advantage of this new interface are to follow in the next commits. Signed-off-by: Christian Speich Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20260417-sdcard-performance-b4-v4-1-119e66be10c2@avm.de> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/sd/sd.h | 22 ++++++++++------ hw/sd/core.c | 26 +++++++++++-------- hw/sd/sd.c | 62 ++++++++++++++++++++++++++++++---------------- 3 files changed, 71 insertions(+), 39 deletions(-) diff --git a/include/hw/sd/sd.h b/include/hw/sd/sd.h index d12f24955a5..2162fb58402 100644 --- a/include/hw/sd/sd.h +++ b/include/hw/sd/sd.h @@ -107,22 +107,30 @@ struct SDCardClass { size_t (*do_command)(SDState *sd, SDRequest *req, uint8_t *resp, size_t respsz); /** - * Write a byte to a SD card. + * Write data to a SD card. * @sd: card - * @value: byte to write + * @value: data to write + * @len: length of data * - * Write a byte on the data lines of a SD card. + * Write data on the data lines of a SD card. May write not all data, = in + * which case it should be called again. At least one byte must be con= sumed. + * + * Return: number of bytes actually written. >=3D 1 */ - void (*write_byte)(SDState *sd, uint8_t value); + size_t (*write_data)(SDState *sd, const void *buf, size_t len); /** * Read a byte from a SD card. * @sd: card + * @buf: buffer to receive the data + * @len: size of data to read * - * Read a byte from the data lines of a SD card. + * Read data from the data lines of a SD card. This may not read all + * requested data, in this case it should be called again with the rem= aining + * buffer. At least one byte must be read. * - * Return: byte value read + * Return: number of bytes actually read. >=3D 1 */ - uint8_t (*read_byte)(SDState *sd); + size_t (*read_data)(SDState *sd, void* buf, size_t len); bool (*receive_ready)(SDState *sd); bool (*data_ready)(SDState *sd); void (*set_voltage)(SDState *sd, uint16_t millivolts); diff --git a/hw/sd/core.c b/hw/sd/core.c index 3568a81e809..594c5e011ba 100644 --- a/hw/sd/core.c +++ b/hw/sd/core.c @@ -113,21 +113,24 @@ void sdbus_write_byte(SDBus *sdbus, uint8_t value) if (card) { SDCardClass *sc =3D SDMMC_COMMON_GET_CLASS(card); =20 - sc->write_byte(card, value); + sc->write_data(card, &value, 1); } } =20 void sdbus_write_data(SDBus *sdbus, const void *buf, size_t length) { SDState *card =3D get_card(sdbus); - const uint8_t *data =3D buf; =20 if (card) { SDCardClass *sc =3D SDMMC_COMMON_GET_CLASS(card); =20 - for (size_t i =3D 0; i < length; i++) { - trace_sdbus_write(sdbus_name(sdbus), data[i]); - sc->write_byte(card, data[i]); + while (length > 0) { + size_t written =3D sc->write_data(card, buf, length); + + g_assert(written >=3D 1); + + buf +=3D written; + length -=3D written; } } } @@ -140,7 +143,7 @@ uint8_t sdbus_read_byte(SDBus *sdbus) if (card) { SDCardClass *sc =3D SDMMC_COMMON_GET_CLASS(card); =20 - value =3D sc->read_byte(card); + sc->read_data(card, &value, 1); } trace_sdbus_read(sdbus_name(sdbus), value); =20 @@ -150,14 +153,17 @@ uint8_t sdbus_read_byte(SDBus *sdbus) void sdbus_read_data(SDBus *sdbus, void *buf, size_t length) { SDState *card =3D get_card(sdbus); - uint8_t *data =3D buf; =20 if (card) { SDCardClass *sc =3D SDMMC_COMMON_GET_CLASS(card); =20 - for (size_t i =3D 0; i < length; i++) { - data[i] =3D sc->read_byte(card); - trace_sdbus_read(sdbus_name(sdbus), data[i]); + while (length > 0) { + size_t read =3D sc->read_data(card, buf, length); + + g_assert(read >=3D 1); + + buf +=3D read; + length -=3D read; } } } diff --git a/hw/sd/sd.c b/hw/sd/sd.c index ebe6e35b15e..c0b89735f69 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -2639,30 +2639,37 @@ static bool sd_generic_read_byte(SDState *sd, uint8= _t *value) return false; } =20 -static void sd_write_byte(SDState *sd, uint8_t value) +static size_t sd_write_data(SDState *sd, const void *buf, size_t length) { unsigned int partition_access; int i; + const uint8_t *value =3D buf; =20 if (!sd->blk || !blk_is_inserted(sd->blk)) { - return; + return length; } =20 if (sd->state !=3D sd_receivingdata_state) { qemu_log_mask(LOG_GUEST_ERROR, "%s: not in Receiving-Data state\n", __func__); - return; + return length; } =20 if (sd->card_status & (ADDRESS_ERROR | WP_VIOLATION)) - return; + return length; + + /* + * Only read one byte at a time. We will be called again with the + * remaining. + */ + length =3D 1; =20 trace_sdcard_write_data(sd->proto->name, sd->last_cmd_name, - sd->current_cmd, sd->data_offset, value); + sd->current_cmd, sd->data_offset, value[0]); switch (sd->current_cmd) { case 24: /* CMD24: WRITE_SINGLE_BLOCK */ - if (sd_generic_write_byte(sd, value)) { + if (sd_generic_write_byte(sd, value[0])) { /* TODO: Check CRC before committing */ sd->state =3D sd_programming_state; sd_blk_write(sd, sd->data_start, sd->data_offset); @@ -2687,7 +2694,7 @@ static void sd_write_byte(SDState *sd, uint8_t value) } } } - sd->data[sd->data_offset++] =3D value; + sd->data[sd->data_offset++] =3D value[0]; if (sd->data_offset >=3D sd->blk_len) { /* TODO: Check CRC before committing */ sd->state =3D sd_programming_state; @@ -2717,7 +2724,7 @@ static void sd_write_byte(SDState *sd, uint8_t value) break; =20 case 26: /* CMD26: PROGRAM_CID */ - if (sd_generic_write_byte(sd, value)) { + if (sd_generic_write_byte(sd, value[0])) { /* TODO: Check CRC before committing */ sd->state =3D sd_programming_state; for (i =3D 0; i < sizeof(sd->cid); i ++) @@ -2735,7 +2742,7 @@ static void sd_write_byte(SDState *sd, uint8_t value) break; =20 case 27: /* CMD27: PROGRAM_CSD */ - if (sd_generic_write_byte(sd, value)) { + if (sd_generic_write_byte(sd, value[0])) { /* TODO: Check CRC before committing */ sd->state =3D sd_programming_state; for (i =3D 0; i < sizeof(sd->csd); i ++) @@ -2758,7 +2765,7 @@ static void sd_write_byte(SDState *sd, uint8_t value) break; =20 case 42: /* CMD42: LOCK_UNLOCK */ - if (sd_generic_write_byte(sd, value)) { + if (sd_generic_write_byte(sd, value[0])) { /* TODO: Check CRC before committing */ sd->state =3D sd_programming_state; sd_lock_command(sd); @@ -2768,36 +2775,47 @@ static void sd_write_byte(SDState *sd, uint8_t valu= e) break; =20 case 56: /* CMD56: GEN_CMD */ - sd_generic_write_byte(sd, value); + sd_generic_write_byte(sd, value[0]); break; =20 default: g_assert_not_reached(); } + + return length; } =20 -static uint8_t sd_read_byte(SDState *sd) +static size_t sd_read_data(SDState *sd, void *buf, size_t length) { /* TODO: Append CRCs */ const uint8_t dummy_byte =3D 0x00; unsigned int partition_access; - uint8_t ret; uint32_t io_len; + uint8_t *value =3D buf; =20 if (!sd->blk || !blk_is_inserted(sd->blk)) { - return dummy_byte; + memset(buf, dummy_byte, length); + return length; } =20 if (sd->state !=3D sd_sendingdata_state) { qemu_log_mask(LOG_GUEST_ERROR, "%s: not in Sending-Data state\n", __func__); - return dummy_byte; + memset(buf, dummy_byte, length); + return length; } =20 if (sd->card_status & (ADDRESS_ERROR | WP_VIOLATION)) { - return dummy_byte; + memset(buf, dummy_byte, length); + return length; } =20 + /* + * We will only read one byte at a time. We will be called again with = the + * remaining buffer. + */ + length =3D 1; + io_len =3D sd_blk_len(sd); =20 trace_sdcard_read_data(sd->proto->name, @@ -2815,7 +2833,7 @@ static uint8_t sd_read_byte(SDState *sd) case 30: /* CMD30: SEND_WRITE_PROT */ case 51: /* ACMD51: SEND_SCR */ case 56: /* CMD56: GEN_CMD */ - sd_generic_read_byte(sd, &ret); + sd_generic_read_byte(sd, value); break; =20 case 18: /* CMD18: READ_MULTIPLE_BLOCK */ @@ -2832,7 +2850,7 @@ static uint8_t sd_read_byte(SDState *sd) sd_blk_read(sd, sd->data_start, io_len); } } - ret =3D sd->data[sd->data_offset ++]; + *value =3D sd->data[sd->data_offset++]; =20 if (sd->data_offset >=3D io_len) { sd->data_start +=3D io_len; @@ -2851,10 +2869,10 @@ static uint8_t sd_read_byte(SDState *sd) default: qemu_log_mask(LOG_GUEST_ERROR, "%s: DAT read illegal for command %= s\n", __func__, sd->last_cmd_name); - return dummy_byte; + *value =3D dummy_byte; } =20 - return ret; + return length; } =20 static bool sd_receive_ready(SDState *sd) @@ -3196,8 +3214,8 @@ static void sdmmc_common_class_init(ObjectClass *klas= s, const void *data) sc->get_dat_lines =3D sd_get_dat_lines; sc->get_cmd_line =3D sd_get_cmd_line; sc->do_command =3D sd_do_command; - sc->write_byte =3D sd_write_byte; - sc->read_byte =3D sd_read_byte; + sc->write_data =3D sd_write_data; + sc->read_data =3D sd_read_data; sc->receive_ready =3D sd_receive_ready; sc->data_ready =3D sd_data_ready; sc->get_inserted =3D sd_get_inserted; --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567009; cv=none; d=zohomail.com; s=zohoarc; b=YTKeUtMdS1o7BiMu/AUCjsxxiiHxnrcoTjaThcQQ/nHg++eFhZG7xF1DnkbxC/snPHMc/pnvldX2Q/6OplO/14LIL/B08PHThiNl7dO1JOZmw/VpIQMLn8svxAcjc/aLxGLRQGoKXMuT/g3S0VQu3FB/oEFpaDK0hh1NHBrpQ8k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567009; 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=EQnBp7Gj5TcacccipAB/n9mwbGRUt4USwHdRZECWo90=; b=gduGhd7/losHrFMxlBVRj0JC7xw8lkNwEwgx4JfLgqxdtZD+jNzlX1UDCbLYN7RcEVNNmiZRxYaRsoMn8B0yr4PUHf8m046kuPv6tfd7vZwy04cxwUh0AvibrON/jND1HqqQYzd4u+Ne90s3KSA7JpxgCxQa4KJk82+4dE0B9Go= 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 177856700943513.886283251546956; Mon, 11 May 2026 23:23:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgVz-0000qS-FL; Tue, 12 May 2026 02:22:47 -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 1wMgVk-0000gA-B6 for qemu-devel@nongnu.org; Tue, 12 May 2026 02:22:32 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wMgVh-00049x-VG for qemu-devel@nongnu.org; Tue, 12 May 2026 02:22:31 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-44b330c5cc6so3704846f8f.1 for ; Mon, 11 May 2026 23:22:29 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4549120eb95sm29571592f8f.20.2026.05.11.23.22.26 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:22:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778566947; x=1779171747; 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; bh=EQnBp7Gj5TcacccipAB/n9mwbGRUt4USwHdRZECWo90=; b=j8Om0IbxselFUDMQTowKTxHgsRuE9LAt9cj517PsMOaSR5ob6kfwTX4LZ7G5ekgqG6 Kb9Y1tLR3u0cW2B900LkYcTKkmE/dGs6/gREdxvKP8AxzJsky5RzWUFwjwZCtoDOym5Q +ipK9j+gbCGiksuj/wJN6I6PbnZUFO08Z/W9geVlN8+9V/+fDfihqLjBMdEPBd1zUscy noqXR6X0ToSWEFI0hwSRuZr1xTaM8V3VJ++xWM0mINwHFRqh9/K/M61vMT1muUtYu+QH DXogtcMn5ZvNlpz7DwiTotBWWtN0tO9wi09T5W+CqcJbjsEfYWZsoChKWv7OnWB7d3II YM+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778566947; x=1779171747; 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; bh=EQnBp7Gj5TcacccipAB/n9mwbGRUt4USwHdRZECWo90=; b=NSoc6w7bv+a51glkSTsCCFaTXUYAGFwxRnUuEb2KeWspt1NHHWnUiOy5OGcDi63E5G ZYPXWHBG7Edvm8LlUmxTYfYSS1c2TnRhiElZ44KL9JgUy2PQYpqNZYC3/HPBQrqRMQPS jg+y3Je5Bu9z4BV5mIyD8SK1YahWPgo4MaUkVJfPaVHRolZ58DVizfTa/V0I8ZpdNWtT xqWs+N4JNs/gwHZB3cGHSF9bi7win9pu+HlIZ+RCpkIZWJo1aNqneav5qWYIJhLbbnCk xY62H3hUewaAEAzfnaaQ+isZ4sbON8XTLv0LAwlMwuRM1MbDP7zqi3alD9Du1UQa0qy3 h0zw== X-Gm-Message-State: AOJu0YzwAFUD9Wqi33eks31YPBUam1IjQ/gDEW+/6EAduTYe7h45K8Ds /Na1Dxvj0O0rZ7vp90qDK+vOYM/jK4VwUAYUVN2SzBBK/q2yT0amC9WNQ0yk5ooDhkcVCJYSiuc fgNltjfA= X-Gm-Gg: Acq92OGI6+4Cp1j3pvMv7c8vyQcVFLsm16/t/m6JE8mcFMEoEBxGMdksQg0y8dbqf7Y LnEda/wji8nUUV66WEObioT4ml2kilBcdU/3hd4P6OuSa75D3zCDuTgulbMRYpQaj/rk4URVycK 6RWa811tU1SK6ZoHv74t4K5FcyhDPg4h4kW3SuJv1E87nr3Jusk2a+ys0lkARx67rfCFa5LnAyj HPlhUmEqtfZSNR2b3TvntmGxs3VZlYEY8TeLJy6PP1yGGMCX5hChK4bEDILFaakB7cwGHqJnaJo 5M1PwDDfFNFDQ6+lUPpJ9u24lAwT/NL4Ovo++h2hx1UiAPC4PUmrpfkPBEBH2XJ1MCVq6lQn6EM gn/rK+1zhwnIs4mGgcLSruKkX2GQ4DYZHpGvLQrSP+nJ2hEVvqux3CrAzdDo1iPWzKJVj5m6w0T 9zfCqkvcTopaFeLdqpjrHkC7axBv9Dy4SL5TptYYprS0xphv9D9f1CYlAw7NOZlJ/aFbxUAvhS X-Received: by 2002:a05:6000:2386:b0:43f:e938:1e67 with SMTP id ffacd0b85a97d-4515d99fff7mr42996127f8f.38.1778566947377; Mon, 11 May 2026 23:22:27 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 06/41] hw/sd/sd: Allow multi-byte read/write for generic paths Date: Tue, 12 May 2026 08:21:07 +0200 Message-ID: <20260512062142.67998-7-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.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: 1778567011089158500 From: Christian Speich Paths that use sd_generic_write/read_data can now write/read multiple bytes with one call. Signed-off-by: Christian Speich Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20260417-sdcard-performance-b4-v4-2-119e66be10c2@avm.de> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/sd/sd.c | 62 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 27 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index c0b89735f69..b49b83b96e8 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1610,7 +1610,7 @@ static sd_rsp_type_t sd_cmd_optional(SDState *sd, SDR= equest req) return sd_illegal; } =20 -/* Configure fields for following sd_generic_write_byte() calls */ +/* Configure fields for following sd_generic_write_data() calls */ static sd_rsp_type_t sd_cmd_to_receivingdata(SDState *sd, SDRequest req, uint64_t start, size_t size) { @@ -1625,7 +1625,7 @@ static sd_rsp_type_t sd_cmd_to_receivingdata(SDState = *sd, SDRequest req, return sd_r1; } =20 -/* Configure fields for following sd_generic_read_byte() calls */ +/* Configure fields for following sd_generic_read_data() calls */ static sd_rsp_type_t sd_cmd_to_sendingdata(SDState *sd, SDRequest req, uint64_t start, const void *data, size_t size) @@ -2615,11 +2615,15 @@ send_response: } =20 /* Return true if buffer is consumed. Configured by sd_cmd_to_receivingdat= a() */ -static bool sd_generic_write_byte(SDState *sd, uint8_t value) +static bool sd_generic_write_data(SDState *sd, const void *buf, size_t *le= n) { - sd->data[sd->data_offset] =3D value; + size_t to_write =3D MIN(sd->data_size - sd->data_offset, *len); =20 - if (++sd->data_offset >=3D sd->data_size) { + memcpy(sd->data, buf, to_write); + sd->data_offset +=3D to_write; + *len =3D to_write; + + if (sd->data_offset >=3D sd->data_size) { sd->state =3D sd_transfer_state; return true; } @@ -2627,11 +2631,15 @@ static bool sd_generic_write_byte(SDState *sd, uint= 8_t value) } =20 /* Return true when buffer is consumed. Configured by sd_cmd_to_sendingdat= a() */ -static bool sd_generic_read_byte(SDState *sd, uint8_t *value) +static bool sd_generic_read_data(SDState *sd, void *buf, size_t *len) { - *value =3D sd->data[sd->data_offset]; + size_t to_read =3D MIN(sd->data_size - sd->data_offset, *len); =20 - if (++sd->data_offset >=3D sd->data_size) { + memcpy(buf, sd->data, to_read); + sd->data_offset +=3D to_read; + *len =3D to_read; + + if (sd->data_offset >=3D sd->data_size) { sd->state =3D sd_transfer_state; return true; } @@ -2658,18 +2666,12 @@ static size_t sd_write_data(SDState *sd, const void= *buf, size_t length) if (sd->card_status & (ADDRESS_ERROR | WP_VIOLATION)) return length; =20 - /* - * Only read one byte at a time. We will be called again with the - * remaining. - */ - length =3D 1; - trace_sdcard_write_data(sd->proto->name, sd->last_cmd_name, sd->current_cmd, sd->data_offset, value[0]); switch (sd->current_cmd) { case 24: /* CMD24: WRITE_SINGLE_BLOCK */ - if (sd_generic_write_byte(sd, value[0])) { + if (sd_generic_write_data(sd, buf, &length)) { /* TODO: Check CRC before committing */ sd->state =3D sd_programming_state; sd_blk_write(sd, sd->data_start, sd->data_offset); @@ -2681,6 +2683,12 @@ static size_t sd_write_data(SDState *sd, const void = *buf, size_t length) break; =20 case 25: /* CMD25: WRITE_MULTIPLE_BLOCK */ + /* + * Only read one byte at a time. We will be called again with the + * remaining. + */ + length =3D 1; + if (sd->data_offset =3D=3D 0) { /* Start of the block - let's check the address is valid */ if (!address_in_range(sd, "WRITE_MULTIPLE_BLOCK", @@ -2724,7 +2732,7 @@ static size_t sd_write_data(SDState *sd, const void *= buf, size_t length) break; =20 case 26: /* CMD26: PROGRAM_CID */ - if (sd_generic_write_byte(sd, value[0])) { + if (sd_generic_write_data(sd, buf, &length)) { /* TODO: Check CRC before committing */ sd->state =3D sd_programming_state; for (i =3D 0; i < sizeof(sd->cid); i ++) @@ -2742,7 +2750,7 @@ static size_t sd_write_data(SDState *sd, const void *= buf, size_t length) break; =20 case 27: /* CMD27: PROGRAM_CSD */ - if (sd_generic_write_byte(sd, value[0])) { + if (sd_generic_write_data(sd, buf, &length)) { /* TODO: Check CRC before committing */ sd->state =3D sd_programming_state; for (i =3D 0; i < sizeof(sd->csd); i ++) @@ -2765,7 +2773,7 @@ static size_t sd_write_data(SDState *sd, const void *= buf, size_t length) break; =20 case 42: /* CMD42: LOCK_UNLOCK */ - if (sd_generic_write_byte(sd, value[0])) { + if (sd_generic_write_data(sd, buf, &length)) { /* TODO: Check CRC before committing */ sd->state =3D sd_programming_state; sd_lock_command(sd); @@ -2775,7 +2783,7 @@ static size_t sd_write_data(SDState *sd, const void *= buf, size_t length) break; =20 case 56: /* CMD56: GEN_CMD */ - sd_generic_write_byte(sd, value[0]); + sd_generic_write_data(sd, buf, &length); break; =20 default: @@ -2810,12 +2818,6 @@ static size_t sd_read_data(SDState *sd, void *buf, s= ize_t length) return length; } =20 - /* - * We will only read one byte at a time. We will be called again with = the - * remaining buffer. - */ - length =3D 1; - io_len =3D sd_blk_len(sd); =20 trace_sdcard_read_data(sd->proto->name, @@ -2833,10 +2835,16 @@ static size_t sd_read_data(SDState *sd, void *buf, = size_t length) case 30: /* CMD30: SEND_WRITE_PROT */ case 51: /* ACMD51: SEND_SCR */ case 56: /* CMD56: GEN_CMD */ - sd_generic_read_byte(sd, value); + sd_generic_read_data(sd, buf, &length); break; =20 case 18: /* CMD18: READ_MULTIPLE_BLOCK */ + /* + * We will only read one byte at a time. We will be called again w= ith + * the remaining buffer. + */ + length =3D 1; + if (sd->data_offset =3D=3D 0) { if (!address_in_range(sd, "READ_MULTIPLE_BLOCK", sd->data_start, io_len)) { @@ -2869,7 +2877,7 @@ static size_t sd_read_data(SDState *sd, void *buf, si= ze_t length) default: qemu_log_mask(LOG_GUEST_ERROR, "%s: DAT read illegal for command %= s\n", __func__, sd->last_cmd_name); - *value =3D dummy_byte; + memset(buf, dummy_byte, length); } =20 return length; --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778566979; cv=none; d=zohomail.com; s=zohoarc; b=cLlVACXi8g+yW2kTcqk1WTSySDgOz+ddPj1eEBIIGQqNiqFOyDUw4pUkmdrcOmghzx1QL+QjWyNIDouS8QumGu8LyDtRqjP2MGBJ8ca2Dxj3rTICexjEMWdrZbcwr7sCEugcEOuJP5fZpDfwKs8+QG8knxr27uBORwTAa8/4Chc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778566979; 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=e9Ch+50Vvu+y+CEmf0cTw7Jm9O7lEL4i3plSrCUI1YE=; b=H/3xgXda2noCbyykryFckiHd6iULg48ERRGicIp8fjvpwY+pjjJYviBcnmCofQxCYGmD3NzUFI1D5u8eA81imXRM5Q8q+mgZsSzFOtHLJilqAIx9+TXjs0A0ugKmPYYhaeFO3Z0qwdvuCv/m/WmZ8zEs+PpK1yh/sh3/X9GY5H0= 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 1778566979248516.6194273254059; Mon, 11 May 2026 23:22:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgW0-0000s2-VX; Tue, 12 May 2026 02:22:49 -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 1wMgVu-0000mG-T0 for qemu-devel@nongnu.org; Tue, 12 May 2026 02:22:43 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wMgVp-0004Be-Ik for qemu-devel@nongnu.org; Tue, 12 May 2026 02:22:41 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-43eb05b1875so2991388f8f.3 for ; Mon, 11 May 2026 23:22:36 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-454919c13c9sm29754513f8f.27.2026.05.11.23.22.33 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:22:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778566954; x=1779171754; 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; bh=e9Ch+50Vvu+y+CEmf0cTw7Jm9O7lEL4i3plSrCUI1YE=; b=CbS+akE5Xl2unl07VpifiTJtiyh1P7YDmxUF1qH6lxeTPoO8XzR3Ct9Ig7PjpWn/HA Nx1IeRgI1wagsXJpE4kVSZpZZ3Wuac7BMP6WlXGoZ/HANZbawEh2pxtguN8GBlaMH90i y1xII2bucDg3QnFtlJj88UvxyewNYs3+qUeSNsMIgurp2KP6B14rMOyORIR1CDFC6CqM pk8a1JJS3YZd0fHLLGb3qGDz1VXtvsreYdv7CEmtlYaVeKYN8BuZEtG81nRIs/cd3AH4 n4TG6Tf6UGuoKeE1ZWJGjwfMl7D6Z+AKmQTx7/owcnzIFaW9dsZ0mWKF53cUY9ySaOwM 43xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778566954; x=1779171754; 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; bh=e9Ch+50Vvu+y+CEmf0cTw7Jm9O7lEL4i3plSrCUI1YE=; b=f0/o4oRUUnqi+mfwq5qm3vpPf92Qi0dSjRYZ8FVy3lL6ipZxyWsFo0vRTpIfPQ+2sl Ky8aNPxhN6YQTTk0BYC+8UisfaaUtgowC8kZT3HeqZ/UFpW3ruFB8KwSCbJTKEVZmAcX CfEk4dhGiQkPlr/IJOEYwjk/P6UWeFtdJ2o6o9aGMV/073jeooF7nA6tXKi2Wctf2o17 ubpKC5TgnJJVwGP0Ep8UO6noN75FOEwxuN30hmtmaqQ5lO8hlwHNTRLqvqMpKXT8tzJv yCSlQAtK15bZPxHVjPmXQRXSJyiWgLa8RZHleNWb5BVKZq1LGO7coe3rvxOTktI/1kyz NLwQ== X-Gm-Message-State: AOJu0Ywnof2oPsf8PMPgLrYOXF8KJt+BXnif+OaCB+bvKiztz2jOOeyL DyG3ZBw7Y6gFcep7Gjk9TSfVm+vDBNroginp4MPHWeaBq2R9vrfwnm1mpJIYH+yG6bcyQB5Iitk NET4hnjU= X-Gm-Gg: Acq92OGxc/7khK8Bwy77liwXwHcRoe7O+qnCFq08ygmdgpbjA9FNJZMlO8RIJfrsQvM lFMuyd7ciGhWRglvdTMLAd0eXAc4tJ2ASYXLHI/FbADzAy1a15eRtE5dZ09v+tHj2T7Ec/LZTvl 9J6t5qwsCUcZHy1uz53TBwdXZiQAj9VNS5hC6tFO3sVmIrMotNFh/dGrzEogpUYgtSMKIfBCUOP MUosT9QQGo2H1VTHTZIX8vuWTe5O0KctB2lypPYREFqpgf5NwNutZPD50ABjhnEDXxLfspR6NtE BHgjR3RvMHv3EmGHkludVjTr6kYYzE8nfSLaFcz3tjC4A7QYjc9eK7NZQpOEzZIMe8SdPdo+2JE rZGPFF0CRRmZO9b4cxwZ0kfdaqlB8dQHAEauAJwI/ZgvL5Q1c+rYJL8Yiah34z1tsO5vdhL50fW LZLl1JTjNIRoA00juZRqyhB/xD8lktDDKntbPnSuUIjjpWAVehhC4RNeqlWWsggC0vw8d0x4g1 X-Received: by 2002:a05:6000:2903:b0:455:d927:1b30 with SMTP id ffacd0b85a97d-4568c47c928mr18374538f8f.28.1778566954310; Mon, 11 May 2026 23:22:34 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 07/41] hw/sd: Update trace events for buf+len data Date: Tue, 12 May 2026 08:21:08 +0200 Message-ID: <20260512062142.67998-8-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.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: 1778566981846154100 From: Christian Speich After switching sdbuf and sdcard over to use buf+len instead of single byte operation, the trace events need to be updated. This patch updates sdbus_{read,write} and sdcard_write_data to output the buffer that is worked on. sdcard_read_data is left unchanged, as it did not print the read byte before anyways. Signed-off-by: Christian Speich Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20260417-sdcard-performance-b4-v4-7-119e66be10c2@avm.de> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/sd/core.c | 27 +++++++++++++++++++++++++-- hw/sd/sd.c | 18 +++++++++++++++--- hw/sd/trace-events | 6 +++--- 3 files changed, 43 insertions(+), 8 deletions(-) diff --git a/hw/sd/core.c b/hw/sd/core.c index 594c5e011ba..eaa186fbfca 100644 --- a/hw/sd/core.c +++ b/hw/sd/core.c @@ -24,6 +24,7 @@ #include "hw/sd/sd.h" #include "qemu/module.h" #include "qapi/error.h" +#include "qemu/cutils.h" #include "sdmmc-internal.h" #include "trace.h" =20 @@ -43,6 +44,26 @@ static SDState *get_card(SDBus *sdbus) return SDMMC_COMMON(kid->child); } =20 +static void sdbus_write_dump(const char *bus_name, const void *buf, size_t= len) +{ + g_autoptr(GString) str =3D NULL; + + if (trace_event_get_state_backends(TRACE_SDBUS_WRITE)) { + str =3D qemu_hexdump_line(NULL, buf, len, 8, 0); + trace_sdbus_write(bus_name, str->str); + } +} + +static void sdbus_read_dump(const char *bus_name, const void *buf, size_t = len) +{ + g_autoptr(GString) str =3D NULL; + + if (trace_event_get_state_backends(TRACE_SDBUS_READ)) { + str =3D qemu_hexdump_line(NULL, buf, len, 8, 0); + trace_sdbus_read(bus_name, str->str); + } +} + uint8_t sdbus_get_dat_lines(SDBus *sdbus) { SDState *slave =3D get_card(sdbus); @@ -109,7 +130,7 @@ void sdbus_write_byte(SDBus *sdbus, uint8_t value) { SDState *card =3D get_card(sdbus); =20 - trace_sdbus_write(sdbus_name(sdbus), value); + sdbus_write_dump(sdbus_name(sdbus), &value, 1); if (card) { SDCardClass *sc =3D SDMMC_COMMON_GET_CLASS(card); =20 @@ -121,6 +142,7 @@ void sdbus_write_data(SDBus *sdbus, const void *buf, si= ze_t length) { SDState *card =3D get_card(sdbus); =20 + sdbus_write_dump(sdbus_name(sdbus), buf, length); if (card) { SDCardClass *sc =3D SDMMC_COMMON_GET_CLASS(card); =20 @@ -145,7 +167,7 @@ uint8_t sdbus_read_byte(SDBus *sdbus) =20 sc->read_data(card, &value, 1); } - trace_sdbus_read(sdbus_name(sdbus), value); + sdbus_read_dump(sdbus_name(sdbus), &value, 1); =20 return value; } @@ -166,6 +188,7 @@ void sdbus_read_data(SDBus *sdbus, void *buf, size_t le= ngth) length -=3D read; } } + sdbus_read_dump(sdbus_name(sdbus), buf, length); } =20 bool sdbus_receive_ready(SDBus *sdbus) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index b49b83b96e8..92cf8aed58f 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -2647,6 +2647,18 @@ static bool sd_generic_read_data(SDState *sd, void *= buf, size_t *len) return false; } =20 +static void sdcard_write_data_dump(const char *proto, const char *cmd_desc, + uint8_t cmd, uint32_t offset, + const void *buf, size_t len) +{ + g_autoptr(GString) str =3D NULL; + + if (trace_event_get_state_backends(TRACE_SDCARD_WRITE_DATA)) { + str =3D qemu_hexdump_line(NULL, buf, len, 8, 0); + trace_sdcard_write_data(proto, cmd_desc, cmd, offset, str->str); + } +} + static size_t sd_write_data(SDState *sd, const void *buf, size_t length) { unsigned int partition_access; @@ -2666,9 +2678,9 @@ static size_t sd_write_data(SDState *sd, const void *= buf, size_t length) if (sd->card_status & (ADDRESS_ERROR | WP_VIOLATION)) return length; =20 - trace_sdcard_write_data(sd->proto->name, - sd->last_cmd_name, - sd->current_cmd, sd->data_offset, value[0]); + sdcard_write_data_dump(sd->proto->name, + sd->last_cmd_name, + sd->current_cmd, sd->data_offset, buf, length); switch (sd->current_cmd) { case 24: /* CMD24: WRITE_SINGLE_BLOCK */ if (sd_generic_write_data(sd, buf, &length)) { diff --git a/hw/sd/trace-events b/hw/sd/trace-events index 4ec52d2a819..c6811f3a08e 100644 --- a/hw/sd/trace-events +++ b/hw/sd/trace-events @@ -15,8 +15,8 @@ bcm2835_sdhost_update_irq(uint32_t irq) "IRQ bits 0x%x" =20 # core.c sdbus_command(const char *bus_name, uint8_t cmd, uint32_t arg) "@%s CMD%02= d arg 0x%08x" -sdbus_read(const char *bus_name, uint8_t value) "@%s value 0x%02x" -sdbus_write(const char *bus_name, uint8_t value) "@%s value 0x%02x" +sdbus_read(const char *bus_name, const char *hexdump) "@%s data %s" +sdbus_write(const char *bus_name, const char *hexdump) "@%s data %s" sdbus_set_voltage(const char *bus_name, uint16_t millivolts) "@%s %u (mV)" sdbus_get_dat_lines(const char *bus_name, uint8_t dat_lines) "@%s dat_line= s: %u" sdbus_get_cmd_line(const char *bus_name, bool cmd_line) "@%s cmd_line: %u" @@ -54,7 +54,7 @@ sdcard_unlock(void) "" sdcard_req_addr(uint32_t req_arg, uint64_t addr) "req 0x%" PRIx32 " addr 0= x%" PRIx64 sdcard_read_block(uint64_t addr, uint32_t len) "addr 0x%" PRIx64 " size 0x= %x" sdcard_write_block(uint64_t addr, uint32_t len) "addr 0x%" PRIx64 " size 0= x%x" -sdcard_write_data(const char *proto, const char *cmd_desc, uint8_t cmd, ui= nt32_t offset, uint8_t value) "%s %20s/ CMD%02d ofs %"PRIu32" value 0x%02x" +sdcard_write_data(const char *proto, const char *cmd_desc, uint8_t cmd, ui= nt32_t offset, const char *hexdump) "%s %20s/ CMD%02d ofs %"PRIu32" data %s" sdcard_read_data(const char *proto, const char *cmd_desc, uint8_t cmd, uin= t32_t offset, uint64_t size, uint32_t blklen) "%s %20s/ CMD%02d ofs %"PRIu3= 2" size %"PRIu64" blklen %" PRIu32 sdcard_set_voltage(uint16_t millivolts) "%u mV" sdcard_ext_csd_update(unsigned index, uint8_t oval, uint8_t nval) "index %= u: 0x%02x -> 0x%02x" --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567356; cv=none; d=zohomail.com; s=zohoarc; b=FG0s8TncI/M4MjGcooicpMFcOsb/QCRgvmR8VDDkyETvLn8Zh3soleqD7JS6TLW3jtdXykOu2VPfQxGL7ycBnmllTp5U98Tw4w1ykgi1q9TWjzoC+3YrbZElWu8Ym6Bi7Mxi3/HBeQKVtlD2CmcmSvUDi6n/JdfSesYmFvcirGo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567356; 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=HJjHhanPxzEzFP7iU69XomdUjQFJLtfEo/O85wyJQto=; b=kI9cvx72uUEUHgRzkRyySKNcY1H2TkMvLBXbIplY8wV/YvO39Q0F0E/+d7W5ONbFEHvK0u8n450xxy3IHi4T55vHFuxB4Tyf0ZSzjH8FP1u68jwKhIzC/syZcjRV3TGYvMoKhQvkpUZCwsxzFaD4cGHhAQ982pcgdFMaYMGk1q0= 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 177856735675749.58324580950341; Mon, 11 May 2026 23:29:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgW4-0000u2-Rw; Tue, 12 May 2026 02:22:54 -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 1wMgW1-0000sl-3c for qemu-devel@nongnu.org; Tue, 12 May 2026 02:22:49 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wMgVw-0004KH-OB for qemu-devel@nongnu.org; Tue, 12 May 2026 02:22:48 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-488ba840146so45138675e9.1 for ; Mon, 11 May 2026 23:22:43 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48e908d2c77sm23515565e9.12.2026.05.11.23.22.39 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:22:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778566961; x=1779171761; 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; bh=HJjHhanPxzEzFP7iU69XomdUjQFJLtfEo/O85wyJQto=; b=aVsmIv6hkPN9Td+//YW39dJ0HMHcacFlTl0q4X1yN3PJBtikuw3Gs3VI/Hfzq2IVfA PID2gFjnJdGLvk4+RKhVBSoqH86TpVxQVWZQKE2VI1omrq1N90IMhuroSEFn2Mfx+ZYf RTAx0zfHHFS/Hrdl/QNqJaqi8MT5un+1ndkzZL2l3KAbyY/UsvEUc/SVpRzgdklZZRC0 c9p9pQhk6uPt3nmOPxkL9dCZQDdEE9Udj6wVgAKN0AXGQMwJF2zMoi6fI6yz/myQiUgx 5RxKMAt+4Hm+/Af6PhR1FV9eViwuA3M0n+a1vEPBc+Cuqs5Lm2GyY1ZynU6TBO0utxF8 Gbpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778566961; x=1779171761; 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; bh=HJjHhanPxzEzFP7iU69XomdUjQFJLtfEo/O85wyJQto=; b=e7L4byBA50N2I5JMYP8EkIkdX0kK3CrBrfonjfOckiAsGv379cWxqEjFJhtfM6uOtH KoIwr25WCjY9H6Eay9idX4zyzq7pTOSPGXaioPqoCBw/212sZ0/GX2/rfkon5EcXT2tY YPgOTT3tyJlmCLHiwhmzx96wxiqOfVWRqTUOKvZq4b+l2NR8QPu6dEn1RoL21kfx4iHk NRNZEXKjug+VaRaO8UEZPcF04NRv3hS0LpdgQb5WO4ibxdwpRxRZb+apLmGXAiRtLAQv Xq/8WqZdSeyZDVvXa/qWF0DaS8q46Ibrk8TVUmLtM5449kXYISd9ytcLYi7BvMFdJMc9 nUag== X-Gm-Message-State: AOJu0YxwnsS4h5Z87R1JSrwF4lawjpj53fcfZtRDVzZvpM49NhfqEh+Z 5dNIq2kikZuGq7O9bEdihoXUOu1cogxg0gpOdbDC7uq1zouIpQ5tROkH+WKkLE7dZ21cn1KhX9G gY9HH5jc= X-Gm-Gg: Acq92OGvXQYz8sbB5Cta8ixqaposZl1CjqGNqQYfl+hugldYdRKSc7NW3JZltndvA07 LGMgzZzEhrE3ZSgtl+DP7ABhmQE/QvSar0pF1r8x/en693qP0y/h75wpJdATSkYhjEzK99YxVUy ZrC4o36dA80sirToFe0Svc+/T9mPCJMiEMVWTHvGDXCnwy+yvTjrltOHsgOsU3FiXnLe4WN9Llv XXqy9ejUJjGaG+f3IgcpOnlR9Lb6oHIirlUtY8nhe89I2SWwqxHyle8SSCaXJuZLjLVCRVIKW50 w7uyGgF2MVWLuK6MCgu1T4IDOdrlPyHYg7Gq5s6TOX15uMxMWS2GnxxQWRX7jIQrtiDc8SkMi/h xmGNFst0VKOKx9iQQq+0SZQ/36op78oPE4YxRVb6S4rpCJHvokg6w3PE95yqimNHQdQLz/o5Gmg keU2teiZSrPOL3KbxD3Fg2YBYmTy5vOgT3JcAeoNHezZsK+G6CDxVSdhoJtuJbbiUI1T1GgC26P IsqEizejwg= X-Received: by 2002:a05:600c:8289:b0:489:201c:dc46 with SMTP id 5b1f17b1804b1-48e8fe52c6bmr22077815e9.12.1778566961291; Mon, 11 May 2026 23:22:41 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 08/41] MAINTAINERS: Step up to maintain core machine code Date: Tue, 12 May 2026 08:21:09 +0200 Message-ID: <20260512062142.67998-9-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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: 1778567358300154100 The 'Machine core' section is orphan. Being acquainted with the code, step up to maintain it. Cc: Paolo Bonzini Cc: Igor Mammedov Cc: Yanan Wang Cc: Eduardo Habkost Cc: Marcel Apfelbaum Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Thomas Huth Message-Id: <20260417110550.70068-3-philmd@linaro.org> --- MAINTAINERS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 93a1e4e4822..488d194a41e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2037,9 +2037,9 @@ F: include/hw/i386/nitro_enclave.h F: docs/system/i386/nitro-enclave.rst =20 Machine core -R: Philippe Mathieu-Daud=C3=A9 +M: Philippe Mathieu-Daud=C3=A9 R: Zhao Liu -S: Supported +S: Maintained F: hw/core/cpu-common.c F: hw/core/cpu-system.c F: hw/core/machine-qmp-cmds.c --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567004; cv=none; d=zohomail.com; s=zohoarc; b=BjTNlqLTdKZ2XuX2O6FTVrmnm2UkBkKfRlSdNGk11nFRaaP66gODHU5JzkBTKAZTyrZzl1Q4XliJHHt+IGblSQcvZsnkmrxKsz4ruutJgfqNXhaPDDFJYtjDzv6ZoiZM9FBTeyuIl2jVr6p4RS9/aHCly0Bfd16EuKvkyYcbZV4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567004; 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=QJ4OaOCleUomCfnEQePhfE9b7I0kuoQqmAJfKtFe8LA=; b=NX91mEOLG4tFD5IUMfalnzGC0zAvTGUNguCM0c5CscyNmRpmdJip0pMgy9ngdG5f1Tpk1Ln/awz4UU4oufv6fQ3C6ajrVvaiN/kcvt/LHvKgW9wUr+XsybquYwG3P3o2epN3bJJ48vhGYAIsL96Jdm8kzYw/VCIryLlnwfthSnM= 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 1778567004143266.4819679819989; Mon, 11 May 2026 23:23:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgWA-0000xU-A5; Tue, 12 May 2026 02:23:00 -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 1wMgW5-0000uL-1P for qemu-devel@nongnu.org; Tue, 12 May 2026 02:22:54 -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 1wMgW3-0004dR-5F for qemu-devel@nongnu.org; Tue, 12 May 2026 02:22:52 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-48e6db3ff7eso17230515e9.0 for ; Mon, 11 May 2026 23:22:50 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48e8f540aecsm10188135e9.33.2026.05.11.23.22.47 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:22:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778566968; x=1779171768; 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; bh=QJ4OaOCleUomCfnEQePhfE9b7I0kuoQqmAJfKtFe8LA=; b=v5Hgcv/TcuklyuANxPEOfncWi9GQeLP8WRb4+Lyne04Rnt7A3mpFhvbAcH5z/JFI/e sJFSn4hgAn2uoA1IXYOFGOVxrcBM1urFLY5J1TbEnF55kQviTyvdrm1XFI+f9ggYGg0e IasISirGZrn6PcKzseEAOx7+E5UgoaVADBsfTCwAEqkinr6l2gTclC+r792FrZh5RDOj 9WQXICGaCvXkgYC9b4k0htTCoWF59eYN1BhjW1eVkEo5sywB6Q3eayIClroMCJgnyJb+ ErUvAdJhVKJA1tNfg39WMd4WNFuB5mekerkEN67eiYGGBw7wmjJ0brjgvx9Sn59zNPS0 9nNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778566968; x=1779171768; 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; bh=QJ4OaOCleUomCfnEQePhfE9b7I0kuoQqmAJfKtFe8LA=; b=MqX8kI7dSCVdqicom/K7R7Q8wdDxbsic5/h+holgHJe2XOxYX/2tUz4VC3et1Tldk/ dpzx7LyQERPxcpoHUo0cAyg5cwk9kOWjurzfYnMDUXNjLv4Ckjrta3CgYaX1WgA6gwkf jGmC2bWttrT0USrw5FnuintfGRRIZ3SlzX6PO+dEZ2J64JSHTusEtfbpSn7W3wEstwlK VyJ8Nt/sITfFYs3R+wSNE5OjdTNkdS0CabHi108C9MRCxoz4I0OayNhH2WIAF5ob/T+h A19+4dEMpmgyejGyYV51i59rvdMj4IAtxr3h8GpjtNbh8t3hyiv7rAtvHcx6GDosTbKb 8pGg== X-Gm-Message-State: AOJu0Yw3l1He54Ww9fDOBmNruEUdtfbMtJbD8aL1XeS4CAgvbJZX4QmX 1Dgkjj0i+OL2Q5A5ngw/i6u+g+f87t4y+7Z3g/mDps081GLvzvfX2JgxNPEXsIdaEBHUj2XQLCY nagz8afQ= X-Gm-Gg: Acq92OFpIq5gdKUJ+i+O/M7MJTkSGGpF9dWh3Ghh+GsDzZrmQynLZOzc+Kin7qq8cjG /l9GME33512LiTdzAbrUyEhcccnh5ajnh5m4Q7L5EFxD+66E7PTImXLCOFuuXNpzxVkhjrACahx W7I0dF4RN4dhv+/XdLZRyXVP1QXYuWkM1F9jRqxBpG23uNysB6dhuvb3pGysabjjKXDmTi0hOOr aq+C8IzOO+EMht7HPsf22eCfU0rnQgVlCdODvSB3et79ekJTLD2KZyTxWJAuFLS6U7Zp82AIJjM hqVnlXgMLEYiYpZnRzI7m+xM9WxzEx/NJjUhPpw6RRDJpv9WuQLUTCm4/XJ3ptN3cX9ZjnBvoYE txSn9E6ZbmUXgdW1bzjSdcN/v68HnUPUCn31511WshD3v1gThQUXuDmf7y1Ik8Jpve5FDNvZ0bl nR5jP+2ZsBJtiJTk26TFCT/rD0+32vbW06g6RLMqHg+4xgcnouV0vdRdcnwBLHOKW80wRk9EtR X-Received: by 2002:a05:600c:3111:b0:488:a723:ea53 with SMTP id 5b1f17b1804b1-48e8fe509f1mr20910895e9.7.1778566968195; Mon, 11 May 2026 23:22:48 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 09/41] vdpa: Allow VDPA to work on big-endian machine Date: Tue, 12 May 2026 08:21:10 +0200 Message-ID: <20260512062142.67998-10-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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::330; envelope-from=philmd@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: 1778567004945158500 From: Konstantin Shkolnyy After commit 0caed25cd171 vhost_vdpa_net_load_vlan() started seeing VIRTIO_NET_F_CTRL_VLAN flag and making 4096 calls to the kernel with VIRTIO_NET_CTRL_VLAN_ADD command. However, it forgot to convert the 16-bit VLAN IDs to LE format. On BE machine, the kernel calls failed when they saw "VLAN IDs" greater than 4095, and QEMU then said: "unable to start vhost net: 5: falling back on userspace virtio", and VDPA became disabled. Convert the VLAN ID to LE before putting it into virtio queue. Fixes: 8f7e9967484d ("vdpa: Restore vlan filtering state") Signed-off-by: Konstantin Shkolnyy Acked-by: Jason Wang Acked-by: Eugenio P=C3=A9rez Reviewed-by: Akihiko Odaki Message-ID: <20260427144746.1498-1-kshk@linux.ibm.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- net/vhost-vdpa.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 3df6091274e..f1523697e20 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -1200,9 +1200,10 @@ static int vhost_vdpa_net_load_single_vlan(VhostVDPA= State *s, struct iovec *in_cursor, uint16_t vid) { + uint16_t vid_le =3D cpu_to_le16(vid); const struct iovec data =3D { - .iov_base =3D &vid, - .iov_len =3D sizeof(vid), + .iov_base =3D &vid_le, + .iov_len =3D sizeof(vid_le), }; ssize_t r =3D vhost_vdpa_net_load_cmd(s, out_cursor, in_cursor, VIRTIO_NET_CTRL_VLAN, --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567038; cv=none; d=zohomail.com; s=zohoarc; b=UUfQ/aa+WiTQ47gUAlzcZihxumgzJsGSZvaCClm2GZJ5dmId05QEn1O6KGzhWTaAYPj0uQOu923qLSOUU5pve5qHmZgBlORhfV0SOVX9iLsMODD4wuG0mgeBGCb9lFid63yQ9bqaMU1ePD3U6bUHx/ZLc/K3Q5VzuyFPNzELLE4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567038; 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=vwo87tkNpgYg6uZPVSFE7rtPPjY0Aoz+JdJG9zLwI60=; b=BOW1vD8bkjexVGpMWr0ICTl7e77F6gbSyeGn2icUT0rXrXdYFgqbp1VXHoazUQ20znXp+hkuem3uIHOei4NMNsKSSQRDgLhm4aqqQm+URsjxtnq99IYPes3jeHrt7RtJpq6WSDc9N/MO6yzIovBQGFqxlTfMdqz3cRd1U1CTORE= 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 1778567038742490.2258638698097; Mon, 11 May 2026 23:23:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgWK-00014J-5b; Tue, 12 May 2026 02:23:08 -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 1wMgWE-0000zw-8h for qemu-devel@nongnu.org; Tue, 12 May 2026 02:23:02 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wMgW9-0004gF-Na for qemu-devel@nongnu.org; Tue, 12 May 2026 02:23:01 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4896c22fcbaso44284685e9.0 for ; Mon, 11 May 2026 23:22:57 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4548e4bb87bsm29283169f8f.2.2026.05.11.23.22.53 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:22:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778566975; x=1779171775; 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; bh=vwo87tkNpgYg6uZPVSFE7rtPPjY0Aoz+JdJG9zLwI60=; b=tl9ggBMJn7R7N8USK1MHfdIRL4se8/14CwY8y0bnEHw2HkGOD/b9CYLIzlew/FFYHA 1F5c7b8dJYH2zY1UIh0jxnRcBVLwFh4Chz1qCsJdecR6FitAIisiJexeWmbJb4boAD7D TJBQPNVj2h8wvyNGpcJoflfXWZdmaxZpWKieO3bCh04yzr+ZgNq4PkMeriKeq4O67dcN s/9a20KUoKkj9Hp6WRPFIc6d98kWuu1UsxmTMoqMlOsGrhCiDtBusosr3z8dqg9r7jZ0 mRyQUIY4J6W+WhQvHb/gTaEdYKmSSim5nBtdRYuzt2e0dWWuba1Hp84cfxOny6TSG0Y0 w5EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778566975; x=1779171775; 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; bh=vwo87tkNpgYg6uZPVSFE7rtPPjY0Aoz+JdJG9zLwI60=; b=h0+yYtxFOVp3/S+3LtVF6C6kA6EKwok7x+7xi+t/GoUODQA4NOhc1T94sUb64xDwPg r5zppM6cHWcLc/QoDDKc2cTKNr67grQVgMuVoSvyafMkUmH6WmHs94K/MJuJgXtT4qsm F0Sfs6STNKg3uSqwlVTtrzdz7ewZVOg7ScDkv63zO8Aq/AgqeUhvMY/vDtbQ5y1ZkxLE D0UEFkbmsTLkr/OCeOyVFxh+KFtqzpaNsBe1BRp/Jt/Z9CmPTK/yS9QOXUCVoElNeB3Q yNIDR0fbBmuuS/Hpu1nmihPfXm5GEukegPw9WeepUigE6obGywOfPkiXbAS98VgfQ4j9 Ezxg== X-Gm-Message-State: AOJu0YyZNQpTP1WlKlQ8G8IxLV1za24IB+O8s/JT4wF9BWvFtgE8HAgK 7RnVrtMiWvv4PdglM1moSj6ZSXtdgq04DLfzXPqvnPZXXe4UfoWlacqMxpsgSjWRTbVVakWNTWP lrAfHpZw= X-Gm-Gg: Acq92OFI0SVQ5DoD/xehFzHMmaGEcdxkD/r2QBChSzMuSjbskkovPJsTVbRwrV9k/kb Q3D228fyRR3QdmMEl9QVjyySdm8N9pVFIZVuZasvRD/cFXShp9iXgxIOTvBNTRNbqE6ETGfqGvR X1hQj6rkF/2PsjU+4qTxJKDyFy6sWZru40/mq5w33RNAl4cqM6uUAamEP3JFRx8yZyoGf3CSi9c EA/IerHbLngmnugdtvPB0Li8bn1z5ey5v+ARaI377jjLNMam/nAz7c0bhsqAJxjdr2DpIv899mn pBw/tbeMNBDkYi8NPvtWN0cc1k5zXKawufxyMtVaWYwvq2017ULPkWyvl8GUw78Ct1THpsH4VTw IlBy9+ZYLvMUTWvIJ7Pkpc31tBwiwerrXrMlfBjCNeUTPUrHVpgM0ncXpYwuPAzF+iPtQrCDVIk 6hOXkRvYsJA0BZQ93SvQMVwo1PQmoTLyOmh5upZMLh9kLlb2hu4ZJlT4Xc7ZWXhPyZdI2Igsxf X-Received: by 2002:a05:600c:c091:b0:488:a977:8de with SMTP id 5b1f17b1804b1-48e706b264cmr152181685e9.16.1778566975202; Mon, 11 May 2026 23:22:55 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 10/41] hw/i386/vapic: Cope with non-page-aligned return from cpu_get_phys_page_debug() Date: Tue, 12 May 2026 08:21:11 +0200 Message-ID: <20260512062142.67998-11-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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: 1778567039091158500 From: Peter Maydell Currently the i386 implementation of get_phys_page_debug() always returns an address aligned to a page boundary, and the vapic.c code assumes this: it adds back in the page offset after the call. Change this to OR in the page offset, so that it works whether cpu_get_phys_page_debug() returns the page address or the exact physical address. This will mean the code continues to work when we change the semantics to standardize on "return exact physical address". Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20260430093810.2762539-2-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/i386/vapic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/vapic.c b/hw/i386/vapic.c index 1acb9f91b2a..3738031a055 100644 --- a/hw/i386/vapic.c +++ b/hw/i386/vapic.c @@ -309,7 +309,7 @@ static int update_rom_mapping(VAPICROMState *s, CPUX86S= tate *env, target_ulong i if (paddr =3D=3D -1) { return -1; } - paddr +=3D rom_state_vaddr & ~TARGET_PAGE_MASK; + paddr |=3D rom_state_vaddr & ~TARGET_PAGE_MASK; if (paddr !=3D s->rom_state_paddr) { return -1; } --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567036; cv=none; d=zohomail.com; s=zohoarc; b=S0qH05F2ZhRWwsAeU4o+HPlT0X54NhN0AWxZ2lg42qCkOI2ZjENOK9lST2+6bSKCe/thM7XhpOM/pnXG+1B6o4kJTddzU5+qcLKkO1For13PntAGP46bpzF2LNkOBUzsu+ZTIGsHR85srfR4KsQ1767Llmiw4wWnpYPl2cDoXvE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567036; 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=fG2F23ViZCDQaV13ekvtxg89EgiB1GeZgfbNuM5RSM4=; b=VDvXCpB+3cjOaRgw5vlF6R09HRbfgbIiU7yRxGZ2/hvJlyZe3FMIq3995MPM3qpOL7ekNF7Xp6BcJb2LDna+AxJjh12uy88EbZ2XFgwgD5yfHv1PwP4pVElUUoQN0WkB7iLTi9KBk+SVC+peirNX9ohxZkKY0tj3W33bp6i1PXo= 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 1778567036266185.49982751765083; Mon, 11 May 2026 23:23:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgWL-00017z-BS; Tue, 12 May 2026 02:23:09 -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 1wMgWJ-00014e-Pj for qemu-devel@nongnu.org; Tue, 12 May 2026 02:23: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 1wMgWH-0004nq-Jt for qemu-devel@nongnu.org; Tue, 12 May 2026 02:23:07 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-48e56c1bf5dso31029505e9.3 for ; Mon, 11 May 2026 23:23:05 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4548e4bb87bsm29283576f8f.2.2026.05.11.23.23.00 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:23:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778566982; x=1779171782; 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; bh=fG2F23ViZCDQaV13ekvtxg89EgiB1GeZgfbNuM5RSM4=; b=wlVLjQNGXt3a/KaIzo5unnWw615+lHR8Cf2B6z+qlJvXMoGb2tlH8SjzalP+s9A/5P 6TjxxLevglvtPGNkMu+zPXqx/Q+hlOJVAMPZKc37mqyULuKddmeD2csCwNCnbO1Lf7Pp hd3wmjxBrpLa56snUq3vC7B4L2e0gnOgSFai+E7ZsYFnr4R0DZawWbFJ3ffqLFvy32oh shskQDSUCr2+QgUzrcX2fvrsCt/BMFEpQVF+gV4Eq+v+2qNWD61ibGVv4hNiS4NcxPTK aHFvlh77DRBhfiZXYwy44cOhM+Bet097tCAk+qBkMOMuiD4nSpuhmkMP0888gYJT2C/O 8hzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778566982; x=1779171782; 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; bh=fG2F23ViZCDQaV13ekvtxg89EgiB1GeZgfbNuM5RSM4=; b=b2zwMU16GpJUsUuELl6jb4gAOka2uevo5iozKh9lUfUsQoCmzdMAtcUEWQvd6rVJlQ mc+mKnKNGV+x5+QKcV7Vj8XJb6I74RddHFc0oV5B+t61PMC82iBxPpzE8ghJvcfsMHsy 4LoOJI32pQgwL/9e0RY0dW8T1pNDVO43aNuvbrMDKCT0CAyF+qbIs5NPh5nBTc9KoV8m hl7efH+jeqFnychdj3be/p/0oJwloRtXvD3FP9ACbY5Mk1iXo5MY3mgSPl1rXg/DMMg0 92AsjwyOyhFJGZrQRmukumG3tn/EzvSBZ2dvTPYA8o1/MirSQ3m/IJNrQbXNCFeqOgMu P/bg== X-Gm-Message-State: AOJu0YwST/tQ7z5B8IQi/9+fBcvfeUlsYmcllzR4Vo2LvI2hTXM0/CXa /uP/tHPj/OLgqQHudHhjihL9NKoPkLD2/UD4sQhHr6jRs/1V43h0KGSq3fs5gTEy4L7FKIQDRSy bsB9kXt4= X-Gm-Gg: Acq92OH6f8oCn0vDYNsNaP5UjZCJALaCJ/oIqREcC4+j2DAEu0dUXTgRBiiGmW56da3 zzFvgueJKKuGusYVDdZVNVyPOhz0u99AdezAWtQ9+6pIzyBR/yqlZaFOQLrjzsdQFifFrEEfnOi QSWEy/GVuhzpLEla9rEAaZfvmr14EN3ER4W+9SX9TvbN9dNBiVWFBckGABuVgQ/NiJNkplGrY6l iFs+tG8Nr7+B3fZOLGZ/9FkC78f5G5jhpC0crPnACseWPJzWKyq2PJOUDqJet8/kG4WzUp1gouh fSDHAZeha8elLK7S4qEA1ZI7DlPU2kw6r4rMpTkr0Un2HVQZyEHOAMqDFSqqvef/73BYcF91466 IwEes9xR7Qf+sPrp7GJMXp+gzvEdgmb8zvYzAhu/Iuie77Tzv2Jdi0I00N5/Bcwq3cB54jkcpYz 4J2/lKgszdoyhlm4aDbocVv2s84z+IItyeP1OBLxaRP6oIPlwxY6Zkq6OMKfRG4ZGNgw6WRl0+E u5KsK4x6ro= X-Received: by 2002:a05:600c:4fc4:b0:48a:5342:36b5 with SMTP id 5b1f17b1804b1-48e706c48d5mr191982315e9.21.1778566982240; Mon, 11 May 2026 23:23:02 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 11/41] target/riscv: Make get_phys_page_debug handle non-page-aligned addrs Date: Tue, 12 May 2026 08:21:12 +0200 Message-ID: <20260512062142.67998-12-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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=philmd@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: 1778567039134158500 From: Peter Maydell Currently our implementations of SysemuCPUOps::get_phys_page_debug and SysemuCPUOps::get_phys_page_attrs_debug are a mix of "accepts a non-page-aligned virtual address and returns the corresponding non-page-aligned physical address" and "only returns a page-aligned physical address". This is awkward for callsites, which in practice all want the physical address for an arbitrary virtual address and have to work around the possibility of getting a page-aligned address, and it doesn't account for protection being possibly on a sub-page-sized granularity. We want to standardize on the implementation having to handle non-page-aligned addresses. The only thing in the riscv implementation that we need to fix is the place where we explicitly round the return value down to a page boundary before returning it. Drop that. Signed-off-by: Peter Maydell Reviewed-by: Chao Liu Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20260417173105.1648172-2-peter.maydell@linaro.org Message-ID: <20260430093810.2762539-3-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/riscv/cpu_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c index 39c3486ae0f..f786b1ebcd3 100644 --- a/target/riscv/cpu_helper.c +++ b/target/riscv/cpu_helper.c @@ -1730,7 +1730,7 @@ hwaddr riscv_cpu_get_phys_page_debug(CPUState *cs, va= ddr addr) } } =20 - return phys_addr & TARGET_PAGE_MASK; + return phys_addr; } =20 void riscv_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567041; cv=none; d=zohomail.com; s=zohoarc; b=OxAyr9s9Ioyc25enojlMKNXQ8Pm0Rfqxf0SEBTu0M1ldjUK7QwkROUHRdncS2zLiy9YepusfXTQfWjUyrhhb5VTstA62tad0S1nIS+Bf5gS7FI5oZKbbJ5bQr55Xny9E5gE83TFECycNFZAFvn06/ZKVMnTyrtHGQTYPCreld94= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567041; 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=qKmEe4LuuYggAdOjf4sUzqPh233gR7Hz+OandJbQdKg=; b=ZQpPvqFN13jWQuKdvFJ/nvb0sZkqkVkSCkQSDxFxJIJ6TevB1HzG7+u6IotatYutoaja3hwb3PYEpNs3gJC/1qDlLsdIy37vK+IV4D9rH8dzsCkJxDWvOEqvz9hiaKLEmJ2WmABbvMjcQm8F4+TGYmT+SQW5jq9rxIx1nW6HLW8= 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 1778567041797481.52182137711554; Mon, 11 May 2026 23:24:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgWy-0001kq-Qi; Tue, 12 May 2026 02:23:50 -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 1wMgWQ-0001Nx-Cf for qemu-devel@nongnu.org; Tue, 12 May 2026 02:23:14 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wMgWO-0004sK-8n for qemu-devel@nongnu.org; Tue, 12 May 2026 02:23:13 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4896c22fcbaso44286425e9.0 for ; Mon, 11 May 2026 23:23:11 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48e8f429fdfsm10105205e9.15.2026.05.11.23.23.08 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:23:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778566990; x=1779171790; 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; bh=qKmEe4LuuYggAdOjf4sUzqPh233gR7Hz+OandJbQdKg=; b=jxAbP6/N5IooSd7JjXUb7gOa+kthOLS+fSugRUrLGZp/y6BhfcYneSM8Jkh32+e38s 1ewpfmEiaguj/VvFCkTXG0KTqXaNasRWu6OJLWpffIgYNxtpqBJHBuL8NLor20XmIW/2 kO5dwRDDF1naE/YrBn0xDR0H4BcIyboXdwD9d91TNvaGJEpjUTueo/B1L159MtKqW7H/ NdPr5mPoR6qQmONtN1GtJvDyNFctvV3wMcHqExF3HgcxeNCt2eNuTQjMXJje8gRvWfZg vCUhOnXi31vmT73KAAkhKV7nPLXjFxCprP+l8q2diVwdUZ0eoFalob2dpAgVRv7mjv6l 0ACQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778566990; x=1779171790; 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; bh=qKmEe4LuuYggAdOjf4sUzqPh233gR7Hz+OandJbQdKg=; b=ajBJRL9RapY1LFz8W0dsZVnVTPwDc89g/MiXylO6hUx+UnwoSolvCUbftWvFmtvhbO 75xom81O8P83uyTvajsijHt4IbR2gVea/fZk7wIMiRBXUjJlFmM6BzLsG3RiYmGcK8qA qVlq4zsDRMdkXpHaxYyz+q9JDfZMiLM0vGkocHYNLrsK7UX+1wTCOFMKI9X23CmYs6y3 vpBvUH7GmVPVbcWCLW3tDkx8UumdALJ6Jgh7c5a23IEGKSY41A1mWLltVip50sQVlBBz Ohn6pdZtucNjCai2YvPQFME0rIKLosg83gE+fg+ViT6L/6k5GdJ3XUegwDdkQWIDX+8y IAhQ== X-Gm-Message-State: AOJu0YxHPECVOVCN10gL0Q+2WbKmCR3noSsYbMZtEShmnP7alQC7OCbN Gr29bKeGMSy/4tV0oJ4GXPIuhLkXNqjARZ7hkSvQablRJYNmZNpkOrz7kJyklnE0/OarxHt82ML JWh0wAUo= X-Gm-Gg: Acq92OHBKDKUl87S/HqzXhfwlUAqs49L9kcPjxczO0KsLFR25k51VkXUNkJoV0uK9+d ANP3adflKFx5rXm00McbTSDSBm83W/iGlQgxmYHNk7SBAKYNME9gNaVGqwGS7oqIwuHyX6zUnDf IL2o2wJmOWlQN7C/cpeykWGduEIRqyPdCcN3Ae3sCPZk8TixSsUDSgpHGRQQc2rKfJ2zPJGPXNh NWrT1BuJLYDILBhuF4KnrsSlcB8lNkJGheE8rAZwyA83AMeXqbmSab2nZpKpQr3NNpSjTSrDgGM BEDtLpY2jntliqH1JK8IpT/E6RMU0iOpUP4ccqQrJ+ndRFnG7ByDjFZ4Ze6szASCA7RrLu1pMyA GlXvqvNNWppPh14xmTba6eg/TmwddeJ/54cRbGwvgdOotzscbkgALGRxQHKdaNw9w59wcdKhYm0 8lkEeiH27TQk/omsruCOmf43Ws2hOlGvcDlk89d37KQeHvDYf+yfoWdpQOPFQsCrbtPEH403Uk X-Received: by 2002:a05:600c:17c3:b0:489:1ff1:74df with SMTP id 5b1f17b1804b1-48e70687ec7mr105686895e9.1.1778566989570; Mon, 11 May 2026 23:23:09 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 12/41] target/alpha: Make get_phys_page_debug handle non-page-aligned addrs Date: Tue, 12 May 2026 08:21:13 +0200 Message-ID: <20260512062142.67998-13-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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: 1778567043131158500 From: Peter Maydell Currently our implementations of SysemuCPUOps::get_phys_page_debug and SysemuCPUOps::get_phys_page_attrs_debug are a mix of "accepts a non-page-aligned virtual address and returns the corresponding non-page-aligned physical address" and "only returns a page-aligned physical address". This is awkward for callsites, which in practice all want the physical address for an arbitrary virtual address and have to work around the possibility of getting a page-aligned address, and it doesn't account for protection being possibly on a sub-page-sized granularity. We want to standardize on the implementation having to handle non-page-aligned addresses. For alpha, the get_physical_address() function accepts arbitrary input addresses but may return an output rounded down to a page boundary, so in alpha_cpu_get_phys_page_debug() we OR the within-page offset into it before returning it. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20260417173105.1648172-3-peter.maydell@linaro.org Message-ID: <20260430093810.2762539-4-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/alpha/helper.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/alpha/helper.c b/target/alpha/helper.c index 179dc2dc7ae..af6d7847d50 100644 --- a/target/alpha/helper.c +++ b/target/alpha/helper.c @@ -301,6 +301,7 @@ hwaddr alpha_cpu_get_phys_page_debug(CPUState *cs, vadd= r addr) int prot, fail; =20 fail =3D get_physical_address(cpu_env(cs), addr, 0, 0, &phys, &prot); + phys |=3D addr & ~TARGET_PAGE_MASK; return (fail >=3D 0 ? -1 : phys); } =20 --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567038; cv=none; d=zohomail.com; s=zohoarc; b=FYjdzirTsyfJA2Mhz2prP+mw/Wqqth7s6WK/SXCY1IVgiSMrzfnIS7SvDzpkSc5PjuJyLbFERycZvAxvajTcjXC0LmjHkJlu4QgYAgZ7wngLnKKIW49FWclXSs1koVmyJByUhcCv5N6tHtkn+FN82F/6l99F+XNW/M351nKX74Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567038; 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=GTGCKRRgQLGFleE2ce9wrYCRvh3X4bSQQgWStacujR8=; b=kurG4kjst9AV9IJOTR9b+2jkFZRk/wVZIybCq/IImbXsq4YRDLiJ2ZbzaXUovtyOidRKuRi6E+l+/D3zpeZ44kdVY7VwRPj9n/UF/8GyPjGjdfx3unDAxzaDvsfs1wpmM4KQoM2o/joKYxQ0YgiBnWmqCdPVa+YrQVj0C16ZAeU= 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 177856703874228.425698155464715; Mon, 11 May 2026 23:23:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgX3-00027c-AB; Tue, 12 May 2026 02:23:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wMgWd-0001hf-7w for qemu-devel@nongnu.org; Tue, 12 May 2026 02:23:35 -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 1wMgWX-0004uc-LW for qemu-devel@nongnu.org; Tue, 12 May 2026 02:23:26 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4891b0786beso33221255e9.1 for ; Mon, 11 May 2026 23:23:19 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48e8f42a845sm10039855e9.20.2026.05.11.23.23.15 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:23:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778566997; x=1779171797; 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; bh=GTGCKRRgQLGFleE2ce9wrYCRvh3X4bSQQgWStacujR8=; b=fPFaUYKl6EY2NlkxMlE46ki8+WCvcytO50NpmApqK4GQX4uDu13XyQgIpZUYfkW04t zxqATJ1FnQcCLtQ0stsSO0Is1TrHftPRETMgNPPbxd8+qTkk8m0/E4S3nxeSU/vIrKdH GEHUNLiqLUPNHYACNEWLgOeRvt7FSSfhBMNhuScG5GtQIHV5HVVMmhmJceOxDMowKbmg JupIJgbc2PbTGie3/Er9ZYRiIJ7sivR7xXvJqxOgGiS7dzCD0LsmBxy+47cxIMi4QAVS oOHelF5xK0ThyHGaaG0p7TZL/xQOrAKE9qEhl8Ws49V6on8JeL9iKL7edSkMD151s9kw nH6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778566997; x=1779171797; 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; bh=GTGCKRRgQLGFleE2ce9wrYCRvh3X4bSQQgWStacujR8=; b=Mxa8jt6snE8P4U6lk6cKcd24QWHL2CLLH7001Fhl438tyBrKLpzLihtPwPl+lvnMgM rpXB2eIaG8sPOo7y8y/EdH+egTGaw4T8Eae4RW44YvNkAzSd57wsOgJMHlTjJ8j0Kgya cXY0Bypg9+fb4ej/C90zgtCFi9m/8y0uj6uE6WZAkc9EmPUGBndeVxH6BLn+1X1pmkFQ a5PAULeuqRVyBHPXUjtfXkyNbrW0AqqzqaTs5/AkIIJ6eTtNecInetFOkT9G0fpBTDIZ bM4PIC6Xqo0eopQIUyAYYrOMExk6ppMkxQ7Ovryk3ceU20WJ8J8M0aLvQ2uBU+THTytv SNXQ== X-Gm-Message-State: AOJu0YwO6m06vneMtVHvwipQ7nfx6+SNSpXkomN9hSL8loAsCjJSoHsR fJMRPZ3ZA2PmVOtlix7esubLKBVBrIEzXc7h7tKHNpU2zenpI2DDfMrNTjuitcQJ9oZai4Rbenf lTscdFNI= X-Gm-Gg: Acq92OGtIIQWP4iW+B3DBwvJ9ccx0dq966+nEiUHdOsJwD5x6moGJaUHrbuL7KzoLwC ro2nbaDoryg67+6rPxiXQANeZ5D7hiwfJFbl0k/s6Q5k10wn4mC41qrNEw+kTeHG628vx5A7VyF E8LImrtYuWBmzkPRLlGABR8CFfqG1QGhItViQ3BKD28EM8L/gZ+vSI6rbNRrYvfXrE0tIqmVJc0 QKCzDw1UD84r4ZUIBmvucZ7C79D1EvvQ8bR4mDNNtBhFW8/FLX2PX/HcwsW6cvpqMyjMneEwn6x KYiB9n9WOc4krfQZJnilAqhA/HAKHor748bYba7wWWaMykOivsVswobg+1Qw4odLYXE/+zPV2PZ K7Ql1hWl0Q7IT9MvXK3K3SR6bTsBF/v24X10ulkI0W+LzxT5GgnKrcOJ3Rn+VGAp5DJ8yFdM4UA iyn/kaRBurU8eauV6uJvInzyrEh/Y0ykYXT8WKhbbGX1mdYE2O+z+pynecYewt+DugARlgEjRu X-Received: by 2002:a05:600c:a30d:b0:48e:6db3:ff3a with SMTP id 5b1f17b1804b1-48e6db3ffdfmr147634745e9.16.1778566996646; Mon, 11 May 2026 23:23:16 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 13/41] target/microblaze: Make get_phys_page_attrs_debug handle non-page-aligned addrs Date: Tue, 12 May 2026 08:21:14 +0200 Message-ID: <20260512062142.67998-14-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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=philmd@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: 1778567040701154100 From: Peter Maydell Currently our implementations of SysemuCPUOps::get_phys_page_debug and SysemuCPUOps::get_phys_page_attrs_debug are a mix of "accepts a non-page-aligned virtual address and returns the corresponding non-page-aligned physical address" and "only returns a page-aligned physical address". This is awkward for callsites, which in practice all want the physical address for an arbitrary virtual address and have to work around the possibility of getting a page-aligned address, and it doesn't account for protection being possibly on a sub-page-sized granularity. We want to standardize on the implementation having to handle non-page-aligned addresses. For microblaze, we just need to remove the explicit rounding down to the page boundary that we were doing in mb_cpu_get_phys_page_attrs_debug() when calculating the output physaddr from the results of the MMU lookup. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20260417173105.1648172-4-peter.maydell@linaro.org Message-ID: <20260430093810.2762539-5-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/microblaze/helper.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/target/microblaze/helper.c b/target/microblaze/helper.c index a1857b72172..da8abe063e7 100644 --- a/target/microblaze/helper.c +++ b/target/microblaze/helper.c @@ -284,7 +284,6 @@ hwaddr mb_cpu_get_phys_page_attrs_debug(CPUState *cs, v= addr addr, MemTxAttrs *attrs) { MicroBlazeCPU *cpu =3D MICROBLAZE_CPU(cs); - vaddr vaddr; hwaddr paddr =3D 0; MicroBlazeMMULookup lu; int mmu_idx =3D cpu_mmu_index(cs, false); @@ -297,12 +296,12 @@ hwaddr mb_cpu_get_phys_page_attrs_debug(CPUState *cs,= vaddr addr, if (mmu_idx !=3D MMU_NOMMU_IDX) { hit =3D mmu_translate(cpu, &lu, addr, 0, 0); if (hit) { - vaddr =3D addr & TARGET_PAGE_MASK; - paddr =3D lu.paddr + vaddr - lu.vaddr; + paddr =3D lu.paddr + addr - lu.vaddr; } else paddr =3D 0; /* ???. */ - } else - paddr =3D addr & TARGET_PAGE_MASK; + } else { + paddr =3D addr; + } =20 return paddr; } --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567068; cv=none; d=zohomail.com; s=zohoarc; b=EykHjwaB1254+UKRB3NOg5S4metoAlUyXBRhzyggGwi7E0v01ZHG10DUiDyOCjFZgFOYpwfFftFeCr5lY9kXd8q/Aw07OHlKtLZ9rrnsqivOhPIEKRXjhvBeRWYDhlv3JU9hOBBapnCmTVxFSJoyI/kYKbs0XE0eTJSAAhjmbho= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567068; 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=Uq3NSu7zxGyfICygwcVZLoJgdWergCj3pYPA8BG5YpA=; b=Jlrp6687iQjgX5Ok5Ra3vPtxsQWrZC4lotjuHfNFGEaoQuaieDThSO4Ef0r67DYK2JRQe/mJChxiaMoLDiFwJ53nIzfAzMOCPk63SjJsumr6nI7JiMZ9XhLgzU9tb6c9awANJZfiHSJ19CBciS8rMPAGwnQKPHXFIZYEOY2E4h0= 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 1778567068991565.3660651321981; Mon, 11 May 2026 23:24:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgX9-0002iF-RK; Tue, 12 May 2026 02:23: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 1wMgWl-0001l3-Ut for qemu-devel@nongnu.org; Tue, 12 May 2026 02:23:42 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wMgWc-0004vv-Uy for qemu-devel@nongnu.org; Tue, 12 May 2026 02:23:30 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-44a74032ff8so3767630f8f.1 for ; Mon, 11 May 2026 23:23:26 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4549120ec0asm29928512f8f.17.2026.05.11.23.23.22 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:23:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778567004; x=1779171804; 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; bh=Uq3NSu7zxGyfICygwcVZLoJgdWergCj3pYPA8BG5YpA=; b=nO4/+qYF7BHasBCudevFsgGwgPVSVCxVn5x2FuZt6HFsTqbxtxYGZQm4AhzTjemnQC UG1Hh2YDxVkeiJoTTGumO0XtMrGd61JhXjY52vnc9uDVR36Pvqhjz9csDGkGokTBedAT fqw5Y62Jf9SMt39YpTpeWu4gCazWU4cc0gndrw1bmdmIcqhQqaSEve+K8tHc6Si5dZeZ aIqTCjJNwfjklv6pP3GjhogS1JQto5LaAsf+2QMz/0SSlurQhD1maldBF15jCiBzKomI njJlL03IiveDB8uSJUWszrYDyOTQ/ayzttXrxC9L1DzsVAat4AI0LAeEiRPqWVhqYJw9 3e5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778567004; x=1779171804; 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; bh=Uq3NSu7zxGyfICygwcVZLoJgdWergCj3pYPA8BG5YpA=; b=Tyu6aCdJU7Ogm7sT85PKHoUmQ9dvU0td4jZuSGgDvCeP5j4LIo3kyKTpsyuAi+iD+w phfVDsJHbRPL1+bONBg8JygcXYMtBhLHsmGBZ2jY3w36iY9wOo6NoERMPrkdkafWAAEv +1zKhtisYAfTa5mN8W2gnBiVY5Da4A2w8He8UilGZchyoKsTAiFYLvdFmybzVNBc7nK3 GXBK9TDzheXXFG37CTlNBvXE/El4vS5J5Uh+Ky0tVet/EBf/aWvhY8Ha3EzzGBQdDZ+4 WEsq83Le05tfmaRtJ5SDudMgzpNZh/UBsFOOGPE0Wp2G0ZDtPUbFyMqnLVEGy4JV76vu xNbA== X-Gm-Message-State: AOJu0YzIq3YWmccM3KgWvAgWQA9WqVztudyEO/+z7h1I1vqib9aS/1um utgGC38YysTv4vJrD5aJf3kyFYjzmXdg1rMtz968ZeBcfD1PKGpKwdPJqYN3MW/aeeDOkQEeK+5 8/Zsdp7k= X-Gm-Gg: Acq92OGDIUbGfDYVlt6M71Jbyx21aoqVxibqApfE+uK+1cxKeZMOcppBPJxOmh4eN23 MPVnCvFkS5xOHi4RFoxWGATiIxA2IapdZfbvqu0w4ySW7qlRffVNNJp9D1QcJjaOcd511JZCj/b mv1wW5nTOmReBJ3kAm1BBanHLf1rYrstr18uKIA7GtKQssO4sFMBS3/OaA87GQkL96gHkLY5pVs sYKnAlN6xbIMbhl4WKDCzskjqsc7XsltOZEJrn8mjDeJ5Uqvbbz9HqB/LlUVbmu9NW1bsdXo4ag SOVxBmP8XTxOhEOjaeLtxUK29pUz3e0v0NNOqFsFon3BYheGYezEYJRMxYOb0QvCEXdQIrX9NlK 1InZz2aLchDEUwhT89wGmi1snmuPbRXP1jujFpvYViHamfrfl+OgLZI/Eh+IvcL8zu9/EM+aTQx C1SQAliu8RYlcNTACRzd5JbU9MNLL2aq+oXQZUhan0wTNVt3ecAumL73yqDYY56g/LaMk37OcS X-Received: by 2002:a05:6000:2403:b0:43f:e9ee:5610 with SMTP id ffacd0b85a97d-4515df65daamr41570410f8f.43.1778567003676; Mon, 11 May 2026 23:23:23 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 14/41] target/sparc: Make get_phys_page_debug handle non-page-aligned addrs Date: Tue, 12 May 2026 08:21:15 +0200 Message-ID: <20260512062142.67998-15-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.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: 1778567069329158500 From: Peter Maydell Currently our implementations of SysemuCPUOps::get_phys_page_debug and SysemuCPUOps::get_phys_page_attrs_debug are a mix of "accepts a non-page-aligned virtual address and returns the corresponding non-page-aligned physical address" and "only returns a page-aligned physical address". This is awkward for callsites, which in practice all want the physical address for an arbitrary virtual address and have to work around the possibility of getting a page-aligned address, and it doesn't account for protection being possibly on a sub-page-sized granularity. We want to standardize on the implementation having to handle non-page-aligned addresses. The sparc TLB lookup code can handle non-aligned input addresses but will return page-aligned results. Rather than attempting to change the internals of the lookup code, we take the simple approach of ORing the page offset back into the phys_addr result. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20260417173105.1648172-5-peter.maydell@linaro.org Message-ID: <20260430093810.2762539-6-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/sparc/mmu_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/sparc/mmu_helper.c b/target/sparc/mmu_helper.c index a6f76a1ab76..25f8a85fae4 100644 --- a/target/sparc/mmu_helper.c +++ b/target/sparc/mmu_helper.c @@ -913,7 +913,7 @@ hwaddr sparc_cpu_get_phys_page_debug(CPUState *cs, vadd= r addr) return -1; } } - return phys_addr; + return phys_addr | (addr & ~TARGET_PAGE_MASK); } =20 G_NORETURN void sparc_cpu_do_unaligned_access(CPUState *cs, vaddr addr, --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567081; cv=none; d=zohomail.com; s=zohoarc; b=MjGWitRDMNBC+fuQk8eEJvXFyeySwqnUYIs9Le51kdWLDYTbseIB4cJR1/XdZs+zLs6WY+lntpbz4jFXcvlmN+fRkC5H1Gn0n1dXAAIhDbiu8LumI7zfhqVMfxWRpWlMYM8jLQ9T8YHWV6hJXawAe65BoV7aOTFLwzl2+XZibIM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567081; 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=xRX/ta5VpmlOxxpOp5cKBpx5aszP815FlNSfn+k5m6A=; b=dg2cwxpYmaGzfyJyDg48sxEtsy/TF1eMklJxOHvZPhxsEPu0dbOBj1gKPX9lpi6gCqj9TkZjNIes+bIG6ylcDrW1YSUKSf/wEVbtLvn7IEKbrYQWMkw5+dCiY67zLWBfavRywr9xa3FoLnld4imzjccnA2/xY0+wn7s6xKU5Eno= 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 17785670818721005.7585183127022; Mon, 11 May 2026 23:24:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgX7-0002R5-8g; Tue, 12 May 2026 02:23:57 -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 1wMgWq-0001mF-6L for qemu-devel@nongnu.org; Tue, 12 May 2026 02:23:46 -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 1wMgWl-0004yC-Og for qemu-devel@nongnu.org; Tue, 12 May 2026 02:23:38 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-488a8ca4aadso46665415e9.3 for ; Mon, 11 May 2026 23:23:33 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48e9052c7dcsm27638575e9.2.2026.05.11.23.23.29 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:23:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778567011; x=1779171811; 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; bh=xRX/ta5VpmlOxxpOp5cKBpx5aszP815FlNSfn+k5m6A=; b=AKxdGeSQ7/xsJW/ekoV8GWEyXh9GoCI87OrQgsUBYzeBmOlDDxiqcjFzMHROsUfsbn ngdzyHl3f6mw/ggt7fIV6wy5cTe3Srkvhw2eyP9wSKrf1Beub+2/APDTnQb90zzxLjvr M+WkqOIvif8YIHrUoyzXaA/Ogo1/RFNZ6/Rzbd4eWFwMgs7H1pLIEivQ9KHT5Ku+GVQX ijqCG5WXU3KZ7k6OajbNQ+K+BUbM+1g3BzIbGKAHQdwftrN1yOePGMNpXY9zINn0ROUg f4lYrsReBicBfokBZdqKx3i/kwlsEEswjSR98xNgpjQHITh9IIYWOd3jz7UPpqv/AK59 2WCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778567011; x=1779171811; 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; bh=xRX/ta5VpmlOxxpOp5cKBpx5aszP815FlNSfn+k5m6A=; b=KQ1OY/+DFiMcM3u6NYcHuDo0PzBs9DLaQonsWMAd4xsgR2j/9Vk1QCT/qGYjwRhFX3 gaJ32yywUACBYj7wGi6lJocUxY4hwTqVilHa1/8q3sL/TeI0+zS7u/sHN+ncBT/hxkBP RqHCWnZ+Ermgznv8nTj0UB2KQ59yfLaNsmS5faTZpnGY7ImhYnS59aJGZw1auYjnRxzk wY5dje6VBrvHXKL1BY9CrnkHiSMOZ64oBRbEySxgcH4gpOb/CYrdIHlWpUumRnDJPhdE 6839xVVIM1fncsRxdXaswJpRQVHAwNQ/v4+prcTiZrJpS+XgP6+fiLmqN9y6v0SY26TK CjPQ== X-Gm-Message-State: AOJu0YwnXXA4LgoSaSFnEte/3uR3JoZkvn3un5rZUjs9QuoOn+zOskMn 4WthrLhjSZFQD0JFCHDQKv2lugUoVV6L69jvCNKy5O8IpV2qGAyohUj4GAd3aDbXPjU6Q1ksEB8 vOmrFCpI= X-Gm-Gg: Acq92OH3sY3b4fd1zfcK2+oomek6txEbYDbtqYal0rNR0ntnapQuW3wtqsWB0LlNtWj mIrhMNlZt2cz73JT9FNAJXAp3s/7ZpX2i+1EcR+PvsHDeuY7+bzfXjsggPHTbWUUXMzSp+J7KOU 3Oj1gJ79Lie/JBcFQkgPlmHL5QxjKg7HfgS591DE66TH2eS/mPvHgtK2s04HXarETBT0EoaG8Ic IZmJM8ojf5gdcNseoIKoZzPrA6ajfWyocefQcH8r6/RNsToOxxJeq604x/7UeeO1Kvd+Tk0hAJX zlah23B5qsVvu1zOfawG1VwcjjH7Fs+B62NoCWL+CWUfgGn1KUGGrXORf+g5vtOCi5kn9qHKoR2 BUSCo1WvbtJwcjp8qKd+EQX1gWIFPigu1HQ2d6TTgcpnZj7JhJsOzVkEz5Y5tgYtFOLgUw8QcFg AlLnwEP0fuupyYMXrnVPD5CMK00O+wFBAJ7168mStrhScdxj5CS0Fzx76QeoSfJLlLiRkFJcu+ X-Received: by 2002:a05:600c:8b06:b0:485:4388:3492 with SMTP id 5b1f17b1804b1-48e51e223ccmr455451775e9.11.1778567010882; Mon, 11 May 2026 23:23:30 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 15/41] target/x86: Make get_phys_page_attrs_debug handle non-page-aligned addrs Date: Tue, 12 May 2026 08:21:16 +0200 Message-ID: <20260512062142.67998-16-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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=philmd@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: 1778567083369154100 From: Peter Maydell Currently our implementations of SysemuCPUOps::get_phys_page_debug and SysemuCPUOps::get_phys_page_attrs_debug are a mix of "accepts a non-page-aligned virtual address and returns the corresponding non-page-aligned physical address" and "only returns a page-aligned physical address". This is awkward for callsites, which in practice all want the physical address for an arbitrary virtual address and have to work around the possibility of getting a page-aligned address, and it doesn't account for protection being possibly on a sub-page-sized granularity. We want to standardize on the implementation having to handle non-page-aligned addresses. For x86 this is simple: we just need to stop rounding down the input address to a TARGET_PAGE boundary when calculating the result to return. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20260417173105.1648172-6-peter.maydell@linaro.org Message-ID: <20260430093810.2762539-7-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/i386/helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/helper.c b/target/i386/helper.c index c397a6fde5a..108b02396de 100644 --- a/target/i386/helper.c +++ b/target/i386/helper.c @@ -372,7 +372,7 @@ hwaddr x86_cpu_get_phys_page_attrs_debug(CPUState *cs, = vaddr addr, out: #endif pte &=3D PG_ADDRESS_MASK & ~(page_size - 1); - page_offset =3D (addr & TARGET_PAGE_MASK) & (page_size - 1); + page_offset =3D addr & (page_size - 1); return pte | page_offset; } =20 --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567105; cv=none; d=zohomail.com; s=zohoarc; b=DySDImat/ZnjrVD+0IxpF1NkYtvzleDxaOd0BbxVz88Oh7wIa5KwZec/cwslOsn4byZTsZLaSV/ELN31zE1zmcVWRo1onwq1vlvjlPl7lFYETS6B9c+28ypCuVEThstz21uU91VCNrcocIzLWnpOYpoDA94yI3YZuhz12AMUbTc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567105; 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=iaQYN4CWwnEWNzbYvTCsYEF24c3R2ZFh9u0U94eq4LI=; b=RfESVfk2vLlsn9inEfUOgFzVs4psGhQTIziUVCVrQA8+oKq9wqda/WV2XpbzXojKkTNtgymXw1SG96bMhAL9sgQRkeBdSEoEPv3EVKah2Tht60Re1qZGABBJHvdVDZXbRPoIwfxZlWvYKNrKVY+eR/hWnvWuVBE2DffG5dEYL/k= 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 1778567105873294.3107803846592; Mon, 11 May 2026 23:25:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgXa-000378-Dn; Tue, 12 May 2026 02:24:32 -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 1wMgWu-0001tG-QN for qemu-devel@nongnu.org; Tue, 12 May 2026 02:23:50 -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 1wMgWq-00052l-Kk for qemu-devel@nongnu.org; Tue, 12 May 2026 02:23:42 -0400 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-453903ee4adso4386537f8f.3 for ; Mon, 11 May 2026 23:23:40 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4548e6a68ebsm28718814f8f.1.2026.05.11.23.23.36 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:23:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778567018; x=1779171818; 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; bh=iaQYN4CWwnEWNzbYvTCsYEF24c3R2ZFh9u0U94eq4LI=; b=UU0S9qAc22ztnkumi/P24for3GA2KTeqNDlhCgsTTS7mQbvcdmreKTv8/5GkdO+lQ1 mbZ8Pk1+us74akGTBEKsunOV8kIUWNkUZkROWrBC+koQoZxk2szixsNExuYHgilsjHwd JchhTN3cu9/L+FXJWjH2kd9j7f1s+er4+C0cTqRy+4e9DBLZWwn2bsoKmOc6u6P2OhGi C5YbSlZDGo1pQr7kQWSbSXqD+2gnHr5aTAWoj0ynsRi3RVJ4WQVktUqclUOxr9J2UkII JBUqqeGYOsCqqXCYUDuZq+TM+8vMKlzENjNtwbj6TrW1yzOFQuCC9VeiWH+Fvh1BkLff B5VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778567018; x=1779171818; 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; bh=iaQYN4CWwnEWNzbYvTCsYEF24c3R2ZFh9u0U94eq4LI=; b=hPaDx7F5AQ/XgM5LlLF8VmL10tY7q3d8FykavsK/5KpeeB2ndfMOqDoO3KEWnDpAYQ K7pWyZqd0UCZW07mJ7dRRIA6rl6l5sdflcZVFjv9jplYr8vNNhc06PGDraryIYyBbOXt 2/E/NLLiQd0X1F7NczC3pAlPU/8eETWjRTaQuDlLiA5fwrWiULquaDyrzmLS9PnZb9m1 1Fz+twC8tJA9jUnwwWl/9jz2vx+1L5AnGs0cCiUgdnb9N3HP65hvKf/Kcj1epYSuX3TR NK3GUgoiiCSGwstKnouy5dygyrp73trnE70v2Q5W5flIg37ILt6kbEvS4YhiBcGZTnZX zodg== X-Gm-Message-State: AOJu0Yxe+HbSEbHmMAGGBNGRBvcTePIxIDygxMa5g+D9wv0Wz8J7BOal Fq36IsVJaJrylASC3fVLoPMbzYD4FM8K593xOkbm15uUONFvpePehCVtOLc0D8m47haVa8WWXYZ oE2HuP7o= X-Gm-Gg: Acq92OEguxkvUcG/yyoQn1XyFr5LJSCdRUKJIYdEXK+n8AOoVLTiKgXSqgQxOftBs9n ElD1RoTFp5SbP4njCLCGwBn2JFP+Hat0WeKxBeKKAWeKre8d/fVs0vXRA0s4bPytJt64Kndy6f7 JEu4CMG8CO6ddMpzDaisqB4aJAhOJ3ZveehoVvsZclM1BqscZSp6igQl9H2NYsBTTMCQp07dSFg +4Nah+6/HkoKDhVJ6yi8fOlrYJqzuRsk+P4Gg5CSjzc52xhNitEpqq2RYvYUXXnH6sj9kWnXl4N bNt/Q36i5rhUZtIvUz0/MfiP0wptoUx5rX99KxvA9x0XwbmI+fYutihLLldAuO/EI5/QkvBnIyv nIdsNfdlEDS44F6YZNeRFXSDwDhOHuVMKYN5QYEnUyLzX9y9O0d2WqFzyP43cyQINvoHD+D8NYF NF+wz8JVqkS57s6Qn19o9vFtLFD/ueaPyxNJw3BSactS9zEsk6+vbApgXxnYCowHsug3sRG676 X-Received: by 2002:a05:6000:4381:b0:439:c18f:5aaf with SMTP id ffacd0b85a97d-456a47e069bmr18687280f8f.34.1778567017784; Mon, 11 May 2026 23:23:37 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 16/41] target/s390x: Make get_phys_page_debug handle non-page-aligned addrs Date: Tue, 12 May 2026 08:21:17 +0200 Message-ID: <20260512062142.67998-17-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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=philmd@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: 1778567107561158500 From: Peter Maydell Currently our implementations of SysemuCPUOps::get_phys_page_debug and SysemuCPUOps::get_phys_page_attrs_debug are a mix of "accepts a non-page-aligned virtual address and returns the corresponding non-page-aligned physical address" and "only returns a page-aligned physical address". This is awkward for callsites, which in practice all want the physical address for an arbitrary virtual address and have to work around the possibility of getting a page-aligned address, and it doesn't account for protection being possibly on a sub-page-sized granularity. We want to standardize on the implementation having to handle non-page-aligned addresses. s390x already has an implementation of "give me the actual physical address, not rounded down", in s390_get_phys_addr_debug(), so we can use this for the SysemuCPUOps::get_phys_page_debug method, and merge the s390_cpu_get_phys_page_debug() function into s390_get_phys_addr_debug() which is now its only caller. This leaves the function implementing the method with a name that doesn't match the method name, but we will fix that shortly by renaming the method to *_addr_* for all targets. Signed-off-by: Peter Maydell Reviewed-by: Ilya Leoshkevich Reviewed-by: Richard Henderson Message-id: 20260417173105.1648172-7-peter.maydell@linaro.org Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20260430093810.2762539-8-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/s390x/s390x-internal.h | 1 - target/s390x/cpu-system.c | 2 +- target/s390x/helper.c | 20 +++++--------------- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/target/s390x/s390x-internal.h b/target/s390x/s390x-internal.h index 40850bcdc45..e7e4f2b45d4 100644 --- a/target/s390x/s390x-internal.h +++ b/target/s390x/s390x-internal.h @@ -321,7 +321,6 @@ void do_restart_interrupt(CPUS390XState *env); void s390x_tod_timer(void *opaque); void s390x_cpu_timer(void *opaque); void s390_handle_wait(S390CPU *cpu); -hwaddr s390_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); hwaddr s390_cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr); LowCore *cpu_map_lowcore(CPUS390XState *env); void cpu_unmap_lowcore(CPUS390XState *env, LowCore *lowcore); diff --git a/target/s390x/cpu-system.c b/target/s390x/cpu-system.c index 285f5999661..c9daa633c14 100644 --- a/target/s390x/cpu-system.c +++ b/target/s390x/cpu-system.c @@ -176,7 +176,7 @@ void s390_cpu_finalize(Object *obj) =20 static const struct SysemuCPUOps s390_sysemu_ops =3D { .has_work =3D s390_cpu_has_work, - .get_phys_page_debug =3D s390_cpu_get_phys_page_debug, + .get_phys_page_debug =3D s390_cpu_get_phys_addr_debug, .get_crash_info =3D s390_cpu_get_crash_info, .write_elf64_note =3D s390_cpu_write_elf64_note, .legacy_vmsd =3D &vmstate_s390_cpu, diff --git a/target/s390x/helper.c b/target/s390x/helper.c index 667d4a0da75..1a2658eaf93 100644 --- a/target/s390x/helper.c +++ b/target/s390x/helper.c @@ -39,7 +39,7 @@ void s390x_cpu_timer(void *opaque) cpu_inject_cpu_timer((S390CPU *) opaque); } =20 -hwaddr s390_cpu_get_phys_page_debug(CPUState *cs, vaddr vaddr) +hwaddr s390_cpu_get_phys_addr_debug(CPUState *cs, vaddr addr) { S390CPU *cpu =3D S390_CPU(cs); CPUS390XState *env =3D &cpu->env; @@ -47,10 +47,11 @@ hwaddr s390_cpu_get_phys_page_debug(CPUState *cs, vaddr= vaddr) int prot; uint64_t asc =3D env->psw.mask & PSW_MASK_ASC; uint64_t tec; + vaddr page =3D addr & TARGET_PAGE_MASK; =20 /* 31-Bit mode */ if (!(env->psw.mask & PSW_MASK_64)) { - vaddr &=3D 0x7fffffff; + page &=3D 0x7fffffff; } =20 /* We want to read the code (e.g., see what we are single-stepping).*/ @@ -62,24 +63,13 @@ hwaddr s390_cpu_get_phys_page_debug(CPUState *cs, vaddr= vaddr) * We want to read code even if IEP is active. Use MMU_DATA_LOAD inste= ad * of MMU_INST_FETCH. */ - if (mmu_translate(env, vaddr, MMU_DATA_LOAD, asc, &raddr, &prot, &tec)= ) { + if (mmu_translate(env, page, MMU_DATA_LOAD, asc, &raddr, &prot, &tec))= { return -1; } + raddr +=3D (addr & ~TARGET_PAGE_MASK); return raddr; } =20 -hwaddr s390_cpu_get_phys_addr_debug(CPUState *cs, vaddr v_addr) -{ - hwaddr phys_addr; - vaddr page; - - page =3D v_addr & TARGET_PAGE_MASK; - phys_addr =3D cpu_get_phys_page_debug(cs, page); - phys_addr +=3D (v_addr & ~TARGET_PAGE_MASK); - - return phys_addr; -} - static inline bool is_special_wait_psw(uint64_t psw_addr) { /* signal quiesce */ --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567357; cv=none; d=zohomail.com; s=zohoarc; b=IIJU+ogJyvppY2ngdE2kxp/l6KmFye2bT6HPMWBaTwSxUMq5x1f4Cm4f2D48e2UX5HcLY2lhWgh68CJKX7LtHk6S7RaE31u7CBgAk/Icdc/slDM0u0xB3YXL4ubZbCymbQt5qZDb4pO5IVW3dDpmDjtS7WF2Daq8zkCopE0K530= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567357; 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=/8cQxTTYdLqX1Y5L01/6pF9zhPjm0KbJUDRCdlStpec=; b=bKIPtJ/pcDppqKRfXvyNNTFsmyKfbyi6CpBL26gbPuoZch3Yc9I9dho7rJPXCBkWJ3+1lLdyF7D6dvX7CGO2sGIA8bT2C+Y5kjjUvz1eKMnAwyRcT5z2koGoegIIn9uald/zzLGfmy7PPi3eCDHj6tK4/fTL2X3PtfB+7xOA4Kg= 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 1778567357390128.52320561074805; Mon, 11 May 2026 23:29:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgX4-0002DA-UT; Tue, 12 May 2026 02:23:55 -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 1wMgX1-0001wR-2M for qemu-devel@nongnu.org; Tue, 12 May 2026 02:23:51 -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 1wMgWy-0005D3-PK for qemu-devel@nongnu.org; Tue, 12 May 2026 02:23:50 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-48909558b3aso52745475e9.0 for ; Mon, 11 May 2026 23:23:47 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48e8e5efe66sm12412745e9.3.2026.05.11.23.23.43 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:23:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778567025; x=1779171825; 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; bh=/8cQxTTYdLqX1Y5L01/6pF9zhPjm0KbJUDRCdlStpec=; b=FvMoXBcj51PoBexxr9SMWxEgp1Tg0FnQPs8ANUUFtVtorV0g0g7c39HtGzjtEJdU/V lGSiG6C2bSqLtAYS82+oxL5/0m42Xa899LZpzy/i81x8dScbHxX5IGw51bVcpSoNwF5l hrkp1GLY7oNVr6TAGhOPczMZiFUMzPi9gTJar6gO6f7dOXoGB24INaQ0ghLH90kA0pMJ 6cLJTz4ugTaLq+yF66qL+rig34zsCG8iHqubxtjNQ737tjTH7M0sf4I4mCuXHcrcObsW EmSlIDcbBn38EDMu/JDnUJ6Qc50UVAsv1bvv61D1oUMa7DbvZrUmgFtxpVR25snP1cwl 0Q6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778567025; x=1779171825; 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; bh=/8cQxTTYdLqX1Y5L01/6pF9zhPjm0KbJUDRCdlStpec=; b=PfjHGchD3gBqBzgB5PJ1j5GESyLuKxQYPMwXs/hBpoUH551zlr8eRbsjna8KAomxtp SpIZsdcgNAEgwUFitLDZXViguGapJnik52OoceFVG6V/vBd0efX4T+yb3LVpp8Sll83E MdTT6amjl7W3ieBBxfWyI+I6cBZQJHvUb8CUFuBeB6R7Ay2d78emTHFyKv9T8ogtEfOh 12nPbPTK4bsCh5M0i6ra8a16XqQwMEjlPIeiiMiuqeHuWS0SjWoB5IZZIHrEyaHKutH4 PzvNRkBq2Gyj9QKEv1RGalOzi9kP2eQJcy0rAMaQsKMs36B+wh1VSODjaxZRktCh4AWG uSSQ== X-Gm-Message-State: AOJu0YzQKs/k6L6dKFYGMujx8ziWqMOCbrG3PPEQKXunamSlgw2laJs+ a9ilPPYSlYajJzvn28JKb/ZDuOdDMziWFYy7Ylr3iqNxhmR9aAUrcB4CoFY/IUo1e4AHIUFCVNP HHlni0yg= X-Gm-Gg: Acq92OE63NmNy9anA/2+iJ8cJwfMIMrKUXHozia7TlH8sBejvh+HzhSrhn2igkTZwyo 3dgec+5S3wN27DDuUMcjSrAZN3zWGwmw4o9I1RikokrEJiMOgC6rY7MIRN0uDjvuGagQeWxbSe0 bsTNfYhgLNFWeQ13SCoPlgPusvFn79MiKHDb6bW8a2SU5RX4oMel4weJDp1xInIS2DfEfvsDeTp PCjp6S3otuej0Lk8MlnhJ9QKyTF8NkpPjqbjq8KjPM7X1mhUmjVRduU/WGGvzFcxHMVaNcgwcwY 3JjuLvd1C3vMh09G8a45eWRep2pyUEpDuiwJiIR2GUyehK2AEL9/t17pW4vrb4ZsfQCf6vRGeYl eReaNLTyTBMumGfswzC+FKidQHJbyKnaD7MGNO2aLHd/mt7jgV1SeGUUdCzMhxUf09rBSJ3S7AG wCJQKLKtq33HyiONSUzacrlfZ1ti71NSPudPKp4cDbJDVSO5sH0VNSBTWd8WD5P8q0eXVtC4++7 rkucRwjopE= X-Received: by 2002:a05:600c:8b65:b0:48a:53ea:140b with SMTP id 5b1f17b1804b1-48e51f4e5fdmr481920005e9.28.1778567024950; Mon, 11 May 2026 23:23:44 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 17/41] target/ppc: Make get_phys_page_debug handle non-page-aligned addrs Date: Tue, 12 May 2026 08:21:18 +0200 Message-ID: <20260512062142.67998-18-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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=philmd@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: 1778567358971158500 From: Peter Maydell Currently our implementations of SysemuCPUOps::get_phys_page_debug and SysemuCPUOps::get_phys_page_attrs_debug are a mix of "accepts a non-page-aligned virtual address and returns the corresponding non-page-aligned physical address" and "only returns a page-aligned physical address". This is awkward for callsites, which in practice all want the physical address for an arbitrary virtual address and have to work around the possibility of getting a page-aligned address, and it doesn't account for protection being possibly on a sub-page-sized granularity. We want to standardize on the implementation having to handle non-page-aligned addresses. The ppc_xlate() function can accept a non-page-aligned input but may return a page-aligned output; we take the simple approach of ORing the page offset back into the result address after calling it. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20260417173105.1648172-8-peter.maydell@linaro.org Reviewed-by: Glenn Miles Message-ID: <20260430093810.2762539-9-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/ppc/mmu_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/ppc/mmu_common.c b/target/ppc/mmu_common.c index 52d48615ac2..a1345df7160 100644 --- a/target/ppc/mmu_common.c +++ b/target/ppc/mmu_common.c @@ -863,7 +863,7 @@ hwaddr ppc_cpu_get_phys_page_debug(CPUState *cs, vaddr = addr) ppc_env_mmu_index(&cpu->env, false), false) || ppc_xlate(cpu, addr, MMU_INST_FETCH, &raddr, &s, &p, ppc_env_mmu_index(&cpu->env, true), false)) { - return raddr & TARGET_PAGE_MASK; + return raddr | (addr & ~TARGET_PAGE_MASK); } return -1; } --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567103; cv=none; d=zohomail.com; s=zohoarc; b=YZzpnsPHRskpcgObiXPqRAvTdn7/poL6DkrgRc9+52fPjdjc3wTZnDXaS9KMfSnJip7xKuLyV35DaK2A/0XV48VEziewGcWQfPZnZij/ow0dRC38iWzoczqUHjc3GJC2RaiEKr1kCEVqUNV5f5ALNsfe5IZE4kmObDPzllYKr7U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567103; 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=Im0G5QYLnVALsKaDdPLc9NnFP+w2XFubzxqVhJMKNvE=; b=C5khRMVbD9ALHj67sFXY2Er/6/EMXzQAo21Y069KuVSeCtK8lAT9SHuUhfQSAgfN/PnncKewfG6dQ6Kwf8EzvxLr2brjXagmDHW5EEQaqrKixfbWoZM6eVEszIdLq+HYaBY9qbvwJ1k08siUbbUPsOrQC023Ln+m5ZmrZEKc27I= 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 1778567103936929.3070406568546; Mon, 11 May 2026 23:25:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgY5-0003eU-BL; Tue, 12 May 2026 02:24:57 -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 1wMgXJ-00034K-QH for qemu-devel@nongnu.org; Tue, 12 May 2026 02:24:11 -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 1wMgX5-0005RC-Lm for qemu-devel@nongnu.org; Tue, 12 May 2026 02:24:00 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4891e5b9c1fso47365335e9.2 for ; Mon, 11 May 2026 23:23:54 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48e8f4389a6sm10318725e9.22.2026.05.11.23.23.50 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:23:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778567033; x=1779171833; 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; bh=Im0G5QYLnVALsKaDdPLc9NnFP+w2XFubzxqVhJMKNvE=; b=EOK2N+YFY9Mb/VKp1bkBjoJJarQXAfMP3+YxCpzFQhR/5cz/26NC//TyTuEqMHa+xs Bnsb9My3bhCV3pHW1GywIIs5yyGi8keOMmL0wyJT/c+f4VUytmr/ZPIn6bfUh9HXhNPZ hfi6WYrakh9t0vPJe0HxaIL6ZG99e9G4IRMPx2yAZSqHLMH/a/NIgE25Rn1bqv0yveEc 3FOdHcCN3qIQN5Myo7AbhB5V9xOHTli4OJZRdf4x0r0LMOLjmv4CB35LMsgyGmH/ZfO8 B16MpxB8aC5tLbPkQOy888lkoFyE4IzBzokv9131f0CTR4ttss7EA7OMx8IDQEZZ+NrZ l0AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778567033; x=1779171833; 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; bh=Im0G5QYLnVALsKaDdPLc9NnFP+w2XFubzxqVhJMKNvE=; b=XcKwt3nx5VCyN2JF6fRRGEOtu4WPBly7wUjfenXsWuPQeF+UswM2eHf1E79lKhGIwm 6904VLhDZC5Rrw2jvEeBDyBnEU6cCtkmS5lXNzz5q12mF6U6pASDYmDdUAkj+34J53hN MtsrJtJCb1ifw6j6mF7u8NocTWOkIbxyWTUPCkFHa8dlj6tOf5uNN4o51w5LnNrceVRV R3aqnsh6gjTsO0sGBRv1Uhv7g+hqqMi0mxIP8aYHCCpnJd1dTdj234K6HRKTXOM2xEj1 hh8jfTwVG1hsrrtGF8+L1TPkCqICsFhdVMIGdMOdsVqsFyriKJYz/X+yISdcFsg+bac4 npqA== X-Gm-Message-State: AOJu0Yx8RRtcQBl03oo7epLh/SyxWylbbZF1Oi2iKxoIjHBryTBA92us 7Aojj/lX9reLDiVFmymSTvlnKf5+ehh0bL75TAR+P2tjxsq4mXtGc1OfY8k9fpFjcar3UVPxmRm 2HO8mLSY= X-Gm-Gg: Acq92OFv6WL+l3ObB3a+Qsn/lVAZE+y9jVln3AgIxwd6cAAdgh5rtLencnClt/WLcuq 2URNwqVcuX8ohgRQ+PqRW5lF+se3/XzHIMbbxCoKo/E73CABgiRQPUPN1MSBZs9SmoJywVq4uaq aR5ubqvPFR/48fiPTpqhga19YSzvnpxEKwbXevsHJQ/nXKSUz+IlxMPDwBKBI90SFGkOKYsmGXH jM5FsX0xIsdrBhtURrYBUY2mANOShdnyYVwk8DLg8j08j4YaCl9bnRXiRYBTHyYnCYgX2VkJ8O0 nh2C8dztQAvZkBw6JtOg4a0gGErB/gNYtDQQutlsoVRq2HlSSWFJMTD8e3HO8Cjrmvbm/jivTPL Jb227qvXUf0vbQgdyKZnLFFW5yjxutYqj3VOVs0JRjRbRNNHKuJNqxqXiCYUsnj3dkAGdygsxmC M3uNH4nb7v0+qTCSIdj+OsGA2m8IqzojDMbAFyw5ZTMJkw11KEuyJcV2owl0x++u7oyryLXo1J X-Received: by 2002:a05:600c:528e:b0:48e:7f1c:8778 with SMTP id 5b1f17b1804b1-48e8fe721bcmr23810825e9.17.1778567032337; Mon, 11 May 2026 23:23:52 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 18/41] target: Rename get_phys_page_debug to get_phys_addr_debug Date: Tue, 12 May 2026 08:21:19 +0200 Message-ID: <20260512062142.67998-19-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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=philmd@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: 1778567106009154100 From: Peter Maydell Now that we have ensured that all implementations of the get_phys_page_debug method handle a non-page-aligned input and return the corresponding non-page-aligned output, the name of the method is somewhat misleading. Rename it to get_phys_addr_debug. This commit was produced with the commands sed -i -e 's/_cpu_get_phys_page_debug/_cpu_get_phys_addr_debug/g;s/\/get_phys_addr_debug/g' $(git grep -l get_phys_page_debug) sed -i -e 's/_cpu_get_phys_page_attrs_debug/_cpu_get_phys_addr_attrs_debug= /g;s/\/get_phys_addr_attrs_debug/g' $(git grep = -l get_phys_page_attrs_debug) which catches all references to the method name itself plus the functions which each target uses as the method implementation, but (deliberately) not the cpu_phys_get_page_debug() and cpu_phys_get_page_attrs_debug() wrapper functions or their callers. (We'll deal with those in the next commit.) Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20260417173105.1648172-9-peter.maydell@linaro.org Message-ID: <20260430093810.2762539-10-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/core/sysemu-cpu-ops.h | 10 +++++----- target/alpha/cpu.h | 2 +- target/arm/cpu.h | 2 +- target/avr/cpu.h | 2 +- target/hppa/cpu.h | 2 +- target/i386/cpu.h | 2 +- target/loongarch/cpu-mmu.h | 2 +- target/m68k/cpu.h | 2 +- target/microblaze/cpu.h | 2 +- target/mips/internal.h | 2 +- target/or1k/cpu.h | 2 +- target/ppc/cpu.h | 2 +- target/riscv/cpu.h | 2 +- target/rx/cpu.h | 2 +- target/sh4/cpu.h | 2 +- target/sparc/cpu.h | 2 +- target/tricore/cpu.h | 2 +- target/xtensa/cpu.h | 2 +- hw/core/cpu-system.c | 6 +++--- target/alpha/cpu.c | 2 +- target/alpha/helper.c | 2 +- target/arm/cpu.c | 2 +- target/arm/ptw.c | 2 +- target/avr/cpu.c | 2 +- target/avr/helper.c | 2 +- target/hppa/cpu.c | 2 +- target/hppa/mem_helper.c | 2 +- target/i386/cpu.c | 2 +- target/i386/helper.c | 2 +- target/i386/whpx/whpx-all.c | 2 +- target/loongarch/cpu.c | 2 +- target/loongarch/cpu_helper.c | 2 +- target/m68k/cpu.c | 2 +- target/m68k/helper.c | 2 +- target/microblaze/cpu.c | 2 +- target/microblaze/helper.c | 2 +- target/mips/cpu.c | 2 +- target/mips/system/physaddr.c | 2 +- target/or1k/cpu.c | 2 +- target/or1k/mmu.c | 2 +- target/ppc/cpu_init.c | 2 +- target/ppc/mmu-hash32.c | 2 +- target/ppc/mmu_common.c | 2 +- target/riscv/cpu.c | 2 +- target/riscv/cpu_helper.c | 2 +- target/rx/cpu.c | 2 +- target/rx/helper.c | 2 +- target/s390x/cpu-system.c | 2 +- target/sh4/cpu.c | 2 +- target/sh4/helper.c | 2 +- target/sparc/cpu.c | 2 +- target/sparc/mmu_helper.c | 2 +- target/tricore/cpu.c | 2 +- target/tricore/helper.c | 2 +- target/xtensa/cpu.c | 2 +- target/xtensa/mmu_helper.c | 2 +- 56 files changed, 62 insertions(+), 62 deletions(-) diff --git a/include/hw/core/sysemu-cpu-ops.h b/include/hw/core/sysemu-cpu-= ops.h index 94e36ecdd18..1524d6f25bb 100644 --- a/include/hw/core/sysemu-cpu-ops.h +++ b/include/hw/core/sysemu-cpu-ops.h @@ -30,17 +30,17 @@ typedef struct SysemuCPUOps { */ bool (*get_paging_enabled)(const CPUState *cpu); /** - * @get_phys_page_debug: Callback for obtaining a physical address. + * @get_phys_addr_debug: Callback for obtaining a physical address. */ - hwaddr (*get_phys_page_debug)(CPUState *cpu, vaddr addr); + hwaddr (*get_phys_addr_debug)(CPUState *cpu, vaddr addr); /** - * @get_phys_page_attrs_debug: Callback for obtaining a physical addre= ss + * @get_phys_addr_attrs_debug: Callback for obtaining a physical addre= ss * and the associated memory transaction attributes to use for t= he * access. * CPUs which use memory transaction attributes should implement this - * instead of get_phys_page_debug. + * instead of get_phys_addr_debug. */ - hwaddr (*get_phys_page_attrs_debug)(CPUState *cpu, vaddr addr, + hwaddr (*get_phys_addr_attrs_debug)(CPUState *cpu, vaddr addr, MemTxAttrs *attrs); /** * @asidx_from_attrs: Callback to return the CPU AddressSpace to use f= or diff --git a/target/alpha/cpu.h b/target/alpha/cpu.h index 2f611397782..378bd96d941 100644 --- a/target/alpha/cpu.h +++ b/target/alpha/cpu.h @@ -282,7 +282,7 @@ extern const VMStateDescription vmstate_alpha_cpu; =20 void alpha_cpu_do_interrupt(CPUState *cpu); bool alpha_cpu_exec_interrupt(CPUState *cpu, int int_req); -hwaddr alpha_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); +hwaddr alpha_cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr); #endif /* !CONFIG_USER_ONLY */ void alpha_cpu_dump_state(CPUState *cs, FILE *f, int flags); int alpha_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); diff --git a/target/arm/cpu.h b/target/arm/cpu.h index a0a1d7fbe32..60f11379bfb 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -1260,7 +1260,7 @@ extern const VMStateDescription vmstate_arm_cpu; void arm_cpu_do_interrupt(CPUState *cpu); void arm_v7m_cpu_do_interrupt(CPUState *cpu); =20 -hwaddr arm_cpu_get_phys_page_attrs_debug(CPUState *cpu, vaddr addr, +hwaddr arm_cpu_get_phys_addr_attrs_debug(CPUState *cpu, vaddr addr, MemTxAttrs *attrs); =20 typedef struct ARMGranuleProtectionConfig { diff --git a/target/avr/cpu.h b/target/avr/cpu.h index 3da885c7ccb..a818db753b2 100644 --- a/target/avr/cpu.h +++ b/target/avr/cpu.h @@ -177,7 +177,7 @@ extern const struct VMStateDescription vms_avr_cpu; =20 void avr_cpu_do_interrupt(CPUState *cpu); bool avr_cpu_exec_interrupt(CPUState *cpu, int int_req); -hwaddr avr_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); +hwaddr avr_cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr); int avr_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int avr_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); int avr_print_insn(bfd_vma addr, disassemble_info *info); diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 85f39401423..f453444d7f9 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -389,7 +389,7 @@ int hppa_cpu_gdb_write_register(CPUState *cpu, uint8_t = *buf, int reg); void hppa_cpu_dump_state(CPUState *cs, FILE *f, int); #ifndef CONFIG_USER_ONLY void hppa_ptlbe(CPUHPPAState *env); -hwaddr hppa_cpu_get_phys_page_debug(CPUState *cs, vaddr addr); +hwaddr hppa_cpu_get_phys_addr_debug(CPUState *cs, vaddr addr); void hppa_set_ior_and_isr(CPUHPPAState *env, vaddr addr, bool mmu_disabled= ); bool hppa_cpu_tlb_fill_align(CPUState *cs, CPUTLBEntryFull *out, vaddr add= r, MMUAccessType access_type, int mmu_idx, diff --git a/target/i386/cpu.h b/target/i386/cpu.h index a836efd45ee..bdd4fff89d6 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -2581,7 +2581,7 @@ int cpu_x86_support_mca_broadcast(CPUX86State *env); #ifndef CONFIG_USER_ONLY int x86_cpu_pending_interrupt(CPUState *cs, int interrupt_request); =20 -hwaddr x86_cpu_get_phys_page_attrs_debug(CPUState *cpu, vaddr addr, +hwaddr x86_cpu_get_phys_addr_attrs_debug(CPUState *cpu, vaddr addr, MemTxAttrs *attrs); int cpu_get_pic_interrupt(CPUX86State *s); =20 diff --git a/target/loongarch/cpu-mmu.h b/target/loongarch/cpu-mmu.h index 3286accc143..2d7ebb2d724 100644 --- a/target/loongarch/cpu-mmu.h +++ b/target/loongarch/cpu-mmu.h @@ -97,7 +97,7 @@ TLBRet loongarch_ptw(CPULoongArchState *env, MMUContext *= context, int access_type, int mmu_idx, int debug); void get_dir_base_width(CPULoongArchState *env, uint64_t *dir_base, uint64_t *dir_width, unsigned int level); -hwaddr loongarch_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); +hwaddr loongarch_cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr); uint64_t loongarch_palen_mask(CPULoongArchState *env); =20 #endif /* LOONGARCH_CPU_MMU_H */ diff --git a/target/m68k/cpu.h b/target/m68k/cpu.h index d7f508a9e80..7cf3791108c 100644 --- a/target/m68k/cpu.h +++ b/target/m68k/cpu.h @@ -185,7 +185,7 @@ struct M68kCPUClass { #ifndef CONFIG_USER_ONLY void m68k_cpu_do_interrupt(CPUState *cpu); bool m68k_cpu_exec_interrupt(CPUState *cpu, int int_req); -hwaddr m68k_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); +hwaddr m68k_cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr); #endif /* !CONFIG_USER_ONLY */ void m68k_cpu_dump_state(CPUState *cpu, FILE *f, int flags); int m68k_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h index ad5a4a8e7bf..068da605295 100644 --- a/target/microblaze/cpu.h +++ b/target/microblaze/cpu.h @@ -369,7 +369,7 @@ struct MicroBlazeCPUClass { #ifndef CONFIG_USER_ONLY void mb_cpu_do_interrupt(CPUState *cs); bool mb_cpu_exec_interrupt(CPUState *cs, int int_req); -hwaddr mb_cpu_get_phys_page_attrs_debug(CPUState *cpu, vaddr addr, +hwaddr mb_cpu_get_phys_addr_attrs_debug(CPUState *cpu, vaddr addr, MemTxAttrs *attrs); #endif /* !CONFIG_USER_ONLY */ G_NORETURN void mb_cpu_do_unaligned_access(CPUState *cs, vaddr vaddr, diff --git a/target/mips/internal.h b/target/mips/internal.h index 23e1ada1852..aab77b1b257 100644 --- a/target/mips/internal.h +++ b/target/mips/internal.h @@ -115,7 +115,7 @@ enum { int get_physical_address(CPUMIPSState *env, hwaddr *physical, int *prot, target_ulong real_address, MMUAccessType access_type, int mmu_idx); -hwaddr mips_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); +hwaddr mips_cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr); =20 typedef struct r4k_tlb_t r4k_tlb_t; struct r4k_tlb_t { diff --git a/target/or1k/cpu.h b/target/or1k/cpu.h index 5bb39b67519..fc4387ce7ae 100644 --- a/target/or1k/cpu.h +++ b/target/or1k/cpu.h @@ -296,7 +296,7 @@ void openrisc_translate_code(CPUState *cs, TranslationB= lock *tb, int print_insn_or1k(bfd_vma addr, disassemble_info *info); =20 #ifndef CONFIG_USER_ONLY -hwaddr openrisc_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); +hwaddr openrisc_cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr); =20 bool openrisc_cpu_tlb_fill(CPUState *cs, vaddr address, int size, MMUAccessType access_type, int mmu_idx, diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index aba8109bbba..057c54bbb81 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -1639,7 +1639,7 @@ void ppc_cpu_dump_state(CPUState *cpu, FILE *f, int f= lags); int ppc_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int ppc_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); #ifndef CONFIG_USER_ONLY -hwaddr ppc_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); +hwaddr ppc_cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr); #endif int ppc64_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs, int cpuid, DumpState *s); diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index e42f3694089..fae839cade4 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -629,7 +629,7 @@ void riscv_cpu_do_transaction_failed(CPUState *cs, hwad= dr physaddr, MMUAccessType access_type, int mmu_idx, MemTxAttrs attrs, MemTxResult response, uintptr_t retad= dr); -hwaddr riscv_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); +hwaddr riscv_cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr); bool riscv_cpu_exec_interrupt(CPUState *cs, int interrupt_request); void riscv_cpu_swap_hypervisor_regs(CPURISCVState *env); int riscv_cpu_claim_interrupts(RISCVCPU *cpu, uint64_t interrupts); diff --git a/target/rx/cpu.h b/target/rx/cpu.h index b500b7a2474..64ba48a7329 100644 --- a/target/rx/cpu.h +++ b/target/rx/cpu.h @@ -136,7 +136,7 @@ struct RXCPUClass { const char *rx_crname(uint8_t cr); void rx_cpu_do_interrupt(CPUState *cpu); bool rx_cpu_exec_interrupt(CPUState *cpu, int int_req); -hwaddr rx_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); +hwaddr rx_cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr); void rx_cpu_dump_state(CPUState *cpu, FILE *f, int flags); int rx_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int rx_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); diff --git a/target/sh4/cpu.h b/target/sh4/cpu.h index e36268b4256..4b0f3f6d97d 100644 --- a/target/sh4/cpu.h +++ b/target/sh4/cpu.h @@ -251,7 +251,7 @@ void sh4_translate_code(CPUState *cs, TranslationBlock = *tb, int *max_insns, vaddr pc, void *host_pc); =20 #if !defined(CONFIG_USER_ONLY) -hwaddr superh_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); +hwaddr superh_cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr); bool superh_cpu_tlb_fill(CPUState *cs, vaddr address, int size, MMUAccessType access_type, int mmu_idx, bool probe, uintptr_t retaddr); diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h index ac0eb9f0faa..5f583ed9de2 100644 --- a/target/sparc/cpu.h +++ b/target/sparc/cpu.h @@ -580,7 +580,7 @@ struct SPARCCPUClass { #ifndef CONFIG_USER_ONLY extern const VMStateDescription vmstate_sparc_cpu; =20 -hwaddr sparc_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); +hwaddr sparc_cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr); #endif =20 void sparc_cpu_do_interrupt(CPUState *cpu); diff --git a/target/tricore/cpu.h b/target/tricore/cpu.h index 604fb7792c6..12e497d2a7a 100644 --- a/target/tricore/cpu.h +++ b/target/tricore/cpu.h @@ -79,7 +79,7 @@ struct TriCoreCPUClass { ResettablePhases parent_phases; }; =20 -hwaddr tricore_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); +hwaddr tricore_cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr); void tricore_cpu_dump_state(CPUState *cpu, FILE *f, int flags); =20 FIELD(PCXI, PCPN_13, 24, 8) diff --git a/target/xtensa/cpu.h b/target/xtensa/cpu.h index dfd2ceab7cf..75cfeee6e30 100644 --- a/target/xtensa/cpu.h +++ b/target/xtensa/cpu.h @@ -590,7 +590,7 @@ void xtensa_cpu_do_transaction_failed(CPUState *cs, hwa= ddr physaddr, vaddr addr, unsigned size, MMUAccessType access_= type, int mmu_idx, MemTxAttrs attrs, MemTxResult response, uintptr_t reta= ddr); -hwaddr xtensa_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); +hwaddr xtensa_cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr); bool xtensa_debug_check_breakpoint(CPUState *cs); #endif void xtensa_cpu_dump_state(CPUState *cpu, FILE *f, int flags); diff --git a/hw/core/cpu-system.c b/hw/core/cpu-system.c index 273b9b7c223..93dc861083c 100644 --- a/hw/core/cpu-system.c +++ b/hw/core/cpu-system.c @@ -60,13 +60,13 @@ hwaddr cpu_get_phys_page_attrs_debug(CPUState *cpu, vad= dr addr, { hwaddr paddr; =20 - if (cpu->cc->sysemu_ops->get_phys_page_attrs_debug) { - paddr =3D cpu->cc->sysemu_ops->get_phys_page_attrs_debug(cpu, addr, + if (cpu->cc->sysemu_ops->get_phys_addr_attrs_debug) { + paddr =3D cpu->cc->sysemu_ops->get_phys_addr_attrs_debug(cpu, addr, attrs); } else { /* Fallback for CPUs which don't implement the _attrs_ hook */ *attrs =3D MEMTXATTRS_UNSPECIFIED; - paddr =3D cpu->cc->sysemu_ops->get_phys_page_debug(cpu, addr); + paddr =3D cpu->cc->sysemu_ops->get_phys_addr_debug(cpu, addr); } /* Indicate that this is a debug access. */ attrs->debug =3D 1; diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index ff053043a38..0c35067b202 100644 --- a/target/alpha/cpu.c +++ b/target/alpha/cpu.c @@ -242,7 +242,7 @@ static void alpha_cpu_initfn(Object *obj) =20 static const struct SysemuCPUOps alpha_sysemu_ops =3D { .has_work =3D alpha_cpu_has_work, - .get_phys_page_debug =3D alpha_cpu_get_phys_page_debug, + .get_phys_addr_debug =3D alpha_cpu_get_phys_addr_debug, }; #endif =20 diff --git a/target/alpha/helper.c b/target/alpha/helper.c index af6d7847d50..33fed0c746a 100644 --- a/target/alpha/helper.c +++ b/target/alpha/helper.c @@ -295,7 +295,7 @@ static int get_physical_address(CPUAlphaState *env, vad= dr addr, return ret; } =20 -hwaddr alpha_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) +hwaddr alpha_cpu_get_phys_addr_debug(CPUState *cs, vaddr addr) { hwaddr phys; int prot, fail; diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 330e9be4730..6e13873360d 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -2498,7 +2498,7 @@ static vaddr aarch64_untagged_addr(CPUState *cs, vadd= r x) =20 static const struct SysemuCPUOps arm_sysemu_ops =3D { .has_work =3D arm_cpu_has_work, - .get_phys_page_attrs_debug =3D arm_cpu_get_phys_page_attrs_debug, + .get_phys_addr_attrs_debug =3D arm_cpu_get_phys_addr_attrs_debug, .asidx_from_attrs =3D arm_asidx_from_attrs, .write_elf32_note =3D arm_cpu_write_elf32_note, .write_elf64_note =3D arm_cpu_write_elf64_note, diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 316e201cfe0..7dd3a7a3ede 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -3963,7 +3963,7 @@ static hwaddr arm_cpu_get_phys_page(CPUARMState *env,= vaddr addr, return res.f.phys_addr; } =20 -hwaddr arm_cpu_get_phys_page_attrs_debug(CPUState *cs, vaddr addr, +hwaddr arm_cpu_get_phys_addr_attrs_debug(CPUState *cs, vaddr addr, MemTxAttrs *attrs) { ARMCPU *cpu =3D ARM_CPU(cs); diff --git a/target/avr/cpu.c b/target/avr/cpu.c index 8579a7283b1..35912192126 100644 --- a/target/avr/cpu.c +++ b/target/avr/cpu.c @@ -233,7 +233,7 @@ static void avr_cpu_dump_state(CPUState *cs, FILE *f, i= nt flags) =20 static const struct SysemuCPUOps avr_sysemu_ops =3D { .has_work =3D avr_cpu_has_work, - .get_phys_page_debug =3D avr_cpu_get_phys_page_debug, + .get_phys_addr_debug =3D avr_cpu_get_phys_addr_debug, }; =20 static const TCGCPUOps avr_tcg_ops =3D { diff --git a/target/avr/helper.c b/target/avr/helper.c index 365c8c60e19..f3be8483b27 100644 --- a/target/avr/helper.c +++ b/target/avr/helper.c @@ -107,7 +107,7 @@ void avr_cpu_do_interrupt(CPUState *cs) qemu_plugin_vcpu_interrupt_cb(cs, ret); } =20 -hwaddr avr_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) +hwaddr avr_cpu_get_phys_addr_debug(CPUState *cs, vaddr addr) { return addr; /* I assume 1:1 address correspondence */ } diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 92027d129a7..6443122cf1a 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -244,7 +244,7 @@ static ObjectClass *hppa_cpu_class_by_name(const char *= cpu_model) =20 static const struct SysemuCPUOps hppa_sysemu_ops =3D { .has_work =3D hppa_cpu_has_work, - .get_phys_page_debug =3D hppa_cpu_get_phys_page_debug, + .get_phys_addr_debug =3D hppa_cpu_get_phys_addr_debug, }; #endif =20 diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index ffbad8acfd2..f5076492264 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -345,7 +345,7 @@ int hppa_get_physical_address(CPUHPPAState *env, vaddr = addr, int mmu_idx, return ret; } =20 -hwaddr hppa_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) +hwaddr hppa_cpu_get_phys_addr_debug(CPUState *cs, vaddr addr) { HPPACPU *cpu =3D HPPA_CPU(cs); hwaddr phys; diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 97c66c22262..7248720a0eb 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -10877,7 +10877,7 @@ static const struct SysemuCPUOps i386_sysemu_ops = =3D { .has_work =3D x86_cpu_has_work, .get_memory_mapping =3D x86_cpu_get_memory_mapping, .get_paging_enabled =3D x86_cpu_get_paging_enabled, - .get_phys_page_attrs_debug =3D x86_cpu_get_phys_page_attrs_debug, + .get_phys_addr_attrs_debug =3D x86_cpu_get_phys_addr_attrs_debug, .asidx_from_attrs =3D x86_asidx_from_attrs, .get_crash_info =3D x86_cpu_get_crash_info, .write_elf32_note =3D x86_cpu_write_elf32_note, diff --git a/target/i386/helper.c b/target/i386/helper.c index 108b02396de..8cc73f619a9 100644 --- a/target/i386/helper.c +++ b/target/i386/helper.c @@ -252,7 +252,7 @@ void cpu_x86_update_cr4(CPUX86State *env, uint32_t new_= cr4) } =20 #if !defined(CONFIG_USER_ONLY) -hwaddr x86_cpu_get_phys_page_attrs_debug(CPUState *cs, vaddr addr, +hwaddr x86_cpu_get_phys_addr_attrs_debug(CPUState *cs, vaddr addr, MemTxAttrs *attrs) { X86CPU *cpu =3D X86_CPU(cs); diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index 9d0c391e36f..7943adb93fe 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -247,7 +247,7 @@ struct whpx_register_set { * e. Let the affected CPU run in the exclusive mode. * f. Restore the original handler and the exception exit bitmap. * Note that handling all corner cases related to IDT/GDT is harder - * than it may seem. See x86_cpu_get_phys_page_attrs_debug() for a + * than it may seem. See x86_cpu_get_phys_addr_attrs_debug() for a * rough idea. * * 3. In order to properly support guest-level debugging in parallel w= ith diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index d8d106b07e5..8f277f76961 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -836,7 +836,7 @@ static void loongarch_cpu_dump_state(CPUState *cs, FILE= *f, int flags) static const struct SysemuCPUOps loongarch_sysemu_ops =3D { .has_work =3D loongarch_cpu_has_work, .write_elf64_note =3D loongarch_cpu_write_elf64_note, - .get_phys_page_debug =3D loongarch_cpu_get_phys_page_debug, + .get_phys_addr_debug =3D loongarch_cpu_get_phys_addr_debug, }; =20 static int64_t loongarch_cpu_get_arch_id(CPUState *cs) diff --git a/target/loongarch/cpu_helper.c b/target/loongarch/cpu_helper.c index 4b7743c4f28..eb9684a4a16 100644 --- a/target/loongarch/cpu_helper.c +++ b/target/loongarch/cpu_helper.c @@ -359,7 +359,7 @@ TLBRet get_physical_address(CPULoongArchState *env, MMU= Context *context, return loongarch_map_address(env, context, access_type, mmu_idx, is_de= bug); } =20 -hwaddr loongarch_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) +hwaddr loongarch_cpu_get_phys_addr_debug(CPUState *cs, vaddr addr) { CPULoongArchState *env =3D cpu_env(cs); MMUContext context; diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index f704a6af613..9ad3057d91c 100644 --- a/target/m68k/cpu.c +++ b/target/m68k/cpu.c @@ -623,7 +623,7 @@ static const MonitorDef m68k_monitor_defs[] =3D { =20 static const struct SysemuCPUOps m68k_sysemu_ops =3D { .has_work =3D m68k_cpu_has_work, - .get_phys_page_debug =3D m68k_cpu_get_phys_page_debug, + .get_phys_addr_debug =3D m68k_cpu_get_phys_addr_debug, .monitor_defs =3D m68k_monitor_defs, }; #endif /* !CONFIG_USER_ONLY */ diff --git a/target/m68k/helper.c b/target/m68k/helper.c index 9bab1843892..2dd9ec1bdcb 100644 --- a/target/m68k/helper.c +++ b/target/m68k/helper.c @@ -907,7 +907,7 @@ txfail: return -1; } =20 -hwaddr m68k_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) +hwaddr m68k_cpu_get_phys_addr_debug(CPUState *cs, vaddr addr) { CPUM68KState *env =3D cpu_env(cs); hwaddr phys_addr; diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 04d31536888..c6a456dd5ec 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -428,7 +428,7 @@ static ObjectClass *mb_cpu_class_by_name(const char *cp= u_model) =20 static const struct SysemuCPUOps mb_sysemu_ops =3D { .has_work =3D mb_cpu_has_work, - .get_phys_page_attrs_debug =3D mb_cpu_get_phys_page_attrs_debug, + .get_phys_addr_attrs_debug =3D mb_cpu_get_phys_addr_attrs_debug, }; #endif =20 diff --git a/target/microblaze/helper.c b/target/microblaze/helper.c index da8abe063e7..f81c4f625b5 100644 --- a/target/microblaze/helper.c +++ b/target/microblaze/helper.c @@ -280,7 +280,7 @@ void mb_cpu_do_interrupt(CPUState *cs) } } =20 -hwaddr mb_cpu_get_phys_page_attrs_debug(CPUState *cs, vaddr addr, +hwaddr mb_cpu_get_phys_addr_attrs_debug(CPUState *cs, vaddr addr, MemTxAttrs *attrs) { MicroBlazeCPU *cpu =3D MICROBLAZE_CPU(cs); diff --git a/target/mips/cpu.c b/target/mips/cpu.c index f803d477632..88bb59d506b 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -545,7 +545,7 @@ static ObjectClass *mips_cpu_class_by_name(const char *= cpu_model) =20 static const struct SysemuCPUOps mips_sysemu_ops =3D { .has_work =3D mips_cpu_has_work, - .get_phys_page_debug =3D mips_cpu_get_phys_page_debug, + .get_phys_addr_debug =3D mips_cpu_get_phys_addr_debug, .legacy_vmsd =3D &vmstate_mips_cpu, }; #endif diff --git a/target/mips/system/physaddr.c b/target/mips/system/physaddr.c index b8e1a5ac98e..fbbbcf6e006 100644 --- a/target/mips/system/physaddr.c +++ b/target/mips/system/physaddr.c @@ -228,7 +228,7 @@ int get_physical_address(CPUMIPSState *env, hwaddr *phy= sical, return ret; } =20 -hwaddr mips_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) +hwaddr mips_cpu_get_phys_addr_debug(CPUState *cs, vaddr addr) { CPUMIPSState *env =3D cpu_env(cs); hwaddr phys_addr; diff --git a/target/or1k/cpu.c b/target/or1k/cpu.c index 3d1c22bf75d..ea29b2e01fa 100644 --- a/target/or1k/cpu.c +++ b/target/or1k/cpu.c @@ -247,7 +247,7 @@ static void openrisc_any_initfn(Object *obj) =20 static const struct SysemuCPUOps openrisc_sysemu_ops =3D { .has_work =3D openrisc_cpu_has_work, - .get_phys_page_debug =3D openrisc_cpu_get_phys_page_debug, + .get_phys_addr_debug =3D openrisc_cpu_get_phys_addr_debug, }; #endif =20 diff --git a/target/or1k/mmu.c b/target/or1k/mmu.c index 315debaf3e5..3ff288a1f94 100644 --- a/target/or1k/mmu.c +++ b/target/or1k/mmu.c @@ -138,7 +138,7 @@ bool openrisc_cpu_tlb_fill(CPUState *cs, vaddr addr, in= t size, cpu_loop_exit_restore(cs, retaddr); } =20 -hwaddr openrisc_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) +hwaddr openrisc_cpu_get_phys_addr_debug(CPUState *cs, vaddr addr) { OpenRISCCPU *cpu =3D OPENRISC_CPU(cs); int prot, excp, sr =3D cpu->env.sr; diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index 191f5726f69..d25f69f13ba 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -7477,7 +7477,7 @@ static void ppc_disas_set_info(const CPUState *cs, di= sassemble_info *info) =20 static const struct SysemuCPUOps ppc_sysemu_ops =3D { .has_work =3D ppc_cpu_has_work, - .get_phys_page_debug =3D ppc_cpu_get_phys_page_debug, + .get_phys_addr_debug =3D ppc_cpu_get_phys_addr_debug, .write_elf32_note =3D ppc32_cpu_write_elf32_note, .write_elf64_note =3D ppc64_cpu_write_elf64_note, .internal_is_big_endian =3D ppc_cpu_is_big_endian, diff --git a/target/ppc/mmu-hash32.c b/target/ppc/mmu-hash32.c index 08c9f63a132..cbed4fe50b6 100644 --- a/target/ppc/mmu-hash32.c +++ b/target/ppc/mmu-hash32.c @@ -131,7 +131,7 @@ static bool ppc_hash32_direct_store(PowerPCCPU *cpu, ta= rget_ulong sr, } =20 /* - * From ppc_cpu_get_phys_page_debug, env->access_type is not set. + * From ppc_cpu_get_phys_addr_debug, env->access_type is not set. * Assume ACCESS_INT for that case. */ switch (guest_visible ? env->access_type : ACCESS_INT) { diff --git a/target/ppc/mmu_common.c b/target/ppc/mmu_common.c index a1345df7160..2499e619f85 100644 --- a/target/ppc/mmu_common.c +++ b/target/ppc/mmu_common.c @@ -848,7 +848,7 @@ bool ppc_xlate(PowerPCCPU *cpu, vaddr eaddr, MMUAccessT= ype access_type, } } =20 -hwaddr ppc_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) +hwaddr ppc_cpu_get_phys_addr_debug(CPUState *cs, vaddr addr) { PowerPCCPU *cpu =3D POWERPC_CPU(cs); hwaddr raddr; diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index a13727c0d4b..506a018d52b 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -2730,7 +2730,7 @@ static int64_t riscv_get_arch_id(CPUState *cs) =20 static const struct SysemuCPUOps riscv_sysemu_ops =3D { .has_work =3D riscv_cpu_has_work, - .get_phys_page_debug =3D riscv_cpu_get_phys_page_debug, + .get_phys_addr_debug =3D riscv_cpu_get_phys_addr_debug, .write_elf64_note =3D riscv_cpu_write_elf64_note, .write_elf32_note =3D riscv_cpu_write_elf32_note, .monitor_get_register =3D riscv_monitor_get_register_legacy, diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c index f786b1ebcd3..17305e1bb75 100644 --- a/target/riscv/cpu_helper.c +++ b/target/riscv/cpu_helper.c @@ -1710,7 +1710,7 @@ static void raise_mmu_exception(CPURISCVState *env, t= arget_ulong address, env->two_stage_indirect_lookup =3D two_stage_indirect; } =20 -hwaddr riscv_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) +hwaddr riscv_cpu_get_phys_addr_debug(CPUState *cs, vaddr addr) { RISCVCPU *cpu =3D RISCV_CPU(cs); CPURISCVState *env =3D &cpu->env; diff --git a/target/rx/cpu.c b/target/rx/cpu.c index b5284199e6d..20b188c24cd 100644 --- a/target/rx/cpu.c +++ b/target/rx/cpu.c @@ -209,7 +209,7 @@ static void rx_cpu_init(Object *obj) =20 static const struct SysemuCPUOps rx_sysemu_ops =3D { .has_work =3D rx_cpu_has_work, - .get_phys_page_debug =3D rx_cpu_get_phys_page_debug, + .get_phys_addr_debug =3D rx_cpu_get_phys_addr_debug, }; =20 static const TCGCPUOps rx_tcg_ops =3D { diff --git a/target/rx/helper.c b/target/rx/helper.c index daaeeec1b5c..0f99279bbaa 100644 --- a/target/rx/helper.c +++ b/target/rx/helper.c @@ -147,7 +147,7 @@ bool rx_cpu_exec_interrupt(CPUState *cs, int interrupt_= request) return false; } =20 -hwaddr rx_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) +hwaddr rx_cpu_get_phys_addr_debug(CPUState *cs, vaddr addr) { return addr; } diff --git a/target/s390x/cpu-system.c b/target/s390x/cpu-system.c index c9daa633c14..cc9685221ae 100644 --- a/target/s390x/cpu-system.c +++ b/target/s390x/cpu-system.c @@ -176,7 +176,7 @@ void s390_cpu_finalize(Object *obj) =20 static const struct SysemuCPUOps s390_sysemu_ops =3D { .has_work =3D s390_cpu_has_work, - .get_phys_page_debug =3D s390_cpu_get_phys_addr_debug, + .get_phys_addr_debug =3D s390_cpu_get_phys_addr_debug, .get_crash_info =3D s390_cpu_get_crash_info, .write_elf64_note =3D s390_cpu_write_elf64_note, .legacy_vmsd =3D &vmstate_s390_cpu, diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index e2bde457618..40d5fde76df 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@ -278,7 +278,7 @@ static const VMStateDescription vmstate_sh_cpu =3D { =20 static const struct SysemuCPUOps sh4_sysemu_ops =3D { .has_work =3D superh_cpu_has_work, - .get_phys_page_debug =3D superh_cpu_get_phys_page_debug, + .get_phys_addr_debug =3D superh_cpu_get_phys_addr_debug, }; #endif =20 diff --git a/target/sh4/helper.c b/target/sh4/helper.c index 5d6295618f5..b3ec7ce64d0 100644 --- a/target/sh4/helper.c +++ b/target/sh4/helper.c @@ -435,7 +435,7 @@ static int get_physical_address(CPUSH4State *env, hwadd= r* physical, return get_mmu_address(env, physical, prot, address, access_type); } =20 -hwaddr superh_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) +hwaddr superh_cpu_get_phys_addr_debug(CPUState *cs, vaddr addr) { hwaddr physical; int prot; diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index c6989229da6..3df199ada7b 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -1013,7 +1013,7 @@ static const MonitorDef sparc64_monitor_defs[] =3D { =20 static const struct SysemuCPUOps sparc_sysemu_ops =3D { .has_work =3D sparc_cpu_has_work, - .get_phys_page_debug =3D sparc_cpu_get_phys_page_debug, + .get_phys_addr_debug =3D sparc_cpu_get_phys_addr_debug, .legacy_vmsd =3D &vmstate_sparc_cpu, #if defined(TARGET_SPARC64) .monitor_defs =3D sparc64_monitor_defs, diff --git a/target/sparc/mmu_helper.c b/target/sparc/mmu_helper.c index 25f8a85fae4..34b212a7aa5 100644 --- a/target/sparc/mmu_helper.c +++ b/target/sparc/mmu_helper.c @@ -902,7 +902,7 @@ hwaddr cpu_get_phys_page_nofault(CPUSPARCState *env, ta= rget_ulong addr, } #endif =20 -hwaddr sparc_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) +hwaddr sparc_cpu_get_phys_addr_debug(CPUState *cs, vaddr addr) { CPUSPARCState *env =3D cpu_env(cs); hwaddr phys_addr; diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c index 04319e107ba..472c24ae32d 100644 --- a/target/tricore/cpu.c +++ b/target/tricore/cpu.c @@ -176,7 +176,7 @@ static bool tricore_cpu_exec_interrupt(CPUState *cs, in= t interrupt_request) =20 static const struct SysemuCPUOps tricore_sysemu_ops =3D { .has_work =3D tricore_cpu_has_work, - .get_phys_page_debug =3D tricore_cpu_get_phys_page_debug, + .get_phys_addr_debug =3D tricore_cpu_get_phys_addr_debug, }; =20 static const TCGCPUOps tricore_tcg_ops =3D { diff --git a/target/tricore/helper.c b/target/tricore/helper.c index 7ee8c7fd699..ce1693622b7 100644 --- a/target/tricore/helper.c +++ b/target/tricore/helper.c @@ -46,7 +46,7 @@ static int get_physical_address(CPUTriCoreState *env, hwa= ddr *physical, return ret; } =20 -hwaddr tricore_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) +hwaddr tricore_cpu_get_phys_addr_debug(CPUState *cs, vaddr addr) { TriCoreCPU *cpu =3D TRICORE_CPU(cs); hwaddr phys_addr; diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index 31429ec2f87..d6d42319e57 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -304,7 +304,7 @@ static const VMStateDescription vmstate_xtensa_cpu =3D { =20 static const struct SysemuCPUOps xtensa_sysemu_ops =3D { .has_work =3D xtensa_cpu_has_work, - .get_phys_page_debug =3D xtensa_cpu_get_phys_page_debug, + .get_phys_addr_debug =3D xtensa_cpu_get_phys_addr_debug, }; #endif =20 diff --git a/target/xtensa/mmu_helper.c b/target/xtensa/mmu_helper.c index 71330fc84b9..a126f6b6714 100644 --- a/target/xtensa/mmu_helper.c +++ b/target/xtensa/mmu_helper.c @@ -316,7 +316,7 @@ static void xtensa_tlb_set_entry(CPUXtensaState *env, b= ool dtlb, } } =20 -hwaddr xtensa_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) +hwaddr xtensa_cpu_get_phys_addr_debug(CPUState *cs, vaddr addr) { XtensaCPU *cpu =3D XTENSA_CPU(cs); uint32_t paddr; --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567109; cv=none; d=zohomail.com; s=zohoarc; b=NzYwVlaZ6K/Ux8vSEra+wgnq9v6AlWhFhQX9hG51qVPGDmYzonVzBhbhFf2cK/FKqgYks/h6RbEWMPfa8EEOBA5T7S3khxVA0BrzhTpoAs9/dLNpocV37peSwyofzXHixXsZdvSpbu4tEJorZc0UDkjXS+4tZ803LGqXPgEQveg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567109; 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=4LsJakp8b2CBC0mN45Pmy8Xk77w3/GigkSKwpcUu2kc=; b=Vr205axKLpbjVVQM8yRKnhnNNV6gMcO4ep841QhhztdKAQ9URki+LsYlK+ld5mXo/Xj/UO8RQUiFB0a001uoXNlcyiU9d5kzZs3yizdwfyqQWh/11FxLoLgmMsKjGNM2yhZjK32DyZl+ffcY0JWxV/7C42FSCeQ86HoFy+0N2Ho= 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 1778567109260779.9018911440429; Mon, 11 May 2026 23:25:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgY8-00042S-85; Tue, 12 May 2026 02:25:00 -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 1wMgXM-00038g-3X for qemu-devel@nongnu.org; Tue, 12 May 2026 02:24:15 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wMgXJ-0005eX-H7 for qemu-devel@nongnu.org; Tue, 12 May 2026 02:24:11 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-488b0e1b870so86228805e9.2 for ; Mon, 11 May 2026 23:24:02 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4548ec6b00fsm33341512f8f.11.2026.05.11.23.23.58 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:23:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778567040; x=1779171840; 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; bh=4LsJakp8b2CBC0mN45Pmy8Xk77w3/GigkSKwpcUu2kc=; b=PYjhuF7Fr7J9JDXSrLHF9D5fiXWAEj0yHjKHCnhYDiCnuWRiSZoNvBWoMVUV2Do9t2 6EBeFlG3srWeBFqXkdkFr0ljpdOSND1De4r7ctDPYUFf0bViuQoz8M5cQiAo1yPWqiB8 Vuw0p7gVh1ZjNDR1MJnrZ+dauVpZBbxhPjss9MaKZSHBst6/coxbw2uN54+wk/K8TfCU Yt9CmolkiC1q5DIb+W20MLdd7Azpxqzx9PRQK2yQY8KtMIjtwuoF2zh5Sx6rckP7mPxY z/reNChknNvB+oTWBpd/3vYhvI28mq0MQBYhLaeY9zIQNOjnHopeHPxKZ4IYYLb1K7wz lajQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778567040; x=1779171840; 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; bh=4LsJakp8b2CBC0mN45Pmy8Xk77w3/GigkSKwpcUu2kc=; b=G5y+SKCCbcN4V8iUZQr7xFGAzcJs0PQUjMM5kWjh5WDF564MNvvDKEazcu6sMPk38O SzBHqlk6gI7XczZYjfOjpCG9T883AIkK9tTlTXAoEurL3YA/NlC16swCOnYxkzeDa01e sA76f/rsSJP19+g+El3GODxElgIyYMRexnuPyReXvr8zu/4qm4bKVb6dzMtuCd9wwKP8 /bH8hnCM9UiEszt62vZFXAm8hRzZZ2lEugbLlS0eNpoY95jS5RatdgEumLc4aBqkVWL+ 7XJ3bW8FqufRZSAU/pbJxQ9CHEazTjZxXAOMzQ0ebneXUKAWZn+mx0ytN15HuLL9w3v7 kQhQ== X-Gm-Message-State: AOJu0YwesZeh9EbUT9Zw8IXM6QWuMI80gV9z5bbpTC9goQwabinGWR2t ocWgGwRB5QzHlQWkNmr3TwwI2XqU+QoAf3rjl9W7zq6xWm8sezi7+aM2FnJqzGw3Abc54goX3vx H9+hoKl4= X-Gm-Gg: Acq92OFRjFN35yMSQoEw62UnSU4RDKxyQ6EIFnCmC2e1JjagCb13j04XZG3PXF6/kNg H6k+82sCsRaYuhBR+LuHqmGPLi+HfwyeAxsD6lRRih7lDjZyMqqgWovp8pvVuxlwxxXz8vE/9si 1xF80spPZMTx27WhtBUD3VDttLvrp0lx5+xIWq6Rxwh5dCTTwaItQ8u7ApEfxQ0NHPYKYWTdDjU SZW6RfTjTUf5E8fCCBDHJv7Jmhm6nPtCJ+IHGga5FBL5nafxfwIkCK4Rrc7jyM4cHmRen0yZPEj NWbvK5Dttp6rTtmnDmzO7RzMJCpxOuMpyKOkv2M/Fw8vmxLGUoY2jPciNtwUqqokmyeBotTcodU EjUEzyOZ2lBwQR6vKv1PUvLIt4F7p7+pRt05VEL8rKj5Xz1tEGCEkqiZLpRZygB3+Q8O/xctit2 Dcmq7M38cJjJsOSjlazsANxvYi+vRw2HQ31Sf22ZHq+8wlA706zNhWnutJ7d3uFse3P5QeF2nb X-Received: by 2002:a05:600c:8115:b0:48a:9540:1a3a with SMTP id 5b1f17b1804b1-48e51e196f9mr436472625e9.8.1778567039353; Mon, 11 May 2026 23:23:59 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 19/41] target: Rename cpu_get_phys_page_{,attrs_}debug Date: Tue, 12 May 2026 08:21:20 +0200 Message-ID: <20260512062142.67998-20-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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: 1778567110080154100 From: Peter Maydell Rename cpu_phys_page_debug() and cpu_phys_page_attrs_debug() to cpu_phys_addr_debug() and cpu_phys_addr_attrs_debug(). Commit created with: sed -i -e 's/cpu_get_phys_page_debug/cpu_get_phys_addr_debug/g;s/cpu_get_p= hys_page_attrs_debug/cpu_get_phys_addr_attrs_debug/g' $(git grep -l cpu_get= _phys_page) Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20260417173105.1648172-10-peter.maydell@linaro.org Message-ID: <20260430093810.2762539-11-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/core/cpu.h | 8 ++++---- hw/core/cpu-system.c | 6 +++--- hw/i386/vapic.c | 4 ++-- hw/xtensa/sim.c | 2 +- hw/xtensa/xtfpga.c | 2 +- monitor/hmp-cmds.c | 2 +- plugins/api.c | 2 +- system/physmem.c | 2 +- target/sparc/mmu_helper.c | 6 +++--- target/xtensa/xtensa-semi.c | 2 +- 10 files changed, 18 insertions(+), 18 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index c9fea797435..75e47768d43 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -739,7 +739,7 @@ enum CPUDumpFlags { void cpu_dump_state(CPUState *cpu, FILE *f, int flags); =20 /** - * cpu_get_phys_page_attrs_debug: + * cpu_get_phys_addr_attrs_debug: * @cpu: The CPU to obtain the physical page address for. * @addr: The virtual address. * @attrs: Updated on return with the memory transaction attributes to use @@ -751,11 +751,11 @@ void cpu_dump_state(CPUState *cpu, FILE *f, int flags= ); * * Returns: Corresponding physical page address or -1 if no page found. */ -hwaddr cpu_get_phys_page_attrs_debug(CPUState *cpu, vaddr addr, +hwaddr cpu_get_phys_addr_attrs_debug(CPUState *cpu, vaddr addr, MemTxAttrs *attrs); =20 /** - * cpu_get_phys_page_debug: + * cpu_get_phys_addr_debug: * @cpu: The CPU to obtain the physical page address for. * @addr: The virtual address. * @@ -764,7 +764,7 @@ hwaddr cpu_get_phys_page_attrs_debug(CPUState *cpu, vad= dr addr, * * Returns: Corresponding physical page address or -1 if no page found. */ -hwaddr cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); +hwaddr cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr); =20 /** cpu_asidx_from_attrs: * @cpu: CPU diff --git a/hw/core/cpu-system.c b/hw/core/cpu-system.c index 93dc861083c..05c126ecb6b 100644 --- a/hw/core/cpu-system.c +++ b/hw/core/cpu-system.c @@ -55,7 +55,7 @@ bool cpu_get_memory_mapping(CPUState *cpu, MemoryMappingL= ist *list, return false; } =20 -hwaddr cpu_get_phys_page_attrs_debug(CPUState *cpu, vaddr addr, +hwaddr cpu_get_phys_addr_attrs_debug(CPUState *cpu, vaddr addr, MemTxAttrs *attrs) { hwaddr paddr; @@ -73,11 +73,11 @@ hwaddr cpu_get_phys_page_attrs_debug(CPUState *cpu, vad= dr addr, return paddr; } =20 -hwaddr cpu_get_phys_page_debug(CPUState *cpu, vaddr addr) +hwaddr cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr) { MemTxAttrs attrs =3D {}; =20 - return cpu_get_phys_page_attrs_debug(cpu, addr, &attrs); + return cpu_get_phys_addr_attrs_debug(cpu, addr, &attrs); } =20 int cpu_asidx_from_attrs(CPUState *cpu, MemTxAttrs attrs) diff --git a/hw/i386/vapic.c b/hw/i386/vapic.c index 3738031a055..225f19a75c7 100644 --- a/hw/i386/vapic.c +++ b/hw/i386/vapic.c @@ -173,7 +173,7 @@ static int find_real_tpr_addr(VAPICROMState *s, CPUX86S= tate *env) * virtual address space for the APIC mapping. */ for (addr =3D 0xfffff000; addr >=3D 0x80000000; addr -=3D TARGET_PAGE_= SIZE) { - paddr =3D cpu_get_phys_page_debug(cs, addr); + paddr =3D cpu_get_phys_addr_debug(cs, addr); if (paddr !=3D APIC_DEFAULT_ADDRESS) { continue; } @@ -305,7 +305,7 @@ static int update_rom_mapping(VAPICROMState *s, CPUX86S= tate *env, target_ulong i =20 /* find out virtual address of the ROM */ rom_state_vaddr =3D s->rom_state_paddr + (ip & 0xf0000000); - paddr =3D cpu_get_phys_page_debug(cs, rom_state_vaddr); + paddr =3D cpu_get_phys_addr_debug(cs, rom_state_vaddr); if (paddr =3D=3D -1) { return -1; } diff --git a/hw/xtensa/sim.c b/hw/xtensa/sim.c index 994460d0414..32eb16442f0 100644 --- a/hw/xtensa/sim.c +++ b/hw/xtensa/sim.c @@ -41,7 +41,7 @@ static uint64_t translate_phys_addr(void *opaque, uint64_= t addr) { XtensaCPU *cpu =3D opaque; =20 - return cpu_get_phys_page_debug(CPU(cpu), addr); + return cpu_get_phys_addr_debug(CPU(cpu), addr); } =20 static void sim_reset(void *opaque) diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c index 5e509216df8..256497e162d 100644 --- a/hw/xtensa/xtfpga.c +++ b/hw/xtensa/xtfpga.c @@ -192,7 +192,7 @@ static uint64_t translate_phys_addr(void *opaque, uint6= 4_t addr) { XtensaCPU *cpu =3D opaque; =20 - return cpu_get_phys_page_debug(CPU(cpu), addr); + return cpu_get_phys_addr_debug(CPU(cpu), addr); } =20 static void xtfpga_reset(void *opaque) diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index db92d6cb86b..b37a9985c0d 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -771,7 +771,7 @@ void hmp_gva2gpa(Monitor *mon, const QDict *qdict) return; } =20 - gpa =3D cpu_get_phys_page_debug(cs, addr & TARGET_PAGE_MASK); + gpa =3D cpu_get_phys_addr_debug(cs, addr & TARGET_PAGE_MASK); if (gpa =3D=3D -1) { monitor_printf(mon, "Unmapped\n"); } else { diff --git a/plugins/api.c b/plugins/api.c index 0c348a789b2..4b6fad49998 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -619,7 +619,7 @@ bool qemu_plugin_translate_vaddr(uint64_t vaddr, uint64= _t *hwaddr) #ifdef CONFIG_SOFTMMU g_assert(current_cpu); =20 - uint64_t res =3D cpu_get_phys_page_debug(current_cpu, vaddr); + uint64_t res =3D cpu_get_phys_addr_debug(current_cpu, vaddr); =20 if (res =3D=3D (uint64_t)-1) { return false; diff --git a/system/physmem.c b/system/physmem.c index c58d940e807..652b03ad5f5 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -4041,7 +4041,7 @@ int cpu_memory_rw_debug(CPUState *cpu, vaddr addr, MemTxResult res; =20 page =3D addr & TARGET_PAGE_MASK; - phys_addr =3D cpu_get_phys_page_attrs_debug(cpu, page, &attrs); + phys_addr =3D cpu_get_phys_addr_attrs_debug(cpu, page, &attrs); asidx =3D cpu_asidx_from_attrs(cpu, attrs); /* if no physical page mapped, return an error */ if (phys_addr =3D=3D -1) diff --git a/target/sparc/mmu_helper.c b/target/sparc/mmu_helper.c index 34b212a7aa5..e1abd520c49 100644 --- a/target/sparc/mmu_helper.c +++ b/target/sparc/mmu_helper.c @@ -366,20 +366,20 @@ void dump_mmu(CPUSPARCState *env) for (n =3D 0, va =3D 0; n < 256; n++, va +=3D 16 * 1024 * 1024) { pde =3D mmu_probe(env, va, 2); if (pde) { - pa =3D cpu_get_phys_page_debug(cs, va); + pa =3D cpu_get_phys_addr_debug(cs, va); qemu_printf("VA: " TARGET_FMT_lx ", PA: " HWADDR_FMT_plx " PDE: " TARGET_FMT_lx "\n", va, pa, pde); for (m =3D 0, va1 =3D va; m < 64; m++, va1 +=3D 256 * 1024) { pde =3D mmu_probe(env, va1, 1); if (pde) { - pa =3D cpu_get_phys_page_debug(cs, va1); + pa =3D cpu_get_phys_addr_debug(cs, va1); qemu_printf(" VA: " TARGET_FMT_lx ", PA: " HWADDR_FMT_plx " PDE: " TARGET_FMT_lx "\n", va1, pa, pde); for (o =3D 0, va2 =3D va1; o < 64; o++, va2 +=3D 4 * 1= 024) { pde =3D mmu_probe(env, va2, 0); if (pde) { - pa =3D cpu_get_phys_page_debug(cs, va2); + pa =3D cpu_get_phys_addr_debug(cs, va2); qemu_printf(" VA: " TARGET_FMT_lx ", PA: " HWADDR_FMT_plx " PTE: " TARGET_FMT_lx "\n", diff --git a/target/xtensa/xtensa-semi.c b/target/xtensa/xtensa-semi.c index 28dfb29cbd3..9a6a9c8b4e4 100644 --- a/target/xtensa/xtensa-semi.c +++ b/target/xtensa/xtensa-semi.c @@ -215,7 +215,7 @@ void HELPER(simcall)(CPUXtensaState *env) uint32_t len_done =3D 0; =20 while (len > 0) { - hwaddr paddr =3D cpu_get_phys_page_debug(cs, vaddr); + hwaddr paddr =3D cpu_get_phys_addr_debug(cs, vaddr); uint32_t page_left =3D TARGET_PAGE_SIZE - (vaddr & (TARGET_PAGE_SIZE - 1)); uint32_t io_sz =3D page_left < len ? page_left : len; --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567120; cv=none; d=zohomail.com; s=zohoarc; b=g7qW806WeyqGj60CdohOcXrVrIexO+UtJXQF+Ud2M5sSwAdJgSjzd+8nuIJFXgHx9u9SKa2jOuEATi/NVNVe0h5d1O00S7TRBvXIFnFw60F7KfVb0QQEhUb3W9I0aZ4mPdowWbaFsWU7CnfKOUic43264slJZljyxT0XqNhevkc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567120; 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=UtE3JjODAUnAvXPyKWXTcePiI07h8a8f95hnZQ+UixU=; b=JYFKMC6K/BKqwctCJgMHev5qkCL7qNBu6e7q2sYEKyZ3KuIQIc7LrotgR04nYZCwnpEFi39dW6wTrp/u8pmfx/H53r/42MwrL6We8qP+ilj52kWTpyzvXdSkPLRBdwtgItAc1PYehgowXkHF3WWP/URjjwge9c/0Bpf6Sp8Ylqk= 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 1778567120407957.872640908118; Mon, 11 May 2026 23:25:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgYB-0004Uo-HD; Tue, 12 May 2026 02:25:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wMgXO-0003CU-0A for qemu-devel@nongnu.org; Tue, 12 May 2026 02:24:21 -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 1wMgXJ-0005fC-I9 for qemu-devel@nongnu.org; Tue, 12 May 2026 02:24:13 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-488ad135063so40804465e9.0 for ; Mon, 11 May 2026 23:24:08 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48e90678268sm25100645e9.10.2026.05.11.23.24.05 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:24:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778567046; x=1779171846; 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; bh=UtE3JjODAUnAvXPyKWXTcePiI07h8a8f95hnZQ+UixU=; b=nFJ+TFLC24aRIaIGcuiET55xdI29Ags/sf74l3NASlhqQkLF7RKIZQl67wbkZ+t+dn CnNvRiTFTyMXmo0UtMvDXCkvk8i8smOsPNdGXqKoH/y6dB5zUAFhMEY/oBunOkCFAmlI JMTnXq6siEKfyNbCsLgRxKZnBqs5gTvlAeQorV/bbor49Q8FF+7PBW+i4BZ5n3i/P61X 3TvCM00IZt4EPkkds9bicw1HlPCtdzmrF5ypxJbSg3NWZ69mqM2/Qw/8V5E7Lzy7ltlQ fphZz9eQB7NNwsFjWGJMLlzIOZ2vp238YuEH+sWv0Mm5S49ARa8JjVw4dgGLXI/j6eQy JSVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778567046; x=1779171846; 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; bh=UtE3JjODAUnAvXPyKWXTcePiI07h8a8f95hnZQ+UixU=; b=TRo3BRM5N+DwDiet8al/cy3DlMGPXuP5XDcpcgpp0r9LjJV/Pn0lHW1XvLyRj6ZfOR 2fIUsxGonae4m6B4IaCj6XtQ72+BIVa2dnAl3Wg3lyTbN1l3EOolB0tE9aeLjIWKjkmd 3XuSYy87OxJp18kLLKNFzwqddbO3tQwmUAbxhZx5pKo82+hfevn8GuqcEfp4iUfuiIzy EcsnGDGRVpMG+cw2L1YMBA1r4zGXzCGT1rP7SBAIXvm1tJ3VF07R2IwncB0dCpkqQYn6 XWO8nNX1nquRbFaYnbd6mIUGQMiD2B5P1b2Lkqko6bsB2AuADsJkO20YEQ5pacXVLGei aGnQ== X-Gm-Message-State: AOJu0YxGQVt75rxX6kSWJWpidyFz/XFQ5J2gfaSoi4Q0GOUiUOboMinv N2dUcsNrTRt3D8xuwuha6BHjBII5Fi7ALnXXHLix+Tz5fIDHqbLnmpQuqL+8pH/0gglXKYavqg4 rgRAoueE= X-Gm-Gg: Acq92OGUWJUbqiLAcPE47VcGlSLJOKpgbwSoGmBNlMwhF0zq6VMsNbkw+jnZKAwJf1F SpZ1cq/MVz0gzfX2jIxPVqrNtEZLYMEiZxv5fW9GGJCb+WID4n6oVXcxUu5v934bP4aJo6s0OQ7 rJLuSXPcT4i7Zk6NGVFUwwB4hJOPNJxTAy2VDNjMuS43KMQo6yn/zwE5iqnnr8qhv7Pl1BNwh0j Q13qO9KnTkFEWZlsPOR/HGsdnOOWKKm6eTKn9VJKZCisnlcG9EMZESRmRNzGvHtDCEd0mqzkxwK yPyuKV6vsPInVraYeeUWXU+rEw2wEthJLO2PRI8pwOe/kmn5xGq9To8MQ05ovytzgsv3G6hrhpV qTZ1jg+dcJq5WwKi6JNqH1xWIisVneVyfU/XzIWPCxQXjrrAwRJRRbajucStaRlguomFpchL9vi q7nuvtYXdj18Vx/9jE8iRrbv2gFDmOeaPyU0kNmosC3OFnCuBe4LYKQBA2XCL9sjyj3z07pPbOA 0F7o7RNeks= X-Received: by 2002:a05:600c:6290:b0:485:3f30:6250 with SMTP id 5b1f17b1804b1-48e51f3fd58mr472812605e9.20.1778567046105; Mon, 11 May 2026 23:24:06 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 20/41] hw/core: Update docs for get_phys_addr_{attrs_, }debug Date: Tue, 12 May 2026 08:21:21 +0200 Message-ID: <20260512062142.67998-21-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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=philmd@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: 1778567121679158500 From: Peter Maydell Update the documentation for the get_phys_addr_{attrs_,}debug methods and wrapper functions to state that they can handle non-page aligned addresses and will return the corresponding exact physaddr for them. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20260417173105.1648172-11-peter.maydell@linaro.org Message-ID: <20260430093810.2762539-12-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/core/cpu.h | 16 +++++++++++----- include/hw/core/sysemu-cpu-ops.h | 4 ++++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 75e47768d43..e3436a1766f 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -740,15 +740,18 @@ void cpu_dump_state(CPUState *cpu, FILE *f, int flags= ); =20 /** * cpu_get_phys_addr_attrs_debug: - * @cpu: The CPU to obtain the physical page address for. + * @cpu: The CPU to use for the virtual-to-physical translation * @addr: The virtual address. * @attrs: Updated on return with the memory transaction attributes to use * for this access. * - * Obtains the physical page corresponding to a virtual one, together + * Obtains the physical address corresponding to a virtual one, together * with the corresponding memory transaction attributes to use for the acc= ess. * Use it only for debugging because no protection checks are done. * + * The address need not be page-aligned; the returned address will + * be the physical address corresponding to that virtual address. + * * Returns: Corresponding physical page address or -1 if no page found. */ hwaddr cpu_get_phys_addr_attrs_debug(CPUState *cpu, vaddr addr, @@ -756,13 +759,16 @@ hwaddr cpu_get_phys_addr_attrs_debug(CPUState *cpu, v= addr addr, =20 /** * cpu_get_phys_addr_debug: - * @cpu: The CPU to obtain the physical page address for. + * @cpu: The CPU to use for the virtual-to-physical translation * @addr: The virtual address. * - * Obtains the physical page corresponding to a virtual one. + * Obtains the physical address corresponding to a virtual one. * Use it only for debugging because no protection checks are done. * - * Returns: Corresponding physical page address or -1 if no page found. + * The address need not be page-aligned; the returned address will + * be the physical address corresponding to that virtual address. + * + * Returns: Corresponding physical address, or -1 if no page found. */ hwaddr cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr); =20 diff --git a/include/hw/core/sysemu-cpu-ops.h b/include/hw/core/sysemu-cpu-= ops.h index 1524d6f25bb..c0e9e726708 100644 --- a/include/hw/core/sysemu-cpu-ops.h +++ b/include/hw/core/sysemu-cpu-ops.h @@ -31,6 +31,8 @@ typedef struct SysemuCPUOps { bool (*get_paging_enabled)(const CPUState *cpu); /** * @get_phys_addr_debug: Callback for obtaining a physical address. + * This must be able to handle a non-page-aligned address, and will + * return the physical address corresponding to that address. */ hwaddr (*get_phys_addr_debug)(CPUState *cpu, vaddr addr); /** @@ -39,6 +41,8 @@ typedef struct SysemuCPUOps { * access. * CPUs which use memory transaction attributes should implement this * instead of get_phys_addr_debug. + * This must be able to handle a non-page-aligned address, and will + * return the physical address corresponding to that address. */ hwaddr (*get_phys_addr_attrs_debug)(CPUState *cpu, vaddr addr, MemTxAttrs *attrs); --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567106; cv=none; d=zohomail.com; s=zohoarc; b=UpXvrJr7oIves57ZiRS2YNwPFNdMEmsP0YbD/7spbqhcUdh8XroQEqG/AWQjU8irehFtsKJIel79gImUNpS5jpJYzbr35RCZVB+qY4b5kayLvjC8E/VgT9Qs/qsweJAQzjn79gCjY5WPo2Gj+R3/FhvZgYcscBTZ+8vilOTeYmI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567106; 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=+RyBTcXhGSgLGCVPmzWdJm9D7f8yrjL4XCYOfxRcoaQ=; b=XqbDLZ5x8V/ivGpB5fuPDOCiIoLEoG+n80uIj3iyC7ltl2nKrJ8RdTsArQ2A2eWfrkpf9li+t9crBKM2UBoF3qZTKGu3V3qavoHE5Qg3Lg7hjc2hqARdbdNCzvsrWR8D40O6VMl61Y5hcq7P0fB88iZ762QwvKaheuBXZYBka6c= 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 1778567106623107.26048666933605; Mon, 11 May 2026 23:25:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgYA-0004LJ-9C; Tue, 12 May 2026 02:25: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 1wMgXX-0003Fh-Co for qemu-devel@nongnu.org; Tue, 12 May 2026 02:24:28 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wMgXR-0005sw-CS for qemu-devel@nongnu.org; Tue, 12 May 2026 02:24:19 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-488ab2db91aso55777355e9.3 for ; Mon, 11 May 2026 23:24:16 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48e8e62a2desm12246395e9.9.2026.05.11.23.24.11 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:24:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778567053; x=1779171853; 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; bh=+RyBTcXhGSgLGCVPmzWdJm9D7f8yrjL4XCYOfxRcoaQ=; b=opnQIFHKwKgO5wmc+jIVj7H25Mn3jS7MOi2maALY+JLbyv5+/05UKTsc0yIDJpBDIA 1ATWDbVlxvwWJ1miVlZIUrKqIzjfMlc61+og5uov++F5mMl6Hgmu4DZp22sPXGcEnYd8 XiXGONId9Pd+IuWeTC7Ncj8M9ODPwJph6sW86u1I3lRyQEnmaVwr78aAlf+7LHA/asik epqOieZuozsumEm6uuWnPL95fvZ+S2/paDPGCyBlMU56TYDjIydqSPMAEjPchxL+RuJa MDiVavaTzJHzSWOnAG62suPx9Hde2hHsDeZFuFwIU8iwXVn+0lQWTISUED9qVtjRpN8x DJ6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778567053; x=1779171853; 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; bh=+RyBTcXhGSgLGCVPmzWdJm9D7f8yrjL4XCYOfxRcoaQ=; b=ifX3zEoM8n8wDQdF0+LJJeh0PtWU1FNpG4hhegbNmXLCLwpeIQkviwMvkroKqqTGTO BCwvXEQCgbPngu3D7oq3URRfxhXvArlXBuWeSX3o2GZowsvZ9XiitSx+gyyCLfbQPyKC zmDP5yiaRchV9Fakz1Pa5KIfRWCeZ40RoJco9kGdEr0ySOxzDZk4iOoJSr1Shni3nVvl AcQIz4ilogrJQ9sEz1jwxcQiiC2TN9IyWwp+z32NTJ9wr+d12cvFZQ9ZIPAC15hXJi8O 3hTR6BTl6NVf8hlPPbXMK+RyFbjzY0z/1MOgHjNPeEiFC/NLQbN7YNM/cEhrSzeGXoO9 laOQ== X-Gm-Message-State: AOJu0Yx8cxcY98ThG/GIVxS5qWp4U4mPsNYuMhLCFHiCzs17NAAj3eG9 uRq/PhjhIc3KOLuXwoXL729kvztyi9FhT2nAMsH3rJq8HTPyct94lf/01tu4kqy+TWf4jiCl5ul DFPq5Yn8= X-Gm-Gg: Acq92OGbmbO4W6+s53llpBtJbxLSnQKdrBrGbbdcX3wG7z1moL9SI3oGNYSqFhff2CB dMpXKz70iP39+JNKXMrlJpR7jQG6jTU7hIWtlCnPjqXGn/5O5MGusR563SgTqA/eHvbLtZqHd+F iyqlURNrbMbQfqlugsRuM5OTrhrJUhrciUemcBgXiVew3ZiJOGp4qDMyz3M3PaO/DItwk/il2pD yZPAx4b42S+bypPlGynGpgsP/dAKCeoT/Y2qEwmA5XWHnTfyeRggsnasvspRfOorATC7egXZg54 vB3gCi5S89qUPd6XdrEhblq2iPyelpPV9xN2o+2v4M22xn/KyO1ZwXlfcmj4lE8bEoPZLK6jWJS Gp5T6W5KEW251t/rPrF3qGYiYaS4hBbjDu/ziZRKIlNv4VPnWEU4mhdUs+DWzHk9dvsCa36j4Hi 60qzBX+SmP4Aa2QQmpSfRA35yHAmE6UXylq/VTTgbfLUnHXQtKbM9wVLsiC4udzK+DVxMnbdGV X-Received: by 2002:a05:600c:3151:b0:48a:7605:751e with SMTP id 5b1f17b1804b1-48e51e0837amr411315585e9.4.1778567053218; Mon, 11 May 2026 23:24:13 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 21/41] target/arm: Rename arm_cpu_get_phys_page() Date: Tue, 12 May 2026 08:21:22 +0200 Message-ID: <20260512062142.67998-22-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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: 1778567107493158500 From: Peter Maydell The internal helper function arm_cpu_get_phys_page() is named that way because of its use in the get_phys_page_attrs_debug method. Now we've renamed the method, rename the helper to match, since it can handle non-page-aligned addresses. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20260417173105.1648172-12-peter.maydell@linaro.org Message-ID: <20260430093810.2762539-13-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/arm/ptw.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 7dd3a7a3ede..24656b1a062 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -3942,7 +3942,7 @@ bool get_phys_addr(CPUARMState *env, vaddr address, memop, result, fi); } =20 -static hwaddr arm_cpu_get_phys_page(CPUARMState *env, vaddr addr, +static hwaddr arm_cpu_get_phys_addr(CPUARMState *env, vaddr addr, MemTxAttrs *attrs, ARMMMUIdx mmu_idx) { S1Translate ptw =3D { @@ -3970,7 +3970,7 @@ hwaddr arm_cpu_get_phys_addr_attrs_debug(CPUState *cs= , vaddr addr, CPUARMState *env =3D &cpu->env; ARMMMUIdx mmu_idx =3D arm_mmu_idx(env); =20 - hwaddr res =3D arm_cpu_get_phys_page(env, addr, attrs, mmu_idx); + hwaddr res =3D arm_cpu_get_phys_addr(env, addr, attrs, mmu_idx); =20 if (res !=3D -1) { return res; @@ -3984,10 +3984,10 @@ hwaddr arm_cpu_get_phys_addr_attrs_debug(CPUState *= cs, vaddr addr, switch (mmu_idx) { case ARMMMUIdx_E10_1: case ARMMMUIdx_E10_1_PAN: - return arm_cpu_get_phys_page(env, addr, attrs, ARMMMUIdx_E10_0); + return arm_cpu_get_phys_addr(env, addr, attrs, ARMMMUIdx_E10_0); case ARMMMUIdx_E20_2: case ARMMMUIdx_E20_2_PAN: - return arm_cpu_get_phys_page(env, addr, attrs, ARMMMUIdx_E20_0); + return arm_cpu_get_phys_addr(env, addr, attrs, ARMMMUIdx_E20_0); default: return -1; } --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567133; cv=none; d=zohomail.com; s=zohoarc; b=TIENG2ajpKqdU7ohQwxXQWGVzSOyElTVNlnP1Ln2scWZ0cVxZhboRGm5GX5Heyl1MDdJa7rKfGkgJnUexMz6qDSi1xqyhFdfikPOKkYc12UwknH0/n+ueATdJPkjzvyQofxpaj6md/48Tpy/PpwVQ+bhYSHKu1G551lu/GPPdp4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567133; 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=+4XX5xrjDxdhZM2QFnSK/7i4L62H/BPpSU9tE4S16mw=; b=B8qwNtRC9iC1ePswgBpl3AlnQw2gPm0hpYtE755NRIIxTymwpaaWQu9g2JPyTYodgH9Wp03cZo+nJhHqElNKWxLlfVZx2ZufKzMDZ1OFzecsDMPZelb9hmhifcSFiKSz0lfxo74pt9Tsk8sKi7PrXd4dttvhyF+tssQOlOC4E8c= 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 1778567133311947.5040188853607; Mon, 11 May 2026 23:25:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgYE-0004pF-G6; Tue, 12 May 2026 02:25: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 1wMgXc-0003Ic-Kp for qemu-devel@nongnu.org; Tue, 12 May 2026 02:24:39 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wMgXX-000630-6O for qemu-devel@nongnu.org; Tue, 12 May 2026 02:24:24 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-44c4cc7c1cfso4099176f8f.0 for ; Mon, 11 May 2026 23:24:22 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48e906b04a9sm38325015e9.7.2026.05.11.23.24.19 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:24:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778567060; x=1779171860; 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; bh=+4XX5xrjDxdhZM2QFnSK/7i4L62H/BPpSU9tE4S16mw=; b=MpBBduIFRgdpSJRAZz1Lf5Z8NPfUlkVnOj03//+4HOrFaR0uF1xQms2FMj0ydb1ubO a4jdWtp9XPjNPKuwEX4BK1rWkkPylNPR+rUFfl069xCUd8Oyupva5NEYf6brZ6vgWfmh QEQPKKDMCZlPfx62go+tOQiAWiaJvf5K5pgQG3sh1SZwEKvDaSwVSXsr4GErzMg4cEx7 uN7YUVMcvHovWy7XstWQwKb3q8Wn+/zullZmIXmkHH9AZDVznKtfMBRViAfkXhE+e4yn 9nYQj/DWTGazma0oAqvjRL+isORGvW2WOyK3H3NcxFCRKmGsDq4uEGjIT71tE9WymSux NwZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778567060; x=1779171860; 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; bh=+4XX5xrjDxdhZM2QFnSK/7i4L62H/BPpSU9tE4S16mw=; b=HjZIzgRkjD5EqbxHCfvO6DE7qs3zb3RZu7QAbo+C8Hmhx/UtZwwt61UEBn6agKlW0m rxbr0ZF1i8/rEEjB6NWIFBPiBtkRWXNfj/urFXh/+Jy1BjI0jec37GfR1e7M5xQ8k4hP 8SaT8Y0IMEVhNPr7oJr+R6Grmdo5lqRSOeYeWkx7ChRObkUo/M57F7KvuDULvQsB4aKY YEiD/z8oi4IYBnoMB5j6diL5dGYoV0/rjzI1n5AF8ReikNnQPBO4V+VHBuaAIi+xQ3bG Qvkz4NFeprDQgmyeaGzKhFNcxWpw4pXNZRlMnFJmvrboTVW2QYR/y9qW1zoMPN2YPoJ+ rvfA== X-Gm-Message-State: AOJu0YwSUDMXSwYsMGCvmBcHNyVdTtyMOz8o5+Tq/tCk4r44NR9bBkHe QxqkJ4n9Y0izt90suLhRaNdBX7bOhpgEWAWze2gO05Vlu8PhXKvULMctzZ5BeTNv0H819vzfFtW doAE5nKA= X-Gm-Gg: Acq92OGnlDn4Dss2r8qyjebxJ86HG37ojkLyQuxEt/VHyOagSU2tfku5ScIpyi4/2Zi rVGbalTDzoudL570eVJFgy3eRNHBJD1oVb8n1eL0SiAfHo6RIaPndidv9myTiDadLc/l12FqJpP CwkVQDrDBGnPcb5wvs9LoIh68+OE1innnB5s1bSAZ38kslga9MXbFRIf0uXX/rpdfjznI3R4zCC 63S2j0zpj1UbwymSXMUOKnwXJyX1g00ph1c9M4NtZ4G1d61jlKHUErFEmD1ipN/8ATzADUa78fa 2svfyLmPelGONXGeqw/r1U44HZUb3HHsoIXGEJMefv7T+N5XClgKpdFiFPFFXd0WLYvhj/7TGMi 87jvhrLgv8lD3pMWR5uDwd3e8hCROAYcQLcj3LCOKInVc4yCRb6B3o7kHlTQ6PLuwsCsB1N0x5Z 1LysUAdubN3cW3ogXfzVZZDz0t3Yc3tu15B7hiboc54N8nksg90pxzx+7O78HdXnmM5Uql5Zec X-Received: by 2002:a05:600c:3f18:b0:487:2671:fb8f with SMTP id 5b1f17b1804b1-48e51e19668mr422253335e9.8.1778567060330; Mon, 11 May 2026 23:24:20 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 22/41] monitor: hmp_gva2gpa: Don't page-align cpu_get_phys_addr_debug() arg and return Date: Tue, 12 May 2026 08:21:23 +0200 Message-ID: <20260512062142.67998-23-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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::435; envelope-from=philmd@linaro.org; helo=mail-wr1-x435.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: 1778567134275154100 From: Peter Maydell In hmp_gva2gpa() we currently have a workaround for not all implementations of get_phys_addr_debug handling non-page-aligned addresses: we round the input address from the user down to the target page boundary before the call and then add the page offset back to the returned value. Now that we guarantee that all implementations will return the correct exact physaddr for a virtual address, we can drop this handling. Signed-off-by: Peter Maydell Acked-by: Dr. David Alan Gilbert Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20260417173105.1648172-13-peter.maydell@linaro.org Message-ID: <20260430093810.2762539-14-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- monitor/hmp-cmds.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index b37a9985c0d..88f9788bd9c 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -771,12 +771,11 @@ void hmp_gva2gpa(Monitor *mon, const QDict *qdict) return; } =20 - gpa =3D cpu_get_phys_addr_debug(cs, addr & TARGET_PAGE_MASK); + gpa =3D cpu_get_phys_addr_debug(cs, addr); if (gpa =3D=3D -1) { monitor_printf(mon, "Unmapped\n"); } else { - monitor_printf(mon, "gpa: 0x%" HWADDR_PRIx "\n", - gpa + (addr & ~TARGET_PAGE_MASK)); + monitor_printf(mon, "gpa: 0x%" HWADDR_PRIx "\n", gpa); } } =20 --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567105; cv=none; d=zohomail.com; s=zohoarc; b=Nd19fWsFTPtjePYdmQFQIkGS6/m4HBOJU1pFjXa8qq7tJFSjaN6fQtaH9WIgfJL6C1jyta0ZJhlUmmY2mHfugyOSWo6ZS+FoeqLt0BNmTDufiqyF/RHmTv6dB+b8YaeNuTRLCQRsYzgceWf1ZSjWLuiyRMrcVuDyg8gWI8fP8aE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567105; 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=csiRPnZWzJrCYGF97CObJC6aEY5aL83bFmlakWQo47E=; b=Nk2WXwR1OnHmt86e6cp/XbN7CzZBcSgioW6aW7vUTa+ZjNLAR52sFVRCfuxgKyjzvFyDMTywm+tEdMntxE5azjBBZU2aHxb/2aA41kxMPoBBzpRTf50Jumc43qyzZwIGk05X0rTcaquR+YyHb3oJ+XeQyXU7FmkR3Ak+i3chNQU= 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 1778567105429412.44079206829224; Mon, 11 May 2026 23:25:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgY8-00047O-IV; Tue, 12 May 2026 02:25:00 -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 1wMgXi-0003Ka-GD for qemu-devel@nongnu.org; Tue, 12 May 2026 02:24:41 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wMgXe-0006Nj-Av for qemu-devel@nongnu.org; Tue, 12 May 2026 02:24:34 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-449de065cb3so4625120f8f.2 for ; Mon, 11 May 2026 23:24:29 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-458b3664e3esm14754794f8f.3.2026.05.11.23.24.26 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:24:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778567067; x=1779171867; 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; bh=csiRPnZWzJrCYGF97CObJC6aEY5aL83bFmlakWQo47E=; b=uyDXzyya5Y5Zf61idYClN8Zo5aXjHo04kLt6g/fg+9R8RRkvZd7xjLWBqhWmbT2Fkn jwm9oGaqrxSu8BJ4G/eXDySl146TbZiNQAHe9mQ1dgE+vKacO4GUt7t9FuSXFyHTMTCL fK084aSf9GEpTgnlLQh5PPjgAtkQeCcIEQ5hliSgBjhM/POnOyl5dTqJF+1j1YmTu6JV 2vuEKIqlMVa1yRdHBHIZ4m5haWHSZlo3qztDzquS3gGmeB3MHzMSIJ7o/E1hHAWS+7xe sZrgAg61giRIlG3sIpCxsvnDsrn7dBAbS11WAC8N5bzaCQ8V0IdHOTr9+/RD/HHDie52 uYZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778567067; x=1779171867; 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; bh=csiRPnZWzJrCYGF97CObJC6aEY5aL83bFmlakWQo47E=; b=ccbnk9XB6s1z3UGdBd4ynIf5/Njk6IXJhMC8a1XIxozbvTvBzv2nB6qjZLpM634fwx WsQXW5ZaeSaXuqKyl40t5eAnbHK2TirN1KlprVG3vKg7ZG/nrrhWL3XBta4n9tVywpAg twgJz1q9c0VbIT9IyIvXS5Rm992IeXfOw+dDZR0ZdvmEkNlrXIqbQa/NYOcvuahZXLzo +g0cOYgPtV+Hjx/JIhSB3WKKqDA7w/zZeHB8ezW+3y3q465CVbalBWXTMLGqk06xSpOZ ijvZlOkWklM0Qoa3SL1pSGQPFxv6Ls+VleTOQjKKVm5rnvymT3HvS0UmEo6xebMu06hp LdCg== X-Gm-Message-State: AOJu0Yx0YBMAAIw64vgRMq5n+cuCh2ST3sMb9p15W5BIpg38Xg2xg8Lg AQEqGwGOU/cToqT+Hs1LO561YBXmkpd0CRusX6pApX2t4sz3CgDfgvOTQcf1uGVjczbbD+QBGcW M/7mTP00= X-Gm-Gg: Acq92OHOkoQTn1q4tGPanVmwnSx0CfR0PaZaR7hHSpFJr/RCpIrPSu3PEGSb2qx3Oil IeI5GGRZ6URV5IfoNqoXT7cALcaexPOwHgX/08q4EGRleLaJZr4SqAoPZpFoZniQuSeEEUSkA4k zzSlGlbFqjy4sPRomVHr2oI2E5CGGMhIXsj6teJv/VSlTWcg0XFwheWeYq1rzRTUwc2F5jPnOvc +urkmtPTUb7rG+NKN68rfMahIB5NUBKZd8+lq3/ofSPfgT5KJ1jY5qdAOmkeVeQy1ZDqFcSYstb oQRQRPg2vm/uphyCPYrbbkRSAwAnzf4XSdR20p5WhMBNNhVbMUGKIAiJdU9Cj2SimUl5xxYo4Ev 2Pc6aoI6afqImOEb2Fssk9VlQMteEIT0KE3UikinSWFa/deQl56hppi4vUC2xYPNL9VNL6dmkiI MxeYSHCyg46PrvLYI31CaIZ5Dk8+mROH/QXA6Cuh+soW9dUSrOeldXwfDpn6q4u0JqmvUjAibrb jLzNdP5Z6A= X-Received: by 2002:a5d:5a0b:0:b0:455:70bc:216d with SMTP id ffacd0b85a97d-45570bc2220mr17861530f8f.12.1778567067200; Mon, 11 May 2026 23:24:27 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 23/41] plugins/api.c: Trust cpu_get_phys_addr_debug() return address Date: Tue, 12 May 2026 08:21:24 +0200 Message-ID: <20260512062142.67998-24-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.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: 1778567107483158500 From: Peter Maydell In qemu_plugin_translate_vaddr() we have a workaround for not all implementations of get_phys_addr_debug returning an exact physaddr for the input virtual address: we OR back in the page offset to the return value. Now that we guarantee that get_phys_addr_debug returns the exact physaddr for the input virtual address, we can drop this workaround. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20260417173105.1648172-14-peter.maydell@linaro.org Message-ID: <20260430093810.2762539-15-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- plugins/api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/api.c b/plugins/api.c index 4b6fad49998..c97cc688825 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -625,7 +625,7 @@ bool qemu_plugin_translate_vaddr(uint64_t vaddr, uint64= _t *hwaddr) return false; } =20 - *hwaddr =3D res | (vaddr & ~TARGET_PAGE_MASK); + *hwaddr =3D res; =20 return true; #else --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567131; cv=none; d=zohomail.com; s=zohoarc; b=UyE+q1b9RFX5vBiilggl0V5PEhyo4SpLFK1dyq+kdP+K/g6ru1K+d+xKVheuvwEBjSsKU1cWYh8vU8O3pQvmRb45QdmTIk4arXTkJDFrVia96fGUnZO+u7HuVtNvk/Eg+avOTESrJPOIRS50aRDb52YzhhynJiJ7uzYsef1sOgY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567131; 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=gpqMw9xzJUg2xwtQ6X1M1U6pkAxJFkLGShNka8IQ03c=; b=GenVGhBbbJiY0bSLM4rYJ9kBJqXQETjFvzDP3PJ247fAis5XxwdAB7RhES9sd9hZjSetmSVkv+hBoNpDbD1789/xgwdhkEL4ZVoUpqpW+jNaUjaR46JtUUvKWjyHVDG6DuutzHJ7dl3YclvI6NsaZ7XNG1ZxTaFRYJdLUJhPOpM= 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 1778567131949897.6330931939414; Mon, 11 May 2026 23:25:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgYH-0005FR-Ol; Tue, 12 May 2026 02:25:09 -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 1wMgXo-0003O5-5t for qemu-devel@nongnu.org; Tue, 12 May 2026 02:24:46 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wMgXl-0006Vh-6f for qemu-devel@nongnu.org; Tue, 12 May 2026 02:24:39 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-44dd5cb0f81so3936263f8f.0 for ; Mon, 11 May 2026 23:24:36 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-45491da03a7sm30775352f8f.33.2026.05.11.23.24.33 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:24:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778567075; x=1779171875; 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; bh=gpqMw9xzJUg2xwtQ6X1M1U6pkAxJFkLGShNka8IQ03c=; b=mYytlnCSVNM8GyKkA+ZbxBb6x08Ath3AkI71J0TDh0IK4JpUp6bzTcir3veXgf4mA/ MVVhxwbOxQlHJq008HR1jnMrhJQ6hwh7Jw/CaA1C6NzH9G5TjoCQFJdgoVANm27endcD 0PrsUuRDOBVxg7lLksWj0ovqjew8gQpKf/4zRd0VLi5Gnoleix5jdy3hIsvyXlxuOaPl QhziWa9HkXEGriGrq7LSF2Pl8PgWIEC42f/Kde53VjONWC9XnmMytGYImX3XWTiBGAko 1LK8NmkjwxoqxRhLS/tgcJaVbtHXIBJfBhg7oUW2L3cLc2m5orz/XLntPOKRu9v2/BO8 j3Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778567075; x=1779171875; 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; bh=gpqMw9xzJUg2xwtQ6X1M1U6pkAxJFkLGShNka8IQ03c=; b=sfy+eQJ+y9uEyI+jptEo7MoUtsHJycaWltjy85o8/fEpWDLeP9kAn0UsnKCs02EbDw 4+YRLl3DKa/vPr3gBn7VoXrCGMBMdH0DNEbc6nSWcCmdDzOkGDwicVx5sRaqNRgja2yf s7Hv9BRAmj9LPWGxf2T7Tsi3AsFSkT2kfClx4M2EyNZq6c7LzzupHCsg36rFcmW1vGfz 01ypjeWVkR17OJ5mwP0WBOfykABROG7Aclj4xCOxt9DtRnKIcfiUwng7a2H5rxQtUfTq F9e9K1BqER+ELMew9dPs8gNT9/qhRtKyf3uuVBPuyLm2hS7OKypChYlpWKY1PMV2Q47m H/7Q== X-Gm-Message-State: AOJu0YwSXeF4DP+SYcB1/W8Wtu/zTbyWYF+/hWm2eqREiLMNDs/QjKA1 0pF8Q8Kjtnj9khsHA8lY7Rz8efPCO1J+asP9M5sVJo4qkCWIx2rczd/n606q2f9+4YGA1W0jZFe oRjRVOUc= X-Gm-Gg: Acq92OH97elCw6jb8CaLoA1+RqUj20Xa+JS7f3D+B3RnbP1tsaXhSuLzVW5jzh+G/hz 9dLncED0N0RW9nHLxzPoTBj7mgjp6+CD+14uFE4t+p33Ori3eooXEcFny+ATJJjo/cy37xArNeL c5vebmXKtChBITp8hxN7wTF3s4VyW58f2XRnNheepQ35zX/qv5KnYyrSQw1T7JqDPROz9dSK4L9 h99a3CULa/6Vrls96E8jzqKykifPk/JDAFX7agxE4tRRToKaQ9h8J7QfqnuwQwj3DNkbH9CMzyB sdOpgpLAxGDvWe+zm2CuKz/Nc3jq9pGw920oizw7KMC946L8zVHlMLPPm9N0JqAaICZSVtU+0Fr sZcNEbONd8jTds0Vj6I3Vzacfiz62MQRN1irTqEVlNrLy3X0vm/igka+3N8sXQsSwNL/wUtU38I rqaiq37FoR3xbbxIeJH4Q9tA0sAwGj8qpNTD9X/+YSvLiWgAApYv3j08tdvmfQS7lZWIw6Hzx/ X-Received: by 2002:a05:6000:18a4:b0:43e:531f:720c with SMTP id ffacd0b85a97d-45ac2a0cb0amr3462099f8f.11.1778567074374; Mon, 11 May 2026 23:24:34 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 24/41] hw/core: Implement new cpu_translate_for_debug() Date: Tue, 12 May 2026 08:21:25 +0200 Message-ID: <20260512062142.67998-25-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.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: 1778567134403154100 From: Peter Maydell In cpu_memory_rw_debug() we need to do a virtual-to-physical address translation for debug access. Currently we assume that the translation is valid for an entire guest page, but this may not be true if the target implements some protection regions that have sub-page granularity. (Currently the only such target is the Arm CPUs when using an MPU, as in R-profile and M-profile.) For TCG's emulated accesses, we handle sub-page granularity by the CPU filling in the lg_page_size field of the CPUTLBEntryFull struct to tell us how large the region covered by the result is. But we didn't extend this to the debug-access code path, with the result that debug accesses might incorrectly fail because they are looking at the mapping for the address rounded down to a page boundary. Provide a cpu_translate_for_debug() function which reports to the caller not just the physical address and attributes of the translation but also the lg_page_size for which it is valid. The fallback implementation calls cpu_get_phys_addr_attrs_debug() and assumes target-page-sized validity. NB: the "return true on valid access, false on failure" follows the same convention as TCGCPUOps::tlb_fill_align() (though it is the opposite of what we use in some other places, e.g. in target/arm's get_phys_addr_* functions). Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20260417173105.1648172-15-peter.maydell@linaro.org Reviewed-by: Richard Henderson Message-ID: <20260430093810.2762539-16-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/core/cpu.h | 32 ++++++++++++++++++++++++++++++++ include/hw/core/sysemu-cpu-ops.h | 27 +++++++++++++++++++++++++-- hw/core/cpu-system.c | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 89 insertions(+), 2 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index e3436a1766f..a7256aeb9dc 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -772,6 +772,38 @@ hwaddr cpu_get_phys_addr_attrs_debug(CPUState *cpu, va= ddr addr, */ hwaddr cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr); =20 +/** + * TranslateForDebugResult: gives result of cpu_translate_for_debug() + * + * @physaddr: the physical address corresponding to the virtual address + * @attrs: the transaction attributes for this access + * @lg_page_size: log2 of the size of the aligned block of memory + * that this physaddr and attrs are valid for. + */ +typedef struct TranslateForDebugResult { + hwaddr physaddr; + MemTxAttrs attrs; + uint8_t lg_page_size; +} TranslateForDebugResult; + +/** + * cpu_translate_for_debug: + * @cpu: The CPU use for the virtual-to-physical translation + * @addr: The virtual address + * @result: Struct filled in with results of translation + * + * Perform a virtual-to-physical address translation for debug accesses. + * Use it only for debugging because no protection checks are done. + * + * The address need not be page-aligned; the returned address in @result + * will be the physical address corresponding to that virtual address. + * + * Returns: false on translation failure; true on successful translation + * and fills in the fields of @result. + */ +bool cpu_translate_for_debug(CPUState *cpu, vaddr addr, + TranslateForDebugResult *result); + /** cpu_asidx_from_attrs: * @cpu: CPU * @attrs: memory transaction attributes diff --git a/include/hw/core/sysemu-cpu-ops.h b/include/hw/core/sysemu-cpu-= ops.h index c0e9e726708..441901fae8e 100644 --- a/include/hw/core/sysemu-cpu-ops.h +++ b/include/hw/core/sysemu-cpu-ops.h @@ -33,19 +33,42 @@ typedef struct SysemuCPUOps { * @get_phys_addr_debug: Callback for obtaining a physical address. * This must be able to handle a non-page-aligned address, and will * return the physical address corresponding to that address. + * + * CPUs should prefer to implement translate_for_debug instead of + * this (and must do so if their translations are not always valid + * for a complete target page or they use memory attributes). */ hwaddr (*get_phys_addr_debug)(CPUState *cpu, vaddr addr); /** * @get_phys_addr_attrs_debug: Callback for obtaining a physical addre= ss * and the associated memory transaction attributes to use for t= he * access. - * CPUs which use memory transaction attributes should implement this - * instead of get_phys_addr_debug. + * * This must be able to handle a non-page-aligned address, and will * return the physical address corresponding to that address. + * + * CPUs should prefer to implement translate_for_debug instead of + * this (and must do so if their translations are not always valid + * for a complete target page). */ hwaddr (*get_phys_addr_attrs_debug)(CPUState *cpu, vaddr addr, MemTxAttrs *attrs); + /** + * @translate_for_debug: Callback for translating a virtual address in= to + * a physical address for debug purposes. + * The implementation should fill in @result with the physical address, + * transaction attributes, and log2 of the size of the aligned block of + * memory that the translation is valid for. + * This must be able to handle a non-page-aligned address, and will + * return the physical address corresponding to that address. + * The attributes must include the debug flag being set. + * Returns false on translation failure; on success returns true and + * fills in @result. + * + * This is the preferred method to implement for new CPUs. + */ + bool (*translate_for_debug)(CPUState *cpu, vaddr addr, + TranslateForDebugResult *result); /** * @asidx_from_attrs: Callback to return the CPU AddressSpace to use f= or * a memory access with the specified memory transaction attribu= tes. diff --git a/hw/core/cpu-system.c b/hw/core/cpu-system.c index 05c126ecb6b..252e90c8fdf 100644 --- a/hw/core/cpu-system.c +++ b/hw/core/cpu-system.c @@ -22,6 +22,7 @@ #include "qapi/error.h" #include "system/address-spaces.h" #include "exec/cputlb.h" +#include "exec/target_page.h" #include "system/memory.h" #include "qemu/target-info.h" #include "hw/core/qdev.h" @@ -55,6 +56,37 @@ bool cpu_get_memory_mapping(CPUState *cpu, MemoryMapping= List *list, return false; } =20 +bool cpu_translate_for_debug(CPUState *cpu, vaddr addr, + TranslateForDebugResult *result) +{ + if (cpu->cc->sysemu_ops->translate_for_debug) { + return cpu->cc->sysemu_ops->translate_for_debug(cpu, addr, result); + } else { + /* Fallbacks for CPUs which don't implement translate_for_debug */ + if (cpu->cc->sysemu_ops->get_phys_addr_attrs_debug) { + result->physaddr =3D + cpu->cc->sysemu_ops->get_phys_addr_attrs_debug(cpu, addr, + &result->at= trs); + } else { + result->physaddr + =3D cpu->cc->sysemu_ops->get_phys_addr_debug(cpu, addr); + result->attrs =3D MEMTXATTRS_UNSPECIFIED; + } + if (result->physaddr =3D=3D -1) { + return false; + } + /* Indicate that this is a debug access. */ + result->attrs.debug =3D 1; + /* + * Assume memory access permissions are valid for the whole page. + * Targets where this isn't true should implement the + * translate_for_debug method. + */ + result->lg_page_size =3D TARGET_PAGE_BITS; + return true; + } +} + hwaddr cpu_get_phys_addr_attrs_debug(CPUState *cpu, vaddr addr, MemTxAttrs *attrs) { --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567137; cv=none; d=zohomail.com; s=zohoarc; b=UpFKrmeTlY6ULxNN5XP52S4b2stX0BSsrITJlJepXej72pDBe8OfLwWigtamOcBAWO7fj7nk9seZMOb9aIiM+hKU7zyVh9y2zBXKkUxa2BaZ6/Z9f6ZiZ50c1AjSAuGc53rjffWjN7M85v+TXT7g3JGD8faTXt+CAXM0aXqnYVg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567137; 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=xmisohfUh01EbvNNSz+FoRzd51EcDKXzYYGKUUEU+RE=; b=IEnnEeJkaDvsVSfORCZ6EygY+ANIo26YIe63lNNiikNNbT80xuvFsqSug42kndFOrQ/Z+BPLsEKNHSLfqCyTYRF9NjTNrfDPr0EIVkKRC8CbJ0qpMwWH+CsxVUQc/GZ8N71xhRC7fcSL7+DDWbDq3j7MpiYT9EpSYX6zwmQcqsg= 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 1778567137416577.5509818406737; Mon, 11 May 2026 23:25:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgYO-00063G-Th; Tue, 12 May 2026 02:25:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wMgXv-0003VO-RE for qemu-devel@nongnu.org; Tue, 12 May 2026 02:24:50 -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 1wMgXs-0006Wk-KS for qemu-devel@nongnu.org; Tue, 12 May 2026 02:24:47 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-48a563e4ef7so45850445e9.0 for ; Mon, 11 May 2026 23:24:44 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48e9053f690sm24441985e9.7.2026.05.11.23.24.40 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:24:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778567082; x=1779171882; 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; bh=xmisohfUh01EbvNNSz+FoRzd51EcDKXzYYGKUUEU+RE=; b=JS76vRTZo64vqz39hiCCRWsQywBJ8IyJOoFMbNPsXcImFXzrolaVVLqB/fQBUWxEjN i2h2mZhKwP7KX8mmdOQ0JFBXHidQnw6XaxgsxRozCNvZYcc4gQgVBAjdpgmQm/LZa3m/ PBcCMSPuQKK7474nrWScpDfo+tLTexL00mIbGG2LcjfMHD+WKmwB7KbVa7a07YvZYXq4 jNcgQAA5+osFzeOFiMs5CeCeEKkcU1Up8C7mevHkaJM/72Chp1qvhQPNgGoFcu6eTDFb a4SQazJ3IknfCvYUGqjnTFWigZSFFBpqqdzf6+WUzv27ki4qqumbGuVU6QlBQL3ecNsK g+DQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778567082; x=1779171882; 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; bh=xmisohfUh01EbvNNSz+FoRzd51EcDKXzYYGKUUEU+RE=; b=f74XgK5vd50bl9g6mpmEwAnKnTK79iWmuvTO16RyfqV8r2MXInkmAq1TwjTAm9vXya k+5ow3yqrK7Ih6ggDqlY7cG2MRQb5iVs4bKjlUPmS9zZZfTkeQgt8PNOANEciKTOp9Ya ElSq6juA/kv7ScHOZksFcWZ9OFp0YLjIMDKaD/c4tgaw9vyYRLVimtA1lKTDTdzJwuTq agVufdAIYNzlkI0fvnuBDw7irRuVr+hT+laPQlGxUnoKI9Ek5EiSRXa2ttI5VrEpBjJu IZTeTfPD9NHn/bWI+/EGtU1KwhSc87PPhevIu4A16K9WGqBw30zdBgRjvrsHVcWyJ6Xa 5UCg== X-Gm-Message-State: AOJu0YwpRU+aiheQrzOg7vguhtUANmTe4q3O+zg5ukqJ2osBQiBn73+I PlcMfmSVFh5uY6rF8gQH8dsxsjZECe8hHOPU6E96FQHas0Fru2EW49BytOQ9SQ7PBr7a3semq3p dh2OaBrk= X-Gm-Gg: Acq92OGuVv5n7CzUwqmbA+l25m8qXBVJKwWiXqjSA8qTk6evEDry5hxMPc/9qaibuGy se90PBljX/E7FFgxoNPduVcmoyqRDjyOe65lNn1h6vCnPc6p25TZfi6SSlonhzSP19nVXMsgjh+ AEwDzQ08nGpt+CRr8C5cit6mHa8HdPJPX2sCvn1GDOmksw84Ywh6WnXUho/n9tSd5RZmN3LfBhE RyVHy+tdughfWD2xqcDCPlEFNK+Z/OjS8X8UrKPnbGXnuXtIeG9KfGVxKMPpg8D4MqScYHe9o1p 5HnP/+rp68ImYxjKZdPCwJScCUG/RMzZeuKO1RapQHuUZRHpOV2JfEcfi7nNhpcPIjeqK2eYFHp 1yzMzNvA9bDkV8eS1CLqlw999gW2d4N4pKZKwUN4+ASqeEthqcrYDHYUy+vaTn6G5s8U8C1Y8mq g9vYpHHYlyWO40sCGsJHb4AYrWA0Qe08q/2Kjl6+rB5nyXaY4y8KYdaaXzlA6/15OuI8w8eCj6 X-Received: by 2002:a05:600c:c058:b0:48a:599a:3716 with SMTP id 5b1f17b1804b1-48e8fe7fa6fmr15451465e9.23.1778567081889; Mon, 11 May 2026 23:24:41 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 25/41] hw/core: Implement cpu_get_phys_addr_attrs_debug() with cpu_translate_for_debug() Date: Tue, 12 May 2026 08:21:26 +0200 Message-ID: <20260512062142.67998-26-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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=philmd@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: 1778567138304154100 From: Peter Maydell Implement cpu_get_phys_addr_attrs_debug() with cpu_translate_for_debug(), so that CPUs can implement only the translate_for_debug method and have all of the wrapper functions cpu_translate_for_debug(), cpu_get_phys_addr_attrs_debug() and cpu_get_phys_addr_debug() work. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20260430093810.2762539-17-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/core/cpu-system.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/hw/core/cpu-system.c b/hw/core/cpu-system.c index 252e90c8fdf..954b81931d8 100644 --- a/hw/core/cpu-system.c +++ b/hw/core/cpu-system.c @@ -90,19 +90,14 @@ bool cpu_translate_for_debug(CPUState *cpu, vaddr addr, hwaddr cpu_get_phys_addr_attrs_debug(CPUState *cpu, vaddr addr, MemTxAttrs *attrs) { - hwaddr paddr; + TranslateForDebugResult result; =20 - if (cpu->cc->sysemu_ops->get_phys_addr_attrs_debug) { - paddr =3D cpu->cc->sysemu_ops->get_phys_addr_attrs_debug(cpu, addr, - attrs); - } else { - /* Fallback for CPUs which don't implement the _attrs_ hook */ - *attrs =3D MEMTXATTRS_UNSPECIFIED; - paddr =3D cpu->cc->sysemu_ops->get_phys_addr_debug(cpu, addr); + if (!cpu_translate_for_debug(cpu, addr, &result)) { + return -1; } - /* Indicate that this is a debug access. */ - attrs->debug =3D 1; - return paddr; + + *attrs =3D result.attrs; + return result.physaddr; } =20 hwaddr cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr) --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567167; cv=none; d=zohomail.com; s=zohoarc; b=ChlDWQy6k9RyynrU4vGncsU+Q3mMvTIFNBLMv0NaXVRtE0L/gO22FramiwDM6VAMIWkYljwUAXm01fg6iQhQs7dDzcViwfe1jXyzCohdkSgAaMyVVlv8AAZJJyrsQEaFtCYt1O0ozQn4furEePuEN9bIdcKkNSkChGl8WP4/gx0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567167; 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=HtM4pvITAcAWMJ185IMRhefQ8a/IBEtSiXJeVthh5tQ=; b=LTNuXrlnRUsd/o6GSPOXh/tra+hkC8s9Mi+ikkCDVu+1punR0rY6kEUeVKyhuhI4YfU3Y3JBb3BMaRZ/YUoQGnGrrn/B2isKzELWpfrmL9F/JqNrFB3S7w/QZMrBAZU8c9sYRvaVP1cQv6EFDkA4YrlTiZQmRT2GbSqMdR7AOQU= 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 1778567167981417.7647733789985; Mon, 11 May 2026 23:26:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgYk-0006mm-FB; Tue, 12 May 2026 02:25:38 -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 1wMgY4-0003dw-CG for qemu-devel@nongnu.org; Tue, 12 May 2026 02:24:56 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wMgY1-0006YK-0t for qemu-devel@nongnu.org; Tue, 12 May 2026 02:24:55 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-45297094718so4060367f8f.3 for ; Mon, 11 May 2026 23:24:51 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48e9052c7dcsm27706195e9.2.2026.05.11.23.24.47 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:24:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778567089; x=1779171889; 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; bh=HtM4pvITAcAWMJ185IMRhefQ8a/IBEtSiXJeVthh5tQ=; b=LoN2qTg3DJgnfyJZJxknaYPH0jICeEZ0ITgyrlPG4BrnW7dFR9cLh/DLOdQ6py/dcl 6d8uoWkPWOUl370mIzDW6iTGx9AiOnXIay2R66Mvr6TA25EVyNt+OuOBYHqp5ZQCni+B 5PlvaeuR15Lo23Sgo6feP/cK9yWzXSkH+Cx3iPNT1ATothV5u3sln9ktv9ogUS3apSuL JabPJd0USnYthMEpw3HYRtTtl6amygomHjBFOuWAi/3/kcAHgma41id8K9o5onrYGzYI 5Z0OWjZUxMnsGN9pMO5iExGkXAFWe4+E/u5myUBI0sO0XbFCeS/CnlEbbxFcJgk4KWl7 g1zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778567089; x=1779171889; 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; bh=HtM4pvITAcAWMJ185IMRhefQ8a/IBEtSiXJeVthh5tQ=; b=VevPqfeYAZV+cZ0Kt9xjRArLsD9w5fcp+BBIc+7C2tNsqERmzN6+Qhw/NhI87sSZx1 8+5mJNgmtXurxJFo66qQmN33xH4yioenBDC1gWGdKCfmQ8XL/0t4DkdXojAjyiEXNNz7 4EhPZ47MDEbYishD+pfkHE2BuQ+8LmnQYYR3kSSEI/b6b4CiTP1ByMweeOmt1uMx3IAi TnDtZKB99reFzVqYrKecNt+hmqYUs/QqZALOUq63Y0fEbJNbDWerynYpW4RB2ORNFbXI Ug3Qiq8pk5wevPikKlMufQsJbggD55J1sQx5wyvm7XAu70Ev1H2bhEKgK8E7Cl64Pkrp CB3g== X-Gm-Message-State: AOJu0YywBZdaOW+9Pbw+u2SQs2PXNu8IpbXDgf+m8dxD9PgL/y48q33b Jh3uYPDN3EwTG4AL6PVqcfZ07Uy6O1iMC8B3nN6wDJCtq32JfQXh5bK/CywzGKbcg40MzsO82Li 9d7K7obA= X-Gm-Gg: Acq92OG6ZAd/goF7vGPn7WvNcVr56s+DZr/uPpUWh8COPuZrGVBsgoP55g41DUNLa+P VALwPoKlQZ9Tm5o4Tb7VFtQBBwesaGcfhBgcCV4WUffr3rYBeIcaRwFi9ljKMhS9s1VC48WkpSQ fTrOMKPs4BN9dVgRcew5vEJ6aQ+Riabd1WxFN/nsRCl5h5rgbAYqaJkr6ntjhSm9xBhrCZ8fouv 5uzrcs5FSOQTNAPQ3AQkLE9fFg3X2/fW1CV+dU3NNWnGBzbflgT6UzTO+XD+ZescKlJFT79AGlA 7FtqgW9ylqkL6XPXOg/3UDLw7mTupWuZRO76pDKShbJZGSATfksTvrQKlYR2Fm8t0MByhCDVXcN h8c3MD3RTF5oadceb5rPSlvwhnYyafvuoW7KMvPzTn/FtR61IpK72EfmqeET8g5q/DHe+vZ7YWQ r6wlESqaB08id+ybISOANgrXFtcA/EQNz7NDs1kwlY8KORx0QLB4V+3CfxYcBHbs7WvFbh+Yr+h 4qjU+7Muj4= X-Received: by 2002:a05:600c:1f85:b0:489:1a3a:9e45 with SMTP id 5b1f17b1804b1-48e8fe825bemr22619285e9.26.1778567089010; Mon, 11 May 2026 23:24:49 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 26/41] target/arm: Implement translate_for_debug Date: Tue, 12 May 2026 08:21:27 +0200 Message-ID: <20260512062142.67998-27-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.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: 1778567169994158500 From: Peter Maydell Implement the translate_for_debug method instead of the get_phys_addr_attrs_debug one. This allows us to pass the caller the lg_page_size from our internal GetPhysAddrResult struct. Awkwardly, translate_for_debug's "true on success" convention is the opposite of the one we use internally in ptw.c, so we have to be careful about the sense of the return values. This corresponds to the way that arm_cpu_tlb_fill_align() also has to return true when get_phys_addr() returns false. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20260417173105.1648172-17-peter.maydell@linaro.org Reviewed-by: Richard Henderson Message-ID: <20260430093810.2762539-18-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/arm/cpu.h | 3 --- target/arm/internals.h | 4 ++++ target/arm/cpu.c | 2 +- target/arm/ptw.c | 39 +++++++++++++++++++++++---------------- 4 files changed, 28 insertions(+), 20 deletions(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 60f11379bfb..15a13b92927 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -1260,9 +1260,6 @@ extern const VMStateDescription vmstate_arm_cpu; void arm_cpu_do_interrupt(CPUState *cpu); void arm_v7m_cpu_do_interrupt(CPUState *cpu); =20 -hwaddr arm_cpu_get_phys_addr_attrs_debug(CPUState *cpu, vaddr addr, - MemTxAttrs *attrs); - typedef struct ARMGranuleProtectionConfig { /* GPCCR_EL3 */ uint64_t gpccr; diff --git a/target/arm/internals.h b/target/arm/internals.h index 86b41b4724a..3edc15c7b4a 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -1540,6 +1540,10 @@ bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t ad= dress, =20 void arm_log_exception(CPUState *cs); =20 +/* Implementation of SysemuCPUOps::translate_for_debug */ +bool arm_cpu_translate_for_debug(CPUState *cs, vaddr addr, + TranslateForDebugResult *result); + #endif /* !CONFIG_USER_ONLY */ =20 /* diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 6e13873360d..31e0a12a986 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -2498,7 +2498,7 @@ static vaddr aarch64_untagged_addr(CPUState *cs, vadd= r x) =20 static const struct SysemuCPUOps arm_sysemu_ops =3D { .has_work =3D arm_cpu_has_work, - .get_phys_addr_attrs_debug =3D arm_cpu_get_phys_addr_attrs_debug, + .translate_for_debug =3D arm_cpu_translate_for_debug, .asidx_from_attrs =3D arm_asidx_from_attrs, .write_elf32_note =3D arm_cpu_write_elf32_note, .write_elf64_note =3D arm_cpu_write_elf64_note, diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 24656b1a062..8706dd59dd6 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -3942,8 +3942,9 @@ bool get_phys_addr(CPUARMState *env, vaddr address, memop, result, fi); } =20 -static hwaddr arm_cpu_get_phys_addr(CPUARMState *env, vaddr addr, - MemTxAttrs *attrs, ARMMMUIdx mmu_idx) +static bool arm_cpu_get_phys_addr(CPUARMState *env, vaddr addr, + TranslateForDebugResult *result, + ARMMMUIdx mmu_idx) { S1Translate ptw =3D { .in_mmu_idx =3D mmu_idx, @@ -3954,26 +3955,31 @@ static hwaddr arm_cpu_get_phys_addr(CPUARMState *en= v, vaddr addr, }; GetPhysAddrResult res =3D {}; ARMMMUFaultInfo fi =3D {}; - bool ret =3D get_phys_addr_gpc(env, &ptw, addr, MMU_DATA_LOAD, 0, &res= , &fi); - *attrs =3D res.f.attrs; + bool fault =3D get_phys_addr_gpc(env, &ptw, addr, MMU_DATA_LOAD, 0, &r= es, &fi); =20 - if (ret) { - return -1; + if (!fault) { + /* translation succeeded */ + result->physaddr =3D res.f.phys_addr; + result->attrs =3D res.f.attrs; + result->lg_page_size =3D res.f.lg_page_size; } - return res.f.phys_addr; + return fault; } =20 -hwaddr arm_cpu_get_phys_addr_attrs_debug(CPUState *cs, vaddr addr, - MemTxAttrs *attrs) +bool arm_cpu_translate_for_debug(CPUState *cs, vaddr addr, + TranslateForDebugResult *result) { ARMCPU *cpu =3D ARM_CPU(cs); CPUARMState *env =3D &cpu->env; ARMMMUIdx mmu_idx =3D arm_mmu_idx(env); =20 - hwaddr res =3D arm_cpu_get_phys_addr(env, addr, attrs, mmu_idx); - - if (res !=3D -1) { - return res; + /* + * Note that this function returns true on translation success, + * but arm_cpu_get_phys_addr() and all the other get_phys_addr + * style functions in this file return true on failure. + */ + if (!arm_cpu_get_phys_addr(env, addr, result, mmu_idx)) { + return true; } =20 /* @@ -3984,11 +3990,12 @@ hwaddr arm_cpu_get_phys_addr_attrs_debug(CPUState *= cs, vaddr addr, switch (mmu_idx) { case ARMMMUIdx_E10_1: case ARMMMUIdx_E10_1_PAN: - return arm_cpu_get_phys_addr(env, addr, attrs, ARMMMUIdx_E10_0); + return !arm_cpu_get_phys_addr(env, addr, result, ARMMMUIdx_E10_0); case ARMMMUIdx_E20_2: case ARMMMUIdx_E20_2_PAN: - return arm_cpu_get_phys_addr(env, addr, attrs, ARMMMUIdx_E20_0); + return !arm_cpu_get_phys_addr(env, addr, result, ARMMMUIdx_E20_0); default: - return -1; + /* translation failed */ + return false; } } --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567317; cv=none; d=zohomail.com; s=zohoarc; b=Gd5ny/KP4k095sdiYnAhpvQcaHAv44u1LE8uElW7jITPZunpE1BJra8wQ4fxeiYC1w8B9SpczFdAvd1W+AcJ9wAuRLRv9vadl+kx6rt4xN3WiEuN4lDMQrVTKFYA8+C3PpBU9f+dUnid9KYBkiWcbHysLkuAHYC8b/y8ell/k8g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567317; 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=Bn7X1HxFbi8TLPRLLkIpSiNkQaC8IQE21wNQZ9Ce9pk=; b=jIF+POcg5wA5X5DMbQhwv0e5IQ8V0OAeeiN5dWna4GPD2TWP2eOc/p3qvzYiLevO2l+osr5ejniwwWYtRw1iuyyL/2yQw7GIW9c00qjVHE03i/e3jdyVtlngLSbmPDZzM/mGuS/bw405grRxkE96qPEqUGQFJr9VtjVwuveOFls= 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 1778567317538646.0730191261308; Mon, 11 May 2026 23:28:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgYn-0007Gc-Ol; Tue, 12 May 2026 02:25:42 -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 1wMgYA-0004Oi-GD for qemu-devel@nongnu.org; Tue, 12 May 2026 02:25:02 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wMgY8-0006e4-48 for qemu-devel@nongnu.org; Tue, 12 May 2026 02:25:02 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-441209fb77eso3072169f8f.1 for ; Mon, 11 May 2026 23:24:58 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4548ec6c79fsm32151306f8f.15.2026.05.11.23.24.54 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:24:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778567096; x=1779171896; 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; bh=Bn7X1HxFbi8TLPRLLkIpSiNkQaC8IQE21wNQZ9Ce9pk=; b=mf4X9Ej92FZ8L0Jz41c+9URevfg/loVFV81i6nF3lLhOJb5rDBjRzMZvibpdwYf2Vq Uw+F3vhFxS9nH2MHhZHnIl1VxFkO6TxQG3CrYvrXx1OjzOojUeza2dczKkyiNXiftM5E NK0CogAbTUl4rOzT8eMRHkBy08SOeQ/nm7DYASwceHgKAqPD6o8/6jB/Ug04OnKOmsvn YHKb0hyE/5RKWj6/g/+wi0RzTBCh7aAtALBQ5O2mXJyTw3fQotog9VFnYHluUoFIagrh gtd+DMUhKpub1HiHoGOG4Tygf28QAfzZCdfynb6tStX03Ma4lT88lXUdOCAql45XJS6U 5feA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778567096; x=1779171896; 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; bh=Bn7X1HxFbi8TLPRLLkIpSiNkQaC8IQE21wNQZ9Ce9pk=; b=peoPC4VybaEmtSGAQP0O/JnbQ1SV7RAS7cd1UMqA+GPnQhXjDCcVGYGKQN8GtS4Qz4 lTpBxmzeSFD5+LW1yNPx8CVeeq8auK65TjtmDOOw5NVdky03HZXruI8VSKU+3bH/auRI GctoVMhAar28/L7l9v+zlt/6f7bSnTIz93CaaqulDs1ceA5O5Pb+ENhx/BxKSMyLI9HX FiWClnBfyX0zVsBu+McH6+wMQp7e0O2+wmrAP189JgHfnfAXkBwAOCVIKMEnsudZqSQn uYQnk2+k1SkY5UGSzr8bq89/2DVx8RiRKRgSGbRwzfHgKYslmTVxn0JuWnEJwXShyb5C l6LA== X-Gm-Message-State: AOJu0YzuO5VX6A3ZcYDf0VG1SRwtGAsIjyZ6rUNG4fV4UOd6Xat1FRmg ZBVL6ETFNxHAkbR+p2htuqQjRA90Y6tzi3DDVekecoQKZI91KetfofA6QcTyuwYaFOyloscqwc6 vVE37WnU= X-Gm-Gg: Acq92OHnNetD0b8xv0XvZTzK8D2J4dZ9vMZdGkc3zvsAIB0Gq52tstR+7IAO2uYdVJr iBFIM+JWSsGkb/V5WBpxSlmac2A2V2pXmMwIpWaPwXAGdfTKoqNzymy98fXo1GW/Cc8toQsvpZC 1fmOIXHkBSL5F8K4tCqqY0BaYj+ALxu6KG4oRHss3Vh3mcqKEej63kCQf+0P1rO7pYOrEM8vI0I x8dxapU0VyDewFyaXkP0QpviPHFEP1pa9et9ivg5fSCiIBt9DtV3WfHrFDph8asmx2AHn0siGA6 Gtfd54eAYy4NhPSzCzyCVTAVaM06oT1BSoVR7juo/JIKEPwOXkTa6xesy2LPCskW884FP/JXB83 nw3yflucOtJ4iy4R6fgPiJ6pyxmSIXtol3s2RwSmhN23ljoIgeYDlhdOXhHVWnlLB4ZiuD+VYif jOxnYrWSyS0ubZ5cZYOsg0npRiOZ6aqI2AH0E+psax6eeIdo6OM1TrHvHn1091hOubanaq51P+ X-Received: by 2002:a05:6000:2288:b0:43e:a75e:352 with SMTP id ffacd0b85a97d-45ac093a86amr3545573f8f.4.1778567096080; Mon, 11 May 2026 23:24:56 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 27/41] system/physmem: Use translate_for_debug() in cpu_memory_rw_debug() Date: Tue, 12 May 2026 08:21:28 +0200 Message-ID: <20260512062142.67998-28-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.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: 1778567319246158500 From: Peter Maydell Currently cpu_memory_rw_debug() assumes page-granularity for translations, and it works in a loop where each iteration translates for the vaddr rounded down to a page boundary and then copies up to the end of the page boundary. Rewrite it to use the new cpu_translate_for_debug(): we no longer want to round down the input address, and the boundary we copy up to is now determined by the lg_page_size it returns rather than being assumed to be page-sized. This, together with the implementation of translate_for_debug for Arm targets, fixes the bug where semihosting would incorrectly fail to access parameter blocks that were in memory where the start of the 4K region they were in was inaccessible due to MPU region settings, even if the parameter block itself was readable. Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3292 Signed-off-by: Peter Maydell Message-id: 20260417173105.1648172-18-peter.maydell@linaro.org Acked-by: Peter Xu Reviewed-by: Richard Henderson Message-ID: <20260430093810.2762539-19-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- system/physmem.c | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/system/physmem.c b/system/physmem.c index 652b03ad5f5..7bcbf875736 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -4030,28 +4030,38 @@ address_space_write_cached_slow(MemoryRegionCache *= cache, hwaddr addr, int cpu_memory_rw_debug(CPUState *cpu, vaddr addr, void *ptr, size_t len, bool is_write) { - hwaddr phys_addr; - vaddr l, page; uint8_t *buf =3D ptr; =20 cpu_synchronize_state(cpu); while (len > 0) { int asidx; - MemTxAttrs attrs; + TranslateForDebugResult tres; MemTxResult res; + hwaddr blk_base, blk_size, l; =20 - page =3D addr & TARGET_PAGE_MASK; - phys_addr =3D cpu_get_phys_addr_attrs_debug(cpu, page, &attrs); - asidx =3D cpu_asidx_from_attrs(cpu, attrs); - /* if no physical page mapped, return an error */ - if (phys_addr =3D=3D -1) + if (!cpu_translate_for_debug(cpu, addr, &tres)) { + /* Return error if no physical page mapped */ return -1; - l =3D (page + TARGET_PAGE_SIZE) - addr; - if (l > len) - l =3D len; - phys_addr +=3D (addr & ~TARGET_PAGE_MASK); - res =3D address_space_rw(cpu->cpu_ases[asidx].as, phys_addr, attrs= , buf, - l, is_write); + } + asidx =3D cpu_asidx_from_attrs(cpu, tres.attrs); + /* + * Clamp the amount we read to not go beyond a page even if + * the CPU returned a larger lg_page_size, in case this access + * is to a memory-mapped IO region. + */ + tres.lg_page_size =3D MIN(tres.lg_page_size, TARGET_PAGE_BITS); + /* + * Find the length in bytes from tres.physaddr to the end of the + * block whose size is 1 << tres.lg_page_size; we will access + * that much in one go. + */ + blk_size =3D 1ULL << tres.lg_page_size; + blk_base =3D ROUND_DOWN(tres.physaddr, blk_size); + l =3D blk_base + blk_size - tres.physaddr; + l =3D MIN(l, len); + + res =3D address_space_rw(cpu->cpu_ases[asidx].as, tres.physaddr, + tres.attrs, buf, l, is_write); if (res !=3D MEMTX_OK) { return -1; } --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567421; cv=none; d=zohomail.com; s=zohoarc; b=gb5kLxOFArr+XO5rqOTcUbVFWwrp1y/g3h+u71+OcPdxFLE7elgNnKX/kHNsT8iecKYQYiWVLZGaaWq0C6QmhUTmSpg6c0XnIFjlNgifn3RTl/dZHH0GGVB9eWOWc7D+aOR1f7h/o9o+EmnMGhms5uTtwar/ENC7aahCEpvh0ec= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567421; 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=Q/74YiYYWVPq8korOPGH440atE8m0+pkzhjzBW4zxKQ=; b=dYRz02akyJA/GMOa6Q0iqavvioHmCbzoKL1uBu3e2OTPnOTHjtf/6KReKJwSnC/eTce9LEvc3arcJZ6KPtmi4wPLUOtGUA7bg7JriBNUfDWrsuAIvGk9/IW7WsJy6V3Io2cUHwQnpl28twhiT+eiqTj7IDtjAehYRLSTdUn8/4c= 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 1778567420978892.3444699852114; Mon, 11 May 2026 23:30:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgZV-0007jc-Dp; Tue, 12 May 2026 02:26:25 -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 1wMgYF-00052k-P5 for qemu-devel@nongnu.org; Tue, 12 May 2026 02:25:08 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wMgYD-0006qs-Pg for qemu-devel@nongnu.org; Tue, 12 May 2026 02:25:07 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-44509921fbcso2550207f8f.3 for ; Mon, 11 May 2026 23:25:05 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4549120eb95sm29585051f8f.20.2026.05.11.23.25.01 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:25:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778567103; x=1779171903; 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; bh=Q/74YiYYWVPq8korOPGH440atE8m0+pkzhjzBW4zxKQ=; b=uqTrdMPBmfwA1irKNtmfuUpEh0NugP+Jze3VRtkpg1vV+GVKNu8SAnO4uWU08Q6L2p d18k6axxYLlbTLwoSblQA35prQSHQ2uVmNan7mLjs9mOpKUDHaMOa2LZQ0ftvp3G5o9p YI47s4ZuKuJzlRJMmr++grIUOailB8JzPU2LM3XaGnxCDpUbOmzuJaLDvKhPnK/srvJ5 rGmxSFRYrH9vxaR1Wjybn2bZjyNe2FhXVNHRJ3fZYeLAver0l5q+LSOUTXVVnz0MhbcM 4iddv1p8+nUk02BIM8eiqU27cOvoSeLrnkRkLYPBZ9ChTQsevD22Q9nRLFF/4lcXr+QE 0M7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778567103; x=1779171903; 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; bh=Q/74YiYYWVPq8korOPGH440atE8m0+pkzhjzBW4zxKQ=; b=oMyDa3asacGX3bHF5DGf2/4sK7UOXAzUR2BubXnZG88SolLPJJgC5hoforDOjsqBqY /9yMj/1qQakFySIrDhcaHKTFKfXRAn+y4XdGGYCV1T5U3vyOEIoB5mop4HRTYKO/Fl+L XIKrm7Wb9yBvK0hz34yPcoXIjCD8eOz9MngWpBd7FbUE3h4pSBL89BRiFlMZ11RO4Ngu 5V2nz2hGIOltZS3GFvD0QXrurK/+WCcgecOIoRsS47RCsr9TCJ3Yzl/MR9QtlXf25dQy nesKgGubwk8d3/tnFf17aJc/iORNLOHfnPg819MfDRohSPvFAuN1bQd0wKQKhFZjeNNT mGLQ== X-Gm-Message-State: AOJu0YxhDM30fyuLh1NHvI5oPYJ7GMjw3mb50cwKk/VLuljQw5rkPh5l uPIhkcCVFK26eb5lfTICX5ps6cGbON+BN6quEDWGtEOmIeBOFefTxQ7svosxD/bLsQptOI1Qsd0 9ytTzm8M= X-Gm-Gg: Acq92OGS4VXRCOC6xbc7qhma5GcRldIXuiZJU+2s8x8i8OnbKFrU0EtlU7sOnefMZEt JmNPkBmTiU9ELzA7Gy7r9ua8LvIgwzx3+7llwkcMlP7wB/FizJXdJnWjw5KqC3AtjZdfMtpk/qo mpgyFzJo2987NB92vhzz9C9iaY//PhWOxe45MOtlbIvussxmy9g97/gtPVYnJW8k7vPGy/KETyp sdoNmK0GtpgK87PH3uOxLJHeyDuIPFcCN0E0K/IM8XEojADQeBPImPOxKwpXDu0suxnGbgRqbte ZIen0wb/K4Mzjxox5eXsih9HF1WD2L00H8P7+c37qSNvjyZ8K0S2q3mhi/34ZjsyAgcWgOY8W0S rvr+N+JAR+BxpaiWBHksZsje8cxUcSY5A/RQLM4YH2WqHn+gFmdjwEtQ4AF72KwCCWFZaKkvddZ RYMUwClUz/bS24B9NTTU1fM6znl/2cHg6w1YySW1ziitk8jDZs5q3RtOYZ4bb2w1yVaptAUkmZ X-Received: by 2002:a05:6000:2082:b0:43d:7e34:889c with SMTP id ffacd0b85a97d-4515da97e81mr42221304f8f.39.1778567102896; Mon, 11 May 2026 23:25:02 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 28/41] hw/i386/vapic.c: Use cpu_translate_for_debug() Date: Tue, 12 May 2026 08:21:29 +0200 Message-ID: <20260512062142.67998-29-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.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: 1778567423359158501 From: Peter Maydell We would like to remove the cpu_get_phys_addr_debug() function, by moving all callers to cpu_translate_for_debug(). Update the callsites in vapic.c. In the process we can drop the old "OR the page offset back in" workaround that we had for when cpu_get_phys_page_addr() returned the physaddr of the page base rather than the exact physaddr of the input virtual address. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20260430093810.2762539-20-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/i386/vapic.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/hw/i386/vapic.c b/hw/i386/vapic.c index 225f19a75c7..781bf2a7fa5 100644 --- a/hw/i386/vapic.c +++ b/hw/i386/vapic.c @@ -161,7 +161,6 @@ static void update_guest_rom_state(VAPICROMState *s) static int find_real_tpr_addr(VAPICROMState *s, CPUX86State *env) { CPUState *cs =3D env_cpu(env); - hwaddr paddr; target_ulong addr; =20 if (s->state =3D=3D VAPIC_ACTIVE) { @@ -173,8 +172,10 @@ static int find_real_tpr_addr(VAPICROMState *s, CPUX86= State *env) * virtual address space for the APIC mapping. */ for (addr =3D 0xfffff000; addr >=3D 0x80000000; addr -=3D TARGET_PAGE_= SIZE) { - paddr =3D cpu_get_phys_addr_debug(cs, addr); - if (paddr !=3D APIC_DEFAULT_ADDRESS) { + TranslateForDebugResult tres; + + if (!cpu_translate_for_debug(cs, addr, &tres) || + tres.physaddr !=3D APIC_DEFAULT_ADDRESS) { continue; } s->real_tpr_addr =3D addr + 0x80; @@ -292,6 +293,7 @@ static int update_rom_mapping(VAPICROMState *s, CPUX86S= tate *env, target_ulong i hwaddr paddr; uint32_t rom_state_vaddr; uint32_t pos, patch, offset; + TranslateForDebugResult tres; =20 /* nothing to do if already activated */ if (s->state =3D=3D VAPIC_ACTIVE) { @@ -305,11 +307,10 @@ static int update_rom_mapping(VAPICROMState *s, CPUX8= 6State *env, target_ulong i =20 /* find out virtual address of the ROM */ rom_state_vaddr =3D s->rom_state_paddr + (ip & 0xf0000000); - paddr =3D cpu_get_phys_addr_debug(cs, rom_state_vaddr); - if (paddr =3D=3D -1) { + if (!cpu_translate_for_debug(cs, rom_state_vaddr, &tres)) { return -1; } - paddr |=3D rom_state_vaddr & ~TARGET_PAGE_MASK; + paddr =3D tres.physaddr; if (paddr !=3D s->rom_state_paddr) { return -1; } --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567169; cv=none; d=zohomail.com; s=zohoarc; b=Wohy26kInuRvbRWXhYActpbOHIVHMbAO+aIlc7mDYKkItadUZby/P0wFJpa5JJfEdPREolqkhT1NOgeg0ngxiQi0/qgQ+0Y2/A7cB8u/8jUeFO446mu5FaEIepGjlE3HxmRBfMRxDbZIQwWocwXUsNfv/1nw8qo9/eDZdIYA9vc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567169; 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=r8+NFf9FyKxtvMfqFZnOV5rrCCyn81He/Ss7zMXlTQc=; b=nnQ8eUmLdAdOcVv3R7o5K3aF+v3rNdxzgARw31WFdFG9bg+G+brIQNvneEuJpEsZs5GuugXSaYkksyICFklErSX0MybquQM5pVXsxsdczin8lArzfIthm8tTy78/lKOFn52P/DxrtADY6Ergswkv22QILCKW9X61mNbSNWa/SSU= 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 1778567169235908.0550545161527; Mon, 11 May 2026 23:26:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgYg-0006OT-Fz; Tue, 12 May 2026 02:25:34 -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 1wMgYO-00063y-6H for qemu-devel@nongnu.org; Tue, 12 May 2026 02:25:16 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wMgYL-0006we-Tt for qemu-devel@nongnu.org; Tue, 12 May 2026 02:25:15 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-48d146705b4so62557445e9.3 for ; Mon, 11 May 2026 23:25:13 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48e8f435a76sm11424065e9.21.2026.05.11.23.25.08 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:25:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778567111; x=1779171911; 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; bh=r8+NFf9FyKxtvMfqFZnOV5rrCCyn81He/Ss7zMXlTQc=; b=qg7kKjDMMWMkjgXBOBtbaqe+FN3cV4Xsip92k2GqBg+gxoL2SJko/sOOmOQvqPnu41 E8puf4v0D7CHElsP2fjXEJQTWgfjIZ8ODCg0egsBrGs2xJUCM8mU3xTOo8WxChoowpPc rbpOyMLujLo1TaLhf6CpsmgwoUijduAUbc6nbQcr6bethAMogBXY1lxpCINm3Zzk6Jck GICkUapFkyytw5oq7b9yiBHK+6uESxJyyNwLtGaD6swcah6EcyGy/DZHeeCxdlxa/ysp YhtiRHhRDFe8+IfxLluVSLdBaI/xhnmWlzgQ90a0G2bBnU77ZbfejOjwpI2Jk87LiX2s IBMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778567111; x=1779171911; 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; bh=r8+NFf9FyKxtvMfqFZnOV5rrCCyn81He/Ss7zMXlTQc=; b=MY+T8X1kM6S1O/kXwmkIMLrXns990jTi7yMqrmPHuVfOLzGYudMCEq2C7qIXfWC1/U HSmhGT/eNXW2g1qSYIFKTCZK6E1WDuT7RbtGKGtq09DF4Oi8+0iRmd/fygHJsxfFyDkZ NKIt9Xk4fu1M2UVt4d4D/KzS2N6o4YeJtzbGBYTV/XpVYqKkckhqCIuaZJ2ZTJDxmLwh Ieg9BAh6gJcbjJdA8dFtIOdVNH9iRQb6Rg/nleaoWbpTBkP5umaJwgqgUfX5fVX42OBq ggl3mKaUAg4kgQQlrD0LUz68hRfaRm19vBfdK2nlB03dGsLBeGnj5E2HMkwHVR+r8naD Hhnw== X-Gm-Message-State: AOJu0YwXt+CuD99U765SFm92fdcEFrA/KtobaHjNP140eCRPPXJMmwm1 Zs2PeANDS7N+F/0CtyIftuMiWtbGVW7GMBY/8agrOpVIDezm4gqZYN/qqRaK70WZU00Ou5Tj2FE pw9SWvaE= X-Gm-Gg: Acq92OHnvWD4AMQZKHWeLZ+MvEnEDCBDoUEQLtsID5HFFMGEH6e6i9vbsxmMwFm2aJ7 Glaf5IAYbh1WAugBNkSVDQDClcN+mzJjPtlWHpgImvVURr5Y1KpumuuX16pjkskApIWhorCHNJ5 jDgUtVHoWDBK4V3qdwjjsHYaMMKChZJGo7gH5o17BMp3I8GmRC9fTBBGKaHP4Hw0XFZPyEmCww8 ++VyTbAdSFEBThozOQKzWvYWU7wbJdkpeiBiT6HoEganyREPnbyfiYsvsZxkT7VX8dq6KzQVDxW 1ePOA0Fs4lEqv03OH2Ed83+JI2umEJPcaly2Mc8GX8yGr7sf4Vu0s7EwQnvr+I/TkohROZ2+m97 4QhP38p0UDMeS+LMekgu0MklsJh9iyhvLFiq8TgKRLiWCsm483L+RR7s/iC11M9M4s4Cfekhaub irU6UleBTZsepauIJQQQq+QzwJpqQ3YQfjWqa5aAfUMT8Ye7bQdJkIOF8qAWdPsz8hXHT4aUu+ X-Received: by 2002:a05:600c:37c3:b0:485:30d4:6b9e with SMTP id 5b1f17b1804b1-48e8fe7cdb0mr22005855e9.21.1778567111363; Mon, 11 May 2026 23:25:11 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 29/41] target/sparc: Use cpu_translate_for_debug() Date: Tue, 12 May 2026 08:21:30 +0200 Message-ID: <20260512062142.67998-30-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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: 1778567171072154100 From: Peter Maydell We want to remove the cpu_get_phys_addr_debug() function; update the sparc dump_mmu() function to use cpu_translate_for_debug() instead. The "mmu_probe succeeds but debug translate fails" cases are probably not possible in practice; since cpu_get_phys_addr_debug() would return -1 in that situation we make this conversion retain that behaviour. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-ID: <20260430093810.2762539-21-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/sparc/mmu_helper.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/target/sparc/mmu_helper.c b/target/sparc/mmu_helper.c index e1abd520c49..e441ffb8f7e 100644 --- a/target/sparc/mmu_helper.c +++ b/target/sparc/mmu_helper.c @@ -360,26 +360,39 @@ void dump_mmu(CPUSPARCState *env) unsigned int n, m, o; hwaddr pa; uint32_t pde; + TranslateForDebugResult tres; =20 qemu_printf("Root ptr: " HWADDR_FMT_plx ", ctx: %d\n", (hwaddr)env->mmuregs[1] << 4, env->mmuregs[2]); for (n =3D 0, va =3D 0; n < 256; n++, va +=3D 16 * 1024 * 1024) { pde =3D mmu_probe(env, va, 2); if (pde) { - pa =3D cpu_get_phys_addr_debug(cs, va); + if (!cpu_translate_for_debug(cs, va, &tres)) { + pa =3D -1; + } else { + pa =3D tres.physaddr; + } qemu_printf("VA: " TARGET_FMT_lx ", PA: " HWADDR_FMT_plx " PDE: " TARGET_FMT_lx "\n", va, pa, pde); for (m =3D 0, va1 =3D va; m < 64; m++, va1 +=3D 256 * 1024) { pde =3D mmu_probe(env, va1, 1); if (pde) { - pa =3D cpu_get_phys_addr_debug(cs, va1); + if (!cpu_translate_for_debug(cs, va1, &tres)) { + pa =3D -1; + } else { + pa =3D tres.physaddr; + } qemu_printf(" VA: " TARGET_FMT_lx ", PA: " HWADDR_FMT_plx " PDE: " TARGET_FMT_lx "\n", va1, pa, pde); for (o =3D 0, va2 =3D va1; o < 64; o++, va2 +=3D 4 * 1= 024) { pde =3D mmu_probe(env, va2, 0); if (pde) { - pa =3D cpu_get_phys_addr_debug(cs, va2); + if (!cpu_translate_for_debug(cs, va2, &tres)) { + pa =3D -1; + } else { + pa =3D tres.physaddr; + } qemu_printf(" VA: " TARGET_FMT_lx ", PA: " HWADDR_FMT_plx " PTE: " TARGET_FMT_lx "\n", --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567187; cv=none; d=zohomail.com; s=zohoarc; b=mO3D3Dd4g1IeG18jhfoXporQIed9RxeRghT06G8Hhr8jq/MNHTh9xV/qz+kQtJqvEV8/DfApnxK36zpGkuvr+JkRsFQk3Dx1LDDJA1NP5aRBSs1gzC30eKxekJpcdDFdihQb42uBDMoxQBs5Ndy43R4YwkPKdokxgn2VuIxz7GY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567187; 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=Lw3d2uJ+R/wSfLY+fpKQlgCduoUOgRx7Ov/XrzFQoZs=; b=WrQhvadfmdOr+JaSxN15z59RG0/pm4DR7YT9tqcbtMUBCkVt/NCzLISakzoyWF2CVbmYPncP+QGULne7logfnrEqezkBJ7vaUORb5tRIm/wQ4dwo8KpDXVhDm3xAIIlZCdalAYvqH/CRvDtuFVFnnD2Zu3/347WX1pN16FwRs4g= 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 1778567187788276.02407033873226; Mon, 11 May 2026 23:26:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgYk-0006pN-L1; Tue, 12 May 2026 02:25:38 -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 1wMgYU-0006OZ-Gw for qemu-devel@nongnu.org; Tue, 12 May 2026 02:25:28 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wMgYS-000721-Qs for qemu-devel@nongnu.org; Tue, 12 May 2026 02:25:22 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4891b0786beso33230725e9.1 for ; Mon, 11 May 2026 23:25:20 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48e906ae8b5sm38760495e9.6.2026.05.11.23.25.17 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:25:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778567118; x=1779171918; 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; bh=Lw3d2uJ+R/wSfLY+fpKQlgCduoUOgRx7Ov/XrzFQoZs=; b=BCXhUvZHScEjIHVqWYhMzEumD8B/CvQnGgXddsy10nOhe+BNzOlsghnxLpqmvzcKMe g8ikJfXv3vogIJNkPllrnT7taqHgbxF64+zrOfQawOOWJtsVa7nDPQNdAw/oHHQ+EUn8 UorjqYN/EXjWGC9hdOOtrxo+edakROE7Qo8RJpfOBp3RsWVSkZISeq6eAjo5Qr/TT3u3 tIcXLvUDQahEB/siVVns8TUoXETCxk7vf2cwJk3t85Jm8uDDmlwMQzBJbAa+DA86AeOP b1kMYoONGrqnHSKYUXivc1jZ1nX4gJBGQmz5lSIi8/nNpqKcRc3rAi4/tOQyC9mehlvN iBCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778567118; x=1779171918; 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; bh=Lw3d2uJ+R/wSfLY+fpKQlgCduoUOgRx7Ov/XrzFQoZs=; b=Y5Y/lAXOfPoLZPJ2TVRkuL2Xmt/IRGu4tIpGlq87Cb5LO+KDO0gmSmY1qoPCHzLWSh mjW7rdbANsexs3TyH/2DotIhDxTHIhs7Dtxu1pigLYsNotwNvxwIj03NlrcQ77fhdOhD 1NdaY3hl1o/8VaEIYdWLemi/LbiwL60Wk5jU8o6IoRGsKfjPVAvJU3WPlwaHfHg6pWMi F/7XFaiUtPuAaXiybOkAWDfqKt7i0IO9YQerCp0jM0Zo+FdmrJA8+7Z/9n61tk8j64sI C+LZVkxS3ytSd9bS0IhZSiqaDmDe3Ij0dAe6myq35VlrnJZIRrEm+qwdGX8PwIZzmLMx fnCg== X-Gm-Message-State: AOJu0Yw+YWJYSF+ON41EhOAmf10yEI8rC9BISjrUbbxm1rmLV5rxNZyU nFf9xFX0G/Fk+fbJ59HSbwyEzu+z/XlU8bwaH0wOrJYCQXfaJiC6vjvMF6hiERnLFGp5JRgySqH Ld6n9HZU= X-Gm-Gg: Acq92OGm8pZzolemGFuCcb7oUR4LaYMm008ZqGme1EqWL4tQYxSHIJQ9iTsmg8t7JUE Dx0UflUhirpIbyp63ImV7Ee0/S4ALsQ+MXjrlnf0mny09/+vo6vt0QJe723Iv0XeXWL2mar+u0g lVHct4HvcvFbDeiyapT+UWUoEtOr44/4tTnd+jN+8oVU1etg0WXqXx9LxTOPT6zmwPuVwZqvHNV AM9qMfKKIBJa+yHganz0wRjIhoIAD+3EUghAx/N4zbopWOW6t+jmRVew+Ivql31UdaZY+IyKi5c QETQoDmCx+KCFneWBWBtsMF16S0/Dz0Uwfn/tIU5H6ADf9MfXzngsrWm7k7OBOa2M4FcrClviHb BmO+yOP4pBw5S5Rs6zkX1T471FCkO8JySKO8hhd9qEdKPGSTzW8xqb30p3D9QjvQTUoxJHP9/x3 r7GaKPYXvMoMIYqlSbRyTil60P7y0o5SzzVfUXOWyzGiEcEHVfVOcmp1HO/q6dM7vXvE4xC8/s X-Received: by 2002:a05:600c:26c8:b0:48a:9562:7a30 with SMTP id 5b1f17b1804b1-48e51f4934cmr271044035e9.24.1778567118292; Mon, 11 May 2026 23:25:18 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 30/41] hw/xtensa: Use cpu_translate_for_debug() Date: Tue, 12 May 2026 08:21:31 +0200 Message-ID: <20260512062142.67998-31-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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: 1778567188119158500 From: Peter Maydell We want to remove the cpu_get_phys_addr_debug() function; update the xtensa boards to use cpu_translate_for_debug() instead. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20260430093810.2762539-22-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/xtensa/sim.c | 6 +++++- hw/xtensa/xtfpga.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/hw/xtensa/sim.c b/hw/xtensa/sim.c index 32eb16442f0..835cd04fe01 100644 --- a/hw/xtensa/sim.c +++ b/hw/xtensa/sim.c @@ -40,8 +40,12 @@ static uint64_t translate_phys_addr(void *opaque, uint64_t addr) { XtensaCPU *cpu =3D opaque; + TranslateForDebugResult tres; =20 - return cpu_get_phys_addr_debug(CPU(cpu), addr); + if (!cpu_translate_for_debug(CPU(cpu), addr, &tres)) { + return -1; + } + return tres.physaddr; } =20 static void sim_reset(void *opaque) diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c index 256497e162d..33a2d9485cf 100644 --- a/hw/xtensa/xtfpga.c +++ b/hw/xtensa/xtfpga.c @@ -191,8 +191,12 @@ static PFlashCFI01 *xtfpga_flash_init(MemoryRegion *ad= dress_space, static uint64_t translate_phys_addr(void *opaque, uint64_t addr) { XtensaCPU *cpu =3D opaque; + TranslateForDebugResult tres; =20 - return cpu_get_phys_addr_debug(CPU(cpu), addr); + if (!cpu_translate_for_debug(CPU(cpu), addr, &tres)) { + return -1; + } + return tres.physaddr; } =20 static void xtfpga_reset(void *opaque) --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567198; cv=none; d=zohomail.com; s=zohoarc; b=kKcy/LuLiywTtYee07aTw49HIveHN4FT6rL4QB5zrdg23GGzFFL/8NR7sDtCNUcF3FUemPtHaLmd+3GjOu2uHemNtrcRu2aSgT4JPRibQ1WilSzqhawIl45B1KgpzkPcKBrf9fiCERjZ7DH2Z8j+LyocprTaegpkcdCwddBZyNo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567198; 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=NxrosfhIy8+CqlY7B+TrpDgj57GBLoeZesxkHF+4QDk=; b=gxWOc+81t+YppaG5FU/JpgBbM3SD7qvI13ae/PynQ/r/+P0+FFmDgnVQEAT0etYmmlL+fli2b5PoyrAENZaE8GgxxlnoaAnddlfX31ORreGJATcwAxHr5MQiv2I2jWWpeW4AsBMTeajZX+zi6hckP/9dzKRyq4hrN5DqZaYFOUs= 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 1778567198540283.01047006235274; Mon, 11 May 2026 23:26:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgYm-0007B3-Sf; Tue, 12 May 2026 02:25:40 -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 1wMgYb-0006QW-R6 for qemu-devel@nongnu.org; Tue, 12 May 2026 02:25:32 -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 1wMgYa-0007B7-AB for qemu-devel@nongnu.org; Tue, 12 May 2026 02:25:29 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4893940bb5eso30887765e9.3 for ; Mon, 11 May 2026 23:25:27 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48e8e60f3d1sm16052525e9.3.2026.05.11.23.25.24 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:25:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778567126; x=1779171926; 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; bh=NxrosfhIy8+CqlY7B+TrpDgj57GBLoeZesxkHF+4QDk=; b=bWPJOwhud89dsv0foxGNw4nIpqPXJGuQNfeUW6J4Gux5LHfMbQv9e3nOx9npySERZb BMeRQaG59zuAVs3rqxD5cDIPfxoTcnjgR5fIjv8Qt5dOGeY12ZfD77DIgd6T8u1DyD31 m/LToolVWxo2LGkqBXWw/IwdmP9J1cpNRjcsdzM4Tyf7MHu/s9HRXaLWSMeiwRT9/tMx lzUNC1R2aoBZIo0MfdwG4tLi2Bz6DEKqq/U946OG3ZUFD2lgcVvNZcydzRFetQBNANxf 1TNrRc4NB+Fw26bhxW9P90/MtgaQP5uuTRSAm3/GGQYJFbAvFnptlaV+fh15N5SB8PUg Rizg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778567126; x=1779171926; 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; bh=NxrosfhIy8+CqlY7B+TrpDgj57GBLoeZesxkHF+4QDk=; b=XRTv/ZuGrTTs2I1MG6zD5tNx9lHaKtIIW2Ke6gQLmDo0R6bBSgxVeAsk39ELGW3Tlt KubAqKkEBS/EF5dRSM/0FPyy9uTBW7kXMfck9VLXJXB+NPuyonNSkeUS9aMOh+cOxjP1 gz8zHBxTB90LhMuW88ts4Kr/Ob/p5kR81v6K6UHkPB1ReopXb6VnNpVnIgZXUNxOJFgw GXy3mF615vSrfZiBdrU0UTc7m/+Gvaus8D0rYEyNT0L60fTk7vmdeZ54NNNV5zIEeCw4 f6YDyKbDRz5CUd+OmMs1r1k6LIASizvs7Wz4TlmQQNN3VzAju46gYwgCNTZ8PQt55Q5i E1FQ== X-Gm-Message-State: AOJu0Ywb6gMUltSyWqsPtdAzVwaz7k8MUyTp5otK6J7xUl7Q0GGbn0o+ HCtc3Tt+5HtzA03lm82ghwJVSm/+deE9hyByADQ/oSyAzWFJoIgktCA/Q7a8Ows2MTvQNO9U/xS mC5sN12c= X-Gm-Gg: Acq92OG8sS/w2jiHCy+DbgeGaO/X7EJwWs5NNgyO4lPeEGKpPzbkCMm8FH2+8sWEf8y AQPY1WQt4dJAtkKoy3HXxcQMmxwYIjFlP8pRusI37nqIjOfeQk+4XGbv+Vy9DFQNw3TdIKO8I7e i0Krszp6opPF6I5VGlgHkKaHdNlo29HwAMbzgZqYVGfYLqBrhJycv76z+1sVSeXiXIesJp4Q1RP IC1AmH6Z3R70PxlqudDzjmOGKQyV/Vbh6O55MoECVX3ZfYNKX2YEGz7RswNEe4B33YJYjx/Lnax wUfnZ7bgtDA0n3S5mO2pMGXd88BC6OsbX39AdzKOO/cJ9m76e9yDFQV5bknmyNylal45evEjiYH rp7wmI7+hWLiqOyC2H1Dbt9SoABPOWjYsRGjhuFhHEy2NCo0fFbxoC3LI+HUC0jnCG33efK2oUD W3BFYUDvA1DUtD/TUW7CgPD/1DJqdi+iaheoRegs0ay2g/Ae64yIBvvhLVgd1Cyad6Yr9M7GgC X-Received: by 2002:a05:600c:8908:b0:48e:6275:27ec with SMTP id 5b1f17b1804b1-48e676b6393mr180787645e9.24.1778567126471; Mon, 11 May 2026 23:25:26 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 31/41] target/xtensa/xtensa-semi: Use cpu_translate_for_debug() Date: Tue, 12 May 2026 08:21:32 +0200 Message-ID: <20260512062142.67998-32-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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=philmd@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: 1778567199654154100 From: Peter Maydell We want to remove the cpu_get_phys_addr_debug() function; update the xtensa semihosting code to use cpu_translate_for_debug() instead. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-ID: <20260430093810.2762539-23-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/xtensa/xtensa-semi.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/target/xtensa/xtensa-semi.c b/target/xtensa/xtensa-semi.c index 9a6a9c8b4e4..3340bd1d415 100644 --- a/target/xtensa/xtensa-semi.c +++ b/target/xtensa/xtensa-semi.c @@ -215,15 +215,20 @@ void HELPER(simcall)(CPUXtensaState *env) uint32_t len_done =3D 0; =20 while (len > 0) { - hwaddr paddr =3D cpu_get_phys_addr_debug(cs, vaddr); + TranslateForDebugResult tres; uint32_t page_left =3D TARGET_PAGE_SIZE - (vaddr & (TARGET_PAGE_SIZE - 1)); uint32_t io_sz =3D page_left < len ? page_left : len; hwaddr sz =3D io_sz; - void *buf =3D address_space_map(as, paddr, &sz, !is_write,= attrs); + void *buf =3D NULL; uint32_t io_done; bool error =3D false; =20 + if (cpu_translate_for_debug(cs, vaddr, &tres)) { + buf =3D address_space_map(as, tres.physaddr, &sz, + !is_write, attrs); + } + if (buf) { vaddr +=3D io_sz; len -=3D io_sz; --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567317; cv=none; d=zohomail.com; s=zohoarc; b=SYARZORUfWvu4Rcva0BbOb1j5QW2OydP7pVF6Zly1IycMIsSXGxH081zWwZUdGoVr3kwnw96S9Ad9Estudp5r48wPtg+QAnfrLhX+Y5iYKXP3/DUT0lgohf4YhFRBI8vVmFAuUHyrpVhHs/YHw6RJoQXyffnXnFF/xYgl7p+wC0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567317; 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=HfbY1c3UCIy8gQxFWOZ/VIeIMJesFzcBvmUGEZHahNE=; b=QjYDc/n+S0OEJwzJUMBIeURZ0xMPvEsgiMsIUuU5De/qYz8SxwKRXAOlPWNZrrxnYXNBGicejtJLkE91Kzm/6XUVWn8FDFd7e6G+c32w1jOuksENIlXh+dpEXGlhtu+UyCdnzkdakf8ss5a4ozrFqTjItkA3X8TB9NyYdoopiKU= 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 1778567317486574.1661453303838; Mon, 11 May 2026 23:28:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgZZ-0008J9-Jz; Tue, 12 May 2026 02:26:29 -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 1wMgYj-0006gN-0g for qemu-devel@nongnu.org; Tue, 12 May 2026 02:25:37 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wMgYh-0007C5-6q for qemu-devel@nongnu.org; Tue, 12 May 2026 02:25:36 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-43d734223e4so3146576f8f.0 for ; Mon, 11 May 2026 23:25:34 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4549120ec0asm29937331f8f.17.2026.05.11.23.25.32 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:25:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778567133; x=1779171933; 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; bh=HfbY1c3UCIy8gQxFWOZ/VIeIMJesFzcBvmUGEZHahNE=; b=Z9k3OsOzb5Hg4KRbohexQVjqyQ81LWYIBnD8ilCiAC0qJRgmv4LdUAgGGwWmR8nNuf 5CevgiHX/jBkp8lhBuUl3nCREXOv/4iBmKqnXqCe6L4JXSfxCmWVqZQAPsYdLDFvjOeL EaEQv5amy6PZRuI0N/ISdw6D3b+xooEXsWWe/nDg5FjgG7otYJyKuryqr3SUWtuy7gp7 tv7v2S1JTNrTn+4OvL8M9ApLrp/b5QiNznVUp5Bij1tuEhX8JgyDZgSSaYjXzNfYqZ4O DAkEHhmdaNgW1vrJcwYv68e9TsPcOk2x5e86PY97BmswONPFBVvRdHRHzQV/DRC3j2P5 m3tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778567133; x=1779171933; 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; bh=HfbY1c3UCIy8gQxFWOZ/VIeIMJesFzcBvmUGEZHahNE=; b=W0u21aR6kxqx4YKTHzBKohWo57Q/GOqL5qdReFXU5ErHXMeG18gm+aqf5IwBdDUl/r z6B9l0ibHckEM+IHv6cm3I4JCA++XwPAom7TGSoWx2J4jytk1a4c02Q0eINSfhtC8vIN N5ARw98I04m/DxG8zec4Niq/UEcl+FMs42N1eQNt07wHBj4TPB+NE9FWf960KTjA1WxC JpxpYsrg2BwQCAzpy1WM5viRsTSmWWpXA453xmGZf8/JnRd9M5AMJDsWrFx0caYVlJkB t9cs/kHodh2xPjHLzWS9jrUep8E7f/4SzY9p1pK9G9ddsBudNI2bQQ54cuBsJWUY+Qc+ QnUQ== X-Gm-Message-State: AOJu0YxL4INVF5MRbpiqhMp6sN+wMkN0uD62mVnqijEH/4ULunD4zgs3 7IMAphY+/UXNEk8NOaf7OV7tsescf7FH9JBCkKRNSgxpjPMyj+5kKscMsltwXAlR1yNoGzgqQNn ur33l0ps= X-Gm-Gg: Acq92OEmGaQ04fMmKVDuILqshlMKlKcEb+CfXZA43PVnVDJINdfFCgCjRgtsIz8lul2 0WrmIttJ048BhWWUpfeaD0GC1BcwzPEZ8dSAdO5uxf5ejEM1X0aaVYheWV7seAaWMAf2p90gCoO cEKyZE5E/tZgEKzZwQ0H6qAtTULiT7hndUr4rvmUlJa6uMMsanr1ewsXRuPq9zXmybos8UKVhPr 1OgYyaFYZhs9L+fnaKsA9VoeFULJzPwE8ksRf7GguzbLDS9X58jqwPTw9G74ZXAZMNBzj0n83yp fVYR6AqFzXvFc8Xz4P3fotwDQuGeI5UjvKD6eZUez540DkP9/vgazgRRRVg+R0vdetqyXUnqOas ystZIydLCCZCwZj89WqbL9/QzWObsdxueuuVmtJVIfGj7s2DNDCcexmvlmaVGRMf6lmfg+lbCuP NYa7Ta/j86C2E4IhEk2ASImmYn2p6ebvQC0c9MWdkiAvIrREWWZ7VocVq6EawlfLAONekG8V1g X-Received: by 2002:a05:6000:24c3:b0:455:51cf:9f92 with SMTP id ffacd0b85a97d-45ac4224ea5mr3317203f8f.18.1778567133150; Mon, 11 May 2026 23:25:33 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 32/41] monitor/hmp-cmds: Use cpu_translate_for_debug() Date: Tue, 12 May 2026 08:21:33 +0200 Message-ID: <20260512062142.67998-33-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.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: 1778567318839158500 From: Peter Maydell We want to remove the cpu_get_phys_addr_debug() function; update the HMP gva2gpa command implementation to use cpu_translate_for_debug() instead. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20260430093810.2762539-24-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- monitor/hmp-cmds.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index 88f9788bd9c..443b8c785dc 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -764,18 +764,17 @@ void hmp_gva2gpa(Monitor *mon, const QDict *qdict) { vaddr addr =3D qdict_get_int(qdict, "addr"); CPUState *cs =3D mon_get_cpu(mon); - hwaddr gpa; + TranslateForDebugResult tres; =20 if (!cs) { monitor_printf(mon, "No cpu\n"); return; } =20 - gpa =3D cpu_get_phys_addr_debug(cs, addr); - if (gpa =3D=3D -1) { + if (!cpu_translate_for_debug(cs, addr, &tres)) { monitor_printf(mon, "Unmapped\n"); } else { - monitor_printf(mon, "gpa: 0x%" HWADDR_PRIx "\n", gpa); + monitor_printf(mon, "gpa: 0x%" HWADDR_PRIx "\n", tres.physaddr); } } =20 --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567421; cv=none; d=zohomail.com; s=zohoarc; b=JYHCezjlIzqLEYjclsXDOEnFBpn7iRoFytz5zEkq+LEcR6zuwRmiyHGd6WySKTZNsFncwfHYK//6pZ6z8yDtEzz7tKcglSrmgm00AVniaZUyuQslTQao/l8xDz1b7fmSlwgj/pmKYvqBSeEWo3MBr5BOmidzSP2qreLI4H8bKW0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567421; 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=dKbUh8UPNvo4Yd3qJ+VE+MguhwOizfDZglByQHiHicY=; b=lV9lJZB6YFJfhBaWfyL1wzRbWtGgXIn5EZ5/1rGPe6dPGXEHViyHL5rvt+/qaRHa1EEZ0qJCCC5hr9hUCsiZczNIe3XvAJ2p+ZnJ1tundUhGqp1sRvWCOKjLv+05ApOwyrla+EYx7F437xYIiOhGCTG4pcAjkqM1yE5uNWIuC60= 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 1778567421469746.3826971687059; Mon, 11 May 2026 23:30:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgZV-0007rU-So; Tue, 12 May 2026 02:26:26 -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 1wMgYu-0007b0-7Q for qemu-devel@nongnu.org; Tue, 12 May 2026 02:25:54 -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 1wMgYq-0007Cp-8s for qemu-devel@nongnu.org; Tue, 12 May 2026 02:25:46 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-48d102471a4so50241095e9.2 for ; Mon, 11 May 2026 23:25:42 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-45491e94c0fsm31388259f8f.32.2026.05.11.23.25.38 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:25:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778567141; x=1779171941; 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; bh=dKbUh8UPNvo4Yd3qJ+VE+MguhwOizfDZglByQHiHicY=; b=Bxi6NF6uGPeZOF+Wpscik16xYyYsRkBrIs65S4Id9zMh4C3oWOEThal9A8k2ztruQC eCpEPyv1JrND+ushnQxrZl4hCIrBNTWxwR+s88wawfMJ2I0JFRR0mQmZIhw/LSAAeL2x YPJ8o9sgCwXAYbpTZCwLPVKek3HfwGqn6J7xFuDBvq7oZ+Y+M0UTUw81XMLZDFyaFMvN FIWNbVMdaRumDQpnYOqTKZibxUqKrPzWvO26jVVJ+wX+pTlo02ekMdfyLu1fnBSDlxI+ oIf5r6UEJUbI6QL4akc6vFkLOagei3KWPjRtJLg5XRIVMRt1h7C4ZDm99o5GYxeE0M9H a7VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778567141; x=1779171941; 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; bh=dKbUh8UPNvo4Yd3qJ+VE+MguhwOizfDZglByQHiHicY=; b=sG/2YuDjnl9iF6HeFrm4fuqjBk94MHMfOpEN/xjoBifF5pZCE2kiOD5zuAzvLKL242 0D1PGWUeqoCj3ZJLp6clxDuETKL7WtCT+mjb5mKLeG8P7x2VUCNAk9eWbDpC7Nbd791o MtzPu2Rm0j1KLeYXv8+SkVijJb1KCg8iVlcKs1dKhH/+0pJOKrLOfXhR3rBF7QxdInrv 7g0bqR7+DECKfF/mHnOfhxP8o4tBTE+u2Df7tqP7hOpndYMTXZJDZ/PyE+3RPONLG4P6 TRXARyP6Eyi70rMbl47uqjHOgWyllIA7U4gvh9TPL80DrZrxIlloQ7xDYUzF20BQe1ma OBJQ== X-Gm-Message-State: AOJu0YyggTIwEKUVSQMViVi5/XAV5xCglsO5BDi1L5/QHawmDsnoDTSF 5tBabLQRYvMvpnpOKq9qhc8TJwyZhPpFEd5kIvzC3gr5F/Kiv3tyjRePAgoU+iT/JpT6rilKFWU u9enhacQ= X-Gm-Gg: Acq92OEUoAxGWsd1UyDjRbOprkuP8mWMJRkT2pJ9g6tKN1SSZtO1Ei2izY1Fgw0DxKm cONCJSqqDTzEUdPcPNEvFawLW2bqdAi23D5J4lg450seCydir3pUC5T9CPRIG7GmmddZ4GeKia0 XWJd4LjZVSfMBOcENik0CQ19553LPbMnv95uEPX4gTlR66HIiJvszloT10EdWW+5zHJlJJ6g2zd n2i/N9MY+hqGYuKOSjnGr2xi2j3iPKCtdY/6tXsGuvim3acKwRaMACdqHVGbeUohSXIdGheLq0Z bfPzEwBg9R4Lq3CVMW3yLpwcQGvKJT4W221EJzNIWHXlS5o3oJACEUb6haxe2SUT/8nIemHxMvh W2FBE1QfoC6y2iQSlflfVUHRt/EpkZPthu2TzMsCA9eqHTi7cp011+Vq9vEyqSCJEvJdlgw51iD KEAyEt1mVh1x5o7oqbObXBsYJABkKTstn6aujdmEH2gKkZJVP8Vv05VGU5FTU3k/h/o6fn35Cj X-Received: by 2002:a05:600c:8b62:b0:47e:e2eb:bc22 with SMTP id 5b1f17b1804b1-48e6748afe8mr252407775e9.5.1778567141279; Mon, 11 May 2026 23:25:41 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 33/41] plugins/api.c: Use cpu_translate_for_debug() Date: Tue, 12 May 2026 08:21:34 +0200 Message-ID: <20260512062142.67998-34-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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=philmd@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: 1778567423393158500 From: Peter Maydell We want to remove the cpu_get_phys_addr_debug() function; update the plugin code to use cpu_translate_for_debug() instead. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-ID: <20260430093810.2762539-25-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- plugins/api.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/api.c b/plugins/api.c index c97cc688825..2d5fe9327f7 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -617,15 +617,15 @@ qemu_plugin_write_memory_hwaddr(hwaddr addr, GByteArr= ay *data) bool qemu_plugin_translate_vaddr(uint64_t vaddr, uint64_t *hwaddr) { #ifdef CONFIG_SOFTMMU + TranslateForDebugResult tres; + g_assert(current_cpu); =20 - uint64_t res =3D cpu_get_phys_addr_debug(current_cpu, vaddr); - - if (res =3D=3D (uint64_t)-1) { + if (!cpu_translate_for_debug(current_cpu, vaddr, &tres)) { return false; } =20 - *hwaddr =3D res; + *hwaddr =3D tres.physaddr; =20 return true; #else --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567201; cv=none; d=zohomail.com; s=zohoarc; b=j3Ue+jIkz42DSH0fSq1mHzAFA842RkO4EAcvXQ/iSRdcV96KkKU5wtlX4GsuBIoUW3hWYtaM22oo65j0KCibg3V6EIeKH2TVkN3U7nu32AfmtxUVl75xLogiVzpRfQcLukO6wReRamFG6CIOXSqbnuE0LtnzcCODAgJq0+LmEu0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567201; 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=C+xxVR8pXwXMffQeINHKMkFw5XP/nHWRIy9zl0uo9xU=; b=NFvUa+5ZYEoMEu7nwxJnuPY3rFl5Sk6td70fHjNuRVIi/Z4C0F69vzN9wIqwh+cgBhdHHMHP5i5jCF2Yc1J3Pk4tOm0N6JJyYxMmTrXGCwKz0tJs5Ov6QUfX5PzjH/2Poq35Nk1Zf0I71akoN6XfjnWzPUOoS31Zo6bNFHcCzFY= 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 1778567201576243.95529173248792; Mon, 11 May 2026 23:26:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgZc-0000Jc-R5; Tue, 12 May 2026 02:26:33 -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 1wMgZ1-0007bI-JO for qemu-devel@nongnu.org; Tue, 12 May 2026 02:26:04 -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 1wMgYx-0007MN-7I for qemu-devel@nongnu.org; Tue, 12 May 2026 02:25:53 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-48984d29fe3so54044595e9.0 for ; Mon, 11 May 2026 23:25:50 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48e908d2c0esm21086865e9.13.2026.05.11.23.25.47 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:25:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778567148; x=1779171948; 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; bh=C+xxVR8pXwXMffQeINHKMkFw5XP/nHWRIy9zl0uo9xU=; b=slVHwqsWUmj9THh/l39HZgO1WEjmOooggFSpFjGpJzrIE0GwTFP1OuKpmq2B3eGB5k rAkEw9329esXPxAbau/6DztjC7GygBZZndnZ3rbJ+JwBESqjglOgZCyYTvMcR1tATQpL lnMR9vx2GRHy1465KCj1Ht0VRj5+P4lfaR50Kf9MIpvZZZ2OGa3QM+ILWq1VlbNdTFcU Xj7PBcKkhXxJakTKDrfcWcjRJ6+e2DrtKdbjCijImJ9MAgomADb9VBhf/MsJrDX5xDSH 4OTLRpwbQBnWbu8CRLSDCtEzS9tAV889zv3+O03i8obMpWgAz7LAfBqhU7GJtP9qhnDJ IFew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778567148; x=1779171948; 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; bh=C+xxVR8pXwXMffQeINHKMkFw5XP/nHWRIy9zl0uo9xU=; b=kzlsAdHiwlkPx1swlHsuuWElC2zqf/HwKSpjxY2G742gWO1hMvUzvrJB1tPzwXprXi nn1ULy6Oc/Zl5ObBZDztKHHRjlpNu9xT6Vem+6ISkwTOZwEIs8c0qNwjHSbIhw9apz8x crbX5RbiI3r2RhTW0kwwyDGE3nhrdn+4l8EIE9iR7UMN/pQ7/POVdrr09szL3bpfKpBP 9Vc1g+QHeebVbjJMyrGa/181+/speHphhd1iq8tsJO82P6yBAO7aQM9R1RYIV4Qsvo+y 6EvUcFXMApD90BjtgYH20qPon+ChZ6m5b4Gifh2gKOptOK5QM2WK/yVQJKyPWyz0gn+i roYg== X-Gm-Message-State: AOJu0YwHPmNO3kgwiBYWgllQTva3xSk7/Q6Le5Sdo4UAeo22pOGjvEts I5uKskOMRjHBZw9xt5m0hH31Z1+cGUrLWu1u2ay2BCPfgagHJ+JcovvKMtNXxYdhyxdTaXdrqvh k13a4hF4= X-Gm-Gg: Acq92OG4oD0K8v7agubZ9ijnyEdMQx+MRte2f+4ksqbSOnB10EmO/N148INt6lBmTFQ X2DCE1RbaLBSU+c8wRU9NGLRS9MJD3LCbv3yjWAWGAcofL/o5ClpIDP39M+KdVlbPh1MishctX9 D5AE8I/AfxyGygH+MSPY8hVcCNNqUyDS82JYRHLmXVE53M1gqce8m7mFAa0Q2sQkLbX1q7efmdb pgNxBWpo0mgkt9/A4iKdyL8xkZtu4Z6d3z/huS8s69rDBBVh5DOnCYN7IZHEWvG0y/61B6korS/ qGGpLbFmK6QDdhOga3opPKkk2FOqWsk+g7hRFgn7MJZpm+EULOusU5jEGZ3Tk3Q5wF+p8xfqGKF yaSS3c9hBXXOCZtj6uZD61PxWWPPmb3vWEeqVaVqW5nPiBzvsn16aaS+dKMiCFd+bgObtbM6q/9 umcHUpw0SOP1YX8200N8I0d/p/B9EKJs87e2aAi30nxuPTefeNp8+e1erF2dUk+40Dt44l8lqU X-Received: by 2002:a05:600c:b99:b0:48a:7a10:4f17 with SMTP id 5b1f17b1804b1-48e8fe4b10amr19557615e9.6.1778567148262; Mon, 11 May 2026 23:25:48 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 34/41] Remove cpu_get_phys_addr_debug() and cpu_get_phys_addr_attrs_debug() Date: Tue, 12 May 2026 08:21:35 +0200 Message-ID: <20260512062142.67998-35-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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=philmd@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: 1778567202137158500 From: Peter Maydell All the callers of cpu_get_phys_addr_debug() and cpu_get_phys_addr_attrs_debug() have now been updated to use cpu_translate_for_debug(), so we can remove them. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20260430093810.2762539-26-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/core/cpu.h | 34 ---------------------------------- hw/core/cpu-system.c | 20 -------------------- 2 files changed, 54 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index a7256aeb9dc..59d601465b4 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -738,40 +738,6 @@ enum CPUDumpFlags { */ void cpu_dump_state(CPUState *cpu, FILE *f, int flags); =20 -/** - * cpu_get_phys_addr_attrs_debug: - * @cpu: The CPU to use for the virtual-to-physical translation - * @addr: The virtual address. - * @attrs: Updated on return with the memory transaction attributes to use - * for this access. - * - * Obtains the physical address corresponding to a virtual one, together - * with the corresponding memory transaction attributes to use for the acc= ess. - * Use it only for debugging because no protection checks are done. - * - * The address need not be page-aligned; the returned address will - * be the physical address corresponding to that virtual address. - * - * Returns: Corresponding physical page address or -1 if no page found. - */ -hwaddr cpu_get_phys_addr_attrs_debug(CPUState *cpu, vaddr addr, - MemTxAttrs *attrs); - -/** - * cpu_get_phys_addr_debug: - * @cpu: The CPU to use for the virtual-to-physical translation - * @addr: The virtual address. - * - * Obtains the physical address corresponding to a virtual one. - * Use it only for debugging because no protection checks are done. - * - * The address need not be page-aligned; the returned address will - * be the physical address corresponding to that virtual address. - * - * Returns: Corresponding physical address, or -1 if no page found. - */ -hwaddr cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr); - /** * TranslateForDebugResult: gives result of cpu_translate_for_debug() * diff --git a/hw/core/cpu-system.c b/hw/core/cpu-system.c index 954b81931d8..16f048c9565 100644 --- a/hw/core/cpu-system.c +++ b/hw/core/cpu-system.c @@ -87,26 +87,6 @@ bool cpu_translate_for_debug(CPUState *cpu, vaddr addr, } } =20 -hwaddr cpu_get_phys_addr_attrs_debug(CPUState *cpu, vaddr addr, - MemTxAttrs *attrs) -{ - TranslateForDebugResult result; - - if (!cpu_translate_for_debug(cpu, addr, &result)) { - return -1; - } - - *attrs =3D result.attrs; - return result.physaddr; -} - -hwaddr cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr) -{ - MemTxAttrs attrs =3D {}; - - return cpu_get_phys_addr_attrs_debug(cpu, addr, &attrs); -} - int cpu_asidx_from_attrs(CPUState *cpu, MemTxAttrs attrs) { int ret =3D 0; --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567320; cv=none; d=zohomail.com; s=zohoarc; b=NJs/dYc/zgfw5fCf6ewQDcSFuW2JRI5D8NhlATdj0GUYrluL6CN6PYpfv5jiUM454WtVHOJuQODkvUtIrdYLiECQ6fse52pykGODJ8ida6RY8T6LQ3rN++R7V/OMhFCydpaTT+DysLrSB0QaIdZTi2wtwM2/xB3/rewE0xq7HGI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567320; 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=p9Ko2u3O1LfqUME1hczQ+CYZalMxuJgnkK238faISOk=; b=nN37KjkbFS3MlRG6IfNu4nBtwO4N43CQWvH8/lUYAFhQ67COLegBTPAumSHTi5QbmoOWSXCS/2BVje5Dz4ALQ5dODDCt4YWbaTR8Lu+HCRR7Tjc6n2Z1gm/HcWdyz1qlxRL3Xtp/AbqnaCC5z1gBa/eAdHbxnQKXGt3XMWImZgk= 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 1778567320589982.182749482134; Mon, 11 May 2026 23:28:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgZh-0000ui-IU; Tue, 12 May 2026 02:26:38 -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 1wMgZ7-0007ca-4O for qemu-devel@nongnu.org; Tue, 12 May 2026 02:26:06 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wMgZ4-0007O5-3Z for qemu-devel@nongnu.org; Tue, 12 May 2026 02:26:00 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-48e82c23840so15275535e9.3 for ; Mon, 11 May 2026 23:25:56 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48e8f435a76sm11437075e9.21.2026.05.11.23.25.54 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:25:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778567155; x=1779171955; 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; bh=p9Ko2u3O1LfqUME1hczQ+CYZalMxuJgnkK238faISOk=; b=ICzDOjvNfCmUQDJK9udo3bi8L/hLwPDoq86DyXpWaAyF71idRGd9jobUfZjSClAe6k wGWHDk/9GRsNcLxvaYNd0DlvNLbJ36dVwh+oe5rAXQuDyVSfMqRnJP20X2f98GSYxacw sXVoSLXoZVmVTY6nKDej4BgBEVMmi7ACQ+GG4FqU2+rGTinzVWLXRwRCqDH0mNs0ezAs N7+f2k/0G+b9GzSdhC0qnnSMkuWzhHEOiiGtbKoZ4lZoIzOPFfF4ziT3Yk74Tw6q15qt pFfKBaX8PzF55G3/esvOdZ9DEiBawkU5wATAc84+bupS2PjBbb9IAMvWzjQOzjLOnZxM +HRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778567155; x=1779171955; 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; bh=p9Ko2u3O1LfqUME1hczQ+CYZalMxuJgnkK238faISOk=; b=jvDaCDlBCih/UUuc4wQYOtkVidC0uhj5F4RNQTqt99EqXtOantjP1hBX+tuV8EOixR Mt67WcCMk+59EwWrbUTj40UR47TwkJ7k6EOlBbjUq1l7m9t26uWP61xQ79lqf/6TOIbg G2XzJUtZDvqsWuy5k/TFJ03hzpBc0Pa3LsnDx+P1HFXD3ltHENR4Tg5rpej6qvu8ZaSZ MbDL5JQ4byli2mzMrlGiBHReyk1ywgxtEmnFUOxTvFqoysRtp74XTKt1sSv7L80HauVB +3U5uSokZ9SH7knLl+R+NCWRUQ+Ts5oxkuIWtQqJBCteG6UV+iU9llHzLjbKSCE4Mqdy TYqA== X-Gm-Message-State: AOJu0Yz6AmhLG6ow4xqdTcrtWus/HmGsfUI8QCRZPMFsjOA+cOftVzp1 LQqfr3xTMUNqus5GijN6xCHKdZ0DT3HGheFwqH0iRX5R8oDDZrhwAqowfvcKQPkMSChjfzlzui4 FjPeqwYM= X-Gm-Gg: Acq92OFVqQXs5QvN3VVqCoQcvAVY6y6vunvPKv2TZl0dyvRBki+FL0VNRzH2XOgj7VH tyqJTrpI1C178FbkjsMbXCjI4zRbj70oZKKBm+J4NOvPMBdeS3UcKBMaVa5tT2zasgPseCEFish 33dUWo6OLPVIGVO6j/tUhh9ZIMzjg5gOLUhGyoqJIVEThdAXZ+bCVkeRnBC5qBwHoqby3eC6WTk uKDpyjDYv1NSrUiXOdX6nIikmcKAglr7UXz07EHb4roF651zh4P4XM3DGaGVZGBQIzgOdaWg2ly oEdHzSrrr0BSU6ibJlRJ8Cbuoj9hrU3XMoVO2YADBo9ilyL4gaLq+mOLGNLOidJa3BZryOI2T6/ FVWBqSGs5tXs4yCMSl1L2k3Y99p7KS72ZkONSTjmRPI5M6s5+iHeoBLL7qV9WykgPBSN0ydesKz CkY2uOUScCR3XJiVc+NWj/1xJgVdlR1oZdWkjXKorLEsqwxGHxHwIrajHHnkURzkgSOqZsLkcBG kQIqAkagv0= X-Received: by 2002:a05:600c:1f85:b0:489:1f08:91b with SMTP id 5b1f17b1804b1-48e8fe71bfemr21533615e9.16.1778567154949; Mon, 11 May 2026 23:25:54 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 35/41] hw/i2c/microbit_i2c: Don't index off end of twi_read_sequence[] Date: Tue, 12 May 2026 08:21:36 +0200 Message-ID: <20260512062142.67998-36-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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: 1778567321710154100 From: Peter Maydell If the guest tries to read more bytes from our fake stub I2C device than we have provided, we incorrectly read one byte beyond the end of this array. Avoid this, and instead keep reporting the RXD register as containing the last byte of the "data transfer". Cc: qemu-stable@nongnu.org Fixes: 9d68bf564ec ("arm: Stub out NRF51 TWI magnetometer/accelerometer det= ection") Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3408 Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20260501162634.4092394-1-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/i2c/microbit_i2c.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/i2c/microbit_i2c.c b/hw/i2c/microbit_i2c.c index 2291d6370e2..d9689b6f1ae 100644 --- a/hw/i2c/microbit_i2c.c +++ b/hw/i2c/microbit_i2c.c @@ -41,8 +41,13 @@ static uint64_t microbit_i2c_read(void *opaque, hwaddr a= ddr, unsigned int size) data =3D 0x01; break; case NRF51_TWI_REG_RXD: + /* + * Return the next byte from our fake data sequence. If + * the guest keeps reading the register after that, keep + * returning the same last byte value. + */ data =3D twi_read_sequence[s->read_idx]; - if (s->read_idx < G_N_ELEMENTS(twi_read_sequence)) { + if (s->read_idx + 1 < G_N_ELEMENTS(twi_read_sequence)) { s->read_idx++; } break; --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567358; cv=none; d=zohomail.com; s=zohoarc; b=Sj5CNKgvPZmUntKl9tz22SAUUJORrePcw4ga6f2A1PWx+A6MZyjkHiAn1If1Dk8AgvU6SQ4vtaw0TB12c72pVyF6H9pweOK3/Si79IiGhorRHUizAXP8hQ2PPgBMLZkvyFPwqITzA2mCZujWVxOt6sTDoAXWkKw8y+e3OY1zFpg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567358; 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=KTZoDqLkEaJpfPJBDyKt3ZmMMJNtjsP8cC3diZptPv0=; b=UM9BvIzCSW7vidULnPbGduuJtAaqi0ncpfBhFZBqgqS7CCfzt3VjognOm5JxYmzHY2MznIrAaSTHeYRpoasVGTOm0CYC9zEEk82Crexo62UmRZ2eccR5No5yic3xMA3aoBL+IqizUpcslA8xnHKOD9moM6gPYYxZg41+YtUgnjc= 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 1778567358186684.7430574586291; Mon, 11 May 2026 23:29:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgZg-0000hr-2h; Tue, 12 May 2026 02:26:36 -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 1wMgZB-0007g0-8l for qemu-devel@nongnu.org; Tue, 12 May 2026 02:26:08 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wMgZ9-0007Qu-Cl for qemu-devel@nongnu.org; Tue, 12 May 2026 02:26:04 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-43d75312379so3860062f8f.1 for ; Mon, 11 May 2026 23:26:02 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4548ec6b00fsm33352813f8f.11.2026.05.11.23.26.00 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:26:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778567161; x=1779171961; 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; bh=KTZoDqLkEaJpfPJBDyKt3ZmMMJNtjsP8cC3diZptPv0=; b=F+RR2BbT4CKJHnnuJZPmZKNU+YMvSuy51fPQpaLrW92lzJm/veqoArpqz/FZDXkGuq 9lwtbZRgUgWIyp6VOl4huQ3eiF79gIoI50JW0z1Srk932ybqDvHaqobPJxXm9h3nJkhe ur0yHw6VxidOqe62TIz2bis18Nc0eiM8hXBIMVWjW0lNNuzv8RXUzE86bzz0sjdJ0/IB sG2HQk+K0GgfZOpj7Tr0L/zmNfx35g6nt/IN4MirelZFDDy0hUv41hcM4+WPvZrjgirI DmCFcW32dY5WMP5dzbNLkKZHZXHn0IYFYTp2xKZ+wjNqbbv48SAD1b4Jp5aU9DxA+jFW ktnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778567161; x=1779171961; 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; bh=KTZoDqLkEaJpfPJBDyKt3ZmMMJNtjsP8cC3diZptPv0=; b=gTV1XjaKWe+Icc7mqAujB0c0RaLtjqYrTUmr35D9zHESvpnZ/f4n6nhfu8YCrAb+8T 3tQNmu3JXTxD46L+NEKMwIF3KTPfSYCuwS/9397i6cJML4D9np3f0/OkykN4JcyWn/RM L0VAvXf0GZVeNrI6sLqmxz1Dgvppf+Be9x4OsJc+DdSEHJVHjTfy1gkcWlnIZiBIITCr vwMpJ4qk/3k4OqRdRrWNOCHAyE0ViLdd8gmpCLUI8eimG6vLN/4tYo8UTX5uTDxbp2Jy yNA9KQmOYasOGXMnRrcJCLQUMbA5dENIOAHia+W1tkHTBn9pssdc5fILV7vL6IDoh+6Z pEYA== X-Gm-Message-State: AOJu0YxdrcmxW8joW+01AOQEVJH9FBc95vL0pzPyiRwv52BI12VE1gXB DVGe7aOVYU0pZIRAFijNDA/BIKq1Q2zdVRz8velsH2HStyggX4WbF6tvLcFB4ZTkF9MpO5LXrNj KaTMg1cI= X-Gm-Gg: Acq92OFCMvrsjqPyxcSqGcGqAONNGJDzv+P8yTQ80bjOKIEVyWeSMWv1ptHsutnOHvB m0Z6F6dUt9ft3uqa/+Ds9/ixJ8jQ6p/T7JRhGVCDhRJ3BQ4XvniBygCkFeOaBC9lfRkyh0cNGDK 1dIGdmg/UqA0jhVmrR4WPJJTwWlgwSawuiRlYh5Gw1NyOgmwG2Qm2XcuqlXwhFjcN8CwF7fyaFv 0lmmbm3VVASEMsH/02NOq3CeucbkE/umrW6j3+CArtwCvjw7W4W0x3LJvGG8G1LOTKrEOmDTy/N Fs5gLC0nTspVFfCd4lnJuUYphMuCuVLL+Sh7AXNcutZRflvu27nu742Oc0vFUGf/6i4Sglbyinn z1CkHPqqgMaiEQXVM7bUjMOcqSBIXhxGkG1i2txS/PqRs3Binu8EAhnJYejccaaHPnhIp9Dff9M McLTenl6BxWcvnUuzhrhOOKwaAC/k5BZbPxd9uCoxtIRZZNmHXM4rbvbCCkUv2zGBzuZ6K9OE6 X-Received: by 2002:a5d:457b:0:b0:453:9897:76aa with SMTP id ffacd0b85a97d-45ac32bc5ebmr2261296f8f.21.1778567161486; Mon, 11 May 2026 23:26:01 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 36/41] hw/gpio/pca9552: fix state_str leak in pca955x_set_led Date: Tue, 12 May 2026 08:21:37 +0200 Message-ID: <20260512062142.67998-37-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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::435; envelope-from=philmd@linaro.org; helo=mail-wr1-x435.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: 1778567358962158500 From: Marc-Andr=C3=A9 Lureau visit_type_str() allocates state_str, but the function never frees it on any code path. Use g_autofree to ensure it is freed on return. Fixes: a90d8f84674d ("misc/pca9552: Add qom set and get") Reviewed-by: Glenn Miles Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Marc-Andr=C3=A9 Lureau Message-ID: <20260504-qom-tests-v2-35-ef7e3dc94f7a@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/gpio/pca9552.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/gpio/pca9552.c b/hw/gpio/pca9552.c index dd3f1536b65..472d8ad9571 100644 --- a/hw/gpio/pca9552.c +++ b/hw/gpio/pca9552.c @@ -342,7 +342,7 @@ static void pca955x_set_led(Object *obj, Visitor *v, co= nst char *name, PCA955xState *s =3D PCA955X(obj); int led, rc, reg, val; uint8_t state; - char *state_str; + g_autofree char *state_str =3D NULL; =20 if (!visit_type_str(v, name, &state_str, errp)) { return; --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567360; cv=none; d=zohomail.com; s=zohoarc; b=JjXQP9PS+wPsbrUfsiAE+6tW33yXJZGXU/SEmzLDolEl+VLhiRgOzybjcgCCIzrULxvQYdkyuNFzhcN6PRLoNNDbsfdcnsioxRbGgvmWY6jMkjxDlajcJQEAFgWA52c+hdFxk3mbOI7z27zJnVuLE0KSsh+goCFghF16YDBma6Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567360; 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=GBwY68KBHjdUL+kWpOv25D8sxw9nSd20K5nVKVPHL7Q=; b=mUxE/afD1sG9FGYs0I1BLtXeDm6QMA66AdTfAJ7qVd3O1xJHnRlNF6D1qBUkPM7JM2UKjxD7O606o79tfVyI0qR1al2UXujd2x7ToVNyPcSzzlLVdHI12zIuK83dKX20pR3YM0Ii2ZpgGRH1MJ4KxJBngOZ19nQifH6e5+RCtnU= 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 1778567360296512.6917604723839; Mon, 11 May 2026 23:29:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgZp-00013s-1I; Tue, 12 May 2026 02:26:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wMgZI-0007my-7e for qemu-devel@nongnu.org; Tue, 12 May 2026 02:26:21 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wMgZG-0007Yr-O8 for qemu-devel@nongnu.org; Tue, 12 May 2026 02:26:11 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-488a8ca4aadso46688275e9.3 for ; Mon, 11 May 2026 23:26:10 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48e8f447166sm10221975e9.30.2026.05.11.23.26.07 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:26:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778567169; x=1779171969; 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; bh=GBwY68KBHjdUL+kWpOv25D8sxw9nSd20K5nVKVPHL7Q=; b=mK/W2JlRNPblFkQYd1AUUvRbm8swokFCs/1wgUHIPxRiRa8WJGVUd/9E6JIE/vrqoM 0jnriUI09X8WqFUXGyFZaBMaT0ZSop6EzTw0WXcmmULaPPSTxuVPcw9oAdv20u97mDrN e7xb216w7BkUp6ZQoGZNCjs3U4e6JT3jpw7AJeeITJefsbESJNMDy6Bsy/a3TUVUJDTV 9MiZAvpjIyTHbtXJe/rIhqQg0eFHEJiPhOfyocf/ELn97H0LdjI+MgOoq1t6NTyGNKjD FoGl0dRtRzV909vvdRVwa9MKepV/VMre0C0N1DGynT8sLV9Lp37sAJDlG0xP3lmaOPJF kltA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778567169; x=1779171969; 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; bh=GBwY68KBHjdUL+kWpOv25D8sxw9nSd20K5nVKVPHL7Q=; b=dD0mDIE13YcC49qLUavkbNFimRUWvZMqiiBauhOELjZqZ0PIzL4UDQIG5a3JSp3iTH TfA6015eTQK5U83dMN0D/VrwJFl1g3ztbMgByGgBajSo2ouiDyjjRqVRHO0hODaV3aE0 cdUMXdo0miE/H22yHvO6pmtiyQdsDvVCTmkI4Xcgu8mMi7tOBmKHR5V5rv/vPUZZePMu hbbUsW+uquO6WxmokOQ49X2t+kyIfWeg33fYPQwb8acE14Qst+PhZOCmUYrKVFuatiUk 4h1QR7aK8Z8uvOwygEbWZ4qdvOOOWjpX6azCVdYBS9fjB4nP0B+8zELDyyF86cpjXJ1r 5lgA== X-Gm-Message-State: AOJu0YxUf8N0VzYEAy2W2f1noJXHzrVy/z/FQ0eL8hd9CrnOWyKYisDd UVPYKrbp55iwtUQaom7nii0BmOPsbkb2fTUH+FCGZg/dGSfCT4tVs3fr8Pnkt3hFiv/Z/tmIeeE t4WeR8ew= X-Gm-Gg: Acq92OHXHn3tKZFyZmjeKngOWe6gAUbF7OY3BCtvNl9wkjkkqnUKokRKTyyTKk01pmg ytoRRKDVOtTDpGO051NmNZ29aEp7u1A9tynW+ZcdGln7i8JgUDy1xBRO3+pQe9GxvL2VeNm+eMb yipnBXoAo5LrtnK8esZrbUa9Nbj2EjFAXOmhFnr2qwMOAW/TD7Bp6ayAdmlKOzwbJ60kSUxzjZi 8NrnRC2kLtSex9jt/W543XlWCUsRkGbOpBpmlyKj88BEezJegZ2Yn5NUlvOg+wjkWcs3vL163od KhXgj4sjQqRCPlHkUBZlSwI7oNr1BtR1WqGCpad0UK8t6C0WZe4BiRt5NFUxkVmUmXHBIHj3KSv ZY0Qx3ghuRbPAdjB2ApmnLTtVV6N3nRDV7fqI/mlT4IY5DuCNgn4EOUk1Ets/0hDaiiWAphfW0k 3a3DH9qtO7eDvbZgnH5Q216hFue7FGeZ9PonCR3k929APD+Gx5vDlwtbX49uRz0yJ5S5FiibXf X-Received: by 2002:a05:600c:3b0f:b0:48a:7965:b943 with SMTP id 5b1f17b1804b1-48e51f4e9admr437975765e9.29.1778567168760; Mon, 11 May 2026 23:26:08 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 37/41] net: mark struct ip6_header as QEMU_PACKED Date: Tue, 12 May 2026 08:21:38 +0200 Message-ID: <20260512062142.67998-38-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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: 1778567360957158500 From: Peter Maydell The ip6_header is often used by network devices to examine structures in packet data, and it's not guaranteed to be aligned. This manifests as errors from the clang sanitizer like this one: SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../../hw/net/rocker= /rocker_of_dpa.c:321:37 ../../hw/net/rocker/rocker_of_dpa.c:730:33: runtime error: member access wi= thin misaligned address 0x742970fe7ecd for type 'struct ip6_header', which = requires 4 byte alignment 0x742970fe7ecd: note: pointer points here 00 00 02 81 00 60 00 00 00 00 38 3a ff fe 80 00 00 00 00 00 00 00 00 00= 00 00 00 00 02 ff 02 00 ^ Fix this by marking the ip6_header struct as QEMU_PACKED, the way we have done to handle similar problems involving tcp_header, ip_header, etc. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier Message-ID: <20260505201324.932323-1-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/net/eth.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/net/eth.h b/include/net/eth.h index efe270dbfe7..46dc9ed5acd 100644 --- a/include/net/eth.h +++ b/include/net/eth.h @@ -119,7 +119,7 @@ struct ip6_header { } ip6_ctlun; struct in6_address ip6_src; /* source address */ struct in6_address ip6_dst; /* destination address */ -}; +} QEMU_PACKED; =20 typedef struct ip6_pseudo_header { struct in6_address ip6_src; --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567323; cv=none; d=zohomail.com; s=zohoarc; b=MEykT1B/YkEGu5sRUymo5XyqvKmKAObT0BySnLPLqfXLiXHpDBgYEepN1pf5LefNLAHUT8OzYzwFzbtWqngLwXoYVt2jZIjgrSxMn3VGqd6nyEhsZAu91eFzYKyryGh+Eqk27h2clxp5iYbwpcQkxKM9OiBv41NnnHEZ50Hk7rw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567323; 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=YEwsHCgWEkYua89nPUV5fuOYHoZwg1lrZGYXkIuVzmM=; b=ZKlmGXC12f/0iZgghisqsQWv0mbQCNGrB/qydf1wzzAu2T5v16ZgHFSzu+jP8i/PgN0v+e4XkPru+vVfPOTsrGdBegTy7BoEwURDU1h/V+9U1T4Z8Km+iJrYVi+nGdmCuvtvUwOGv0wkpXvovvt4a2Dg0jaA4bu9IhWSkFmwiC8= 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 1778567323643269.1181505651624; Mon, 11 May 2026 23:28:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgZY-0008Ae-JB; Tue, 12 May 2026 02:26:28 -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 1wMgZT-0007pO-ND for qemu-devel@nongnu.org; Tue, 12 May 2026 02:26:25 -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 1wMgZP-0007ec-2B for qemu-devel@nongnu.org; Tue, 12 May 2026 02:26:22 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-44a74032ff8so3769175f8f.1 for ; Mon, 11 May 2026 23:26:16 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4548e6a6a64sm31706729f8f.6.2026.05.11.23.26.14 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:26:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778567175; x=1779171975; 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; bh=YEwsHCgWEkYua89nPUV5fuOYHoZwg1lrZGYXkIuVzmM=; b=aJmGM2pqKi1uHjxH9onuHmfYs/0Sc/JTwcWz5SxqTv94RGZhg/bOtoBChAYkYd+p4J kuTzMz01gUn/KAePvdxFqzQxwt1kq8VBk9tMdtS3B8CoP4oPge5bAzHmnQyHXLEgAN7r E8MHFMB88Lfg06ijFomzvdCsaZckTL18iZS7rWdzMz0S6GQnEM30hEardcaPN4AMad5S CcxGXFwBgQ+4ZcFSiIhnvzYrS1pAiGO5tl3VULKA+vPKVxl1OczPw5X2ym85iVLsUSnc +NT1hz+EUU1KIb3+4kbT9QV4bkeYi8Bo/ZA/E/IRWcArzh+SETJi+ipwx9+Jnrg2c5HR ee8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778567175; x=1779171975; 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; bh=YEwsHCgWEkYua89nPUV5fuOYHoZwg1lrZGYXkIuVzmM=; b=IEXNiPwxYblkjYszKOv/h/2EKaGh6+ukKJctEunNWJaCL8IAr0tlFV1uVie46Pg/k/ sPJa104pW/a0OfJDnbRhbpHcU4669QS9ijBmwT/ZNLtQqqDrSv7YatFKnbVzanHgKzbf fXsKKXI5VN6axG4iUBngOiW9hifVlPOSzTzd/XU1OS957sgxhO/r5fnNmUP+SKXkm1HK 4emTBepzcuoJemF+OBclBjVqQ79AwgDiN4gzD92ZnN1B0aNVlb/R1RFCZudpXyJpUKnQ YuJZ540ZB35xfb896huPBwBHb11f8Ma2koBSkBwexzX1sRkwA5mUsw/LrKTuiMusKqFn 9CIg== X-Gm-Message-State: AOJu0Yw22GYoY31eIKUhQb31OlUo2f4tSjH3GWgjbmJVQyfQcsGvww5R OsK5OhXYujcnsY4MgO6jCo4oDtS0LH/x2IjQiU94z+nMlzuvQKtKx1LnYLWepCeaYQNz785KrRf Rrx1yjdE= X-Gm-Gg: Acq92OEsspScNA2V3xu95xUyd9T+wYdFRvOILuhr0WvII/5t1Oxo2z+Esw0ssFr/FIW RqJr1SrtysFhnhh064B4OoTG+scAjsFcMUFXX62qkPrY+SvfMl2Ch87g35Rm8tUJJ3t1Q5VXkiJ 5m5nY5Jk/i5vS9JwLy1BarvRotYLQ88sSi45HlY16ezwuF2yu/7t2/TGq0PcMNfJFWfQCoduEup 0iQffaORhYOq30OfnY7RFcA+XFSKumlIeMOK28m/MY5PZsmkbj09ZFQsZc3mw1Zd/9lPZZ95Nco iiBopHMbKJNeXtDZ55/aJXLAdCOZbf4FLMEwuH/5PjsGMQEaQ/bOdEQKYLKSboZQAuetwEYRcKP o28Zj3gaUsmrXjRLiGYt686P3aDY+xoBQRr0K5Ao0w3Jp0URZrvP5jtK2X0XzRmYhEvEmdUm2YE qs58+MZ0HR+6f4UCv0qUOlDk9Q8gmozpYhW8ky7ielG4T9aYMLus1hmmvFAHzNzMHZ4mWjZucI X-Received: by 2002:a05:6000:1a8f:b0:43b:9c73:2933 with SMTP id ffacd0b85a97d-4515b525503mr42182901f8f.15.1778567175292; Mon, 11 May 2026 23:26:15 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 38/41] =?UTF-8?q?MAINTAINERS:=20Add=20Doru=20Bl=C3=A2nzeanu?= =?UTF-8?q?=20as=20MSHV=20reviewer?= Date: Tue, 12 May 2026 08:21:39 +0200 Message-ID: <20260512062142.67998-39-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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::431; envelope-from=philmd@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: 1778567324774158500 From: Magnus Kulke Signed-off-by: Magnus Kulke Reviewed-by: Doru Bl=C3=A2nzeanu Message-ID: <20260506102156.501805-1-magnuskulke@linux.microsoft.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 488d194a41e..e5d58d58646 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -596,6 +596,7 @@ F: docs/system/whpx.rst MSHV M: Magnus Kulke R: Wei Liu +R: Doru Bl=C3=A2nzeanu S: Supported F: accel/mshv/ F: include/system/mshv.h @@ -611,6 +612,7 @@ F: include/system/nitro-accel.h X86 MSHV CPUs M: Magnus Kulke R: Wei Liu +R: Doru Bl=C3=A2nzeanu S: Supported F: target/i386/mshv/ =20 --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567222; cv=none; d=zohomail.com; s=zohoarc; b=ZVj4QexQ8/DJuTqfcTB+L+rC6Ge9w863nkXM6wGsUIOWCeuA9jC+lf3Qt7nsdlvXEbKjPa2ii//I9zv/B1Qt2aT+NSZTYEvNCgJGVZVXpeE5RAt+TzgcFq22K334d2YXl65JES4gtWq7DRSa2MkptpPn542c3KMJmfOBhdf2od4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567222; 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=XA6XU+mWL7el+eRZO54pQpgH1NRB+GKgyK982sGAvAk=; b=ks3GLuBt1Mi5RVQzyja5RAMLPDWuRElEWXTESv8GLSGgIPWyTbFnqud3a/KlmnJIBa6tA0OXbf2ivFPKEIXAsLsB3cvhEnnCfM1Z6Fm8lbAn827Idw7lawlsoe6mb5VIArPH4pkcLSMs202HV8HI1osi7KZxm/XuZYgEPKGbj08= 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 1778567222877468.54887554578147; Mon, 11 May 2026 23:27:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgZY-0008Bx-Q8; Tue, 12 May 2026 02:26:29 -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 1wMgZV-0007sT-H9 for qemu-devel@nongnu.org; Tue, 12 May 2026 02:26:25 -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 1wMgZT-0007fG-Tj for qemu-devel@nongnu.org; Tue, 12 May 2026 02:26:25 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-488b0046078so42222825e9.1 for ; Mon, 11 May 2026 23:26:23 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48e908d2c77sm23730785e9.12.2026.05.11.23.26.21 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:26:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778567182; x=1779171982; 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; bh=XA6XU+mWL7el+eRZO54pQpgH1NRB+GKgyK982sGAvAk=; b=cHqUbN36VzdQ60PMXASTUE0EjVmeLf6L44IFJDi+vky2YQnAghCu0QzP9IRxiMwOhi 7CY4ikWnNVoH2ag7eBtm1lXgvsfHASQxeQj6fYZWu180DqBe0+5XO994Jw6c1S9rt4SX K0tGgTbbE/x9wuxPDBowlWNgjNU1FuGzIVDr7HEHk8dwMV5WelQnSq/oWjaevf03WvFu 9bqiOMbZll2d2WTcC2rTv0Ugm/XFCE4guvYfTX6gdByLus6seaEy1a3ueC5oVDT7LoHN 6ur2IDiEfSbbpMwbw8pjjP9eJk/K+I5E0jv4GuIjgoRdXWUV4DCOdgRsDF00L8yRMOpy fOVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778567182; x=1779171982; 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; bh=XA6XU+mWL7el+eRZO54pQpgH1NRB+GKgyK982sGAvAk=; b=j15LQNP2MdZ3UbbIGw44YznRL+3qk4ZNPUg8Nw01N5hdXhqCMtWFVlWN0lbEGfuV2b NT2Du/iSbZ+2vIHEo48e7Q1FGJmqv2gMTaS4KQFf/zRj5uzqyopjHWW8OeS1ZbPM0/9H 0N3ZhqyzyxT7XjS+wDCdsdx6S9E+6KqO+y9R5hWgCb56RbheuU5+NaAGqyubAtp4bg8f jI2fFvVachnhReIFV8SkBA09sFxn9Vbz/VKsKPvqIYFkmNHx362SISJF03gM3aB+A0fI SGUGYA2B8HpIwc5oc7/Ked9J7djJq05L7LKxU1FWnr6O3NOH2QNR/USgf32xGzEyaut0 3OCg== X-Gm-Message-State: AOJu0YyoYfNBdMuFyJZyj6A5R6xUy9XAbei3e0DL9L1Etxo6qF+Ce61Q JIsqNd7dlmGRutj7FqyrvaDHz/b4/7pqR2pGKK1Aiwt64SoDPGnwIUmW4AaIFh90fWvdv6QWyFS +/n+zRMI= X-Gm-Gg: Acq92OG5SlMGYlVsxsZEBYLFT2wJ5Bkm9XfbLmchhir5QDhhGxocyTIWNooHS7cmOjH UWFXuULhyQ1iHML5xZTacZBMLLYhDVajPHDrejPHnfZn0vtBVvTNaojtg8etLmLp8v9GRDPeGuK uWPXQdBcXoCQuXZs8LWiCf2JDdrnGGrU5g7Yp1RhQeRyygmfDNKI/Gpbw8RQcwKL15uC+/8b0HZ r/MI94ElSeoWcncvkhDtO3Bibil+K1Ka8RgdN7/DGDZSKFeLTfZS6Ha1ES/EmT3bWUE0oJE6by/ QXjculbgv9FJgxmlnU3raXszZV7SxgwFhIhb7KhE1xphRUdIwvJkLC8O/mXalVW00IUazmY+tj6 v8qJSBsPwkC51dBm4sanfCrAMa1+ZED42Lvahn/8BYJNoxHjtzGrXMlL36b9nQPJFbieOjDG0VS ycfylUdsVUrijSXiO6PajrVLcmG7PxOLXADZOrs0zuIPAnnmWXNJ8rIVkR2CVF1g32AVBDcWxl X-Received: by 2002:a05:600c:628b:b0:48a:557e:6b4f with SMTP id 5b1f17b1804b1-48e706cd77dmr214216525e9.23.1778567181857; Mon, 11 May 2026 23:26:21 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 39/41] MAINTAINERS: update HEST maintainership entries Date: Tue, 12 May 2026 08:21:40 +0200 Message-ID: <20260512062142.67998-40-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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=philmd@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: 1778567223959154100 From: Mauro Carvalho Chehab Mark HEST code as maintained and assign them to me. While here, add a "L" entry to EDAC ML as RAS discussions usually happen there. Signed-off-by: Mauro Carvalho Chehab Acked-by: Markus Armbruster Message-ID: <6316f5b788cdc6b63e808606649dc5862271b22e.1778075257.git.mcheha= b+huawei@kernel.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- MAINTAINERS | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index e5d58d58646..0790d13505c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2236,14 +2236,17 @@ F: tests/functional/x86_64/test_acpi_bits.py F: docs/devel/testing/acpi-bits.rst =20 ACPI/HEST/GHES +M: Mauro Carvalho Chehab +L: linux-edac@vger.kernel.org L: qemu-arm@nongnu.org -S: Orphan +S: Maintained F: hw/acpi/ghes.c F: include/hw/acpi/ghes.h F: docs/specs/acpi_hest_ghes.rst =20 ACPI/HEST/GHES/ARM processor CPER -R: Mauro Carvalho Chehab +M: Mauro Carvalho Chehab +L: linux-edac@vger.kernel.org S: Maintained F: hw/arm/ghes_cper.c F: hw/acpi/ghes_cper_stub.c --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567421; cv=none; d=zohomail.com; s=zohoarc; b=Duy6nrL8W7XTbTpnqEx2Xb5cev4m9pdk8rZyhrBEHxRsdkM9+Ll5DXEr5IfRXyTmx8AK7KWJno7C2H0ZSiUH6t+JQ0mK6Z1wg+8gNutI6Owq7nMBw2jB+xvkit9tMVCD1fgXSHcKD8qhJliGtC6ReyTEN0DpQfl4FeqdNclg7Ws= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567421; 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=Z97yc5ej7ciCg7EXR/9lOGcsIIseUEUiyXY4n4ob4ck=; b=TPQhxFdxjF/5mq2g++0WJqslMnaokEHojDK64qPJDF4PlcFi5LfqxVKOhrpwRMIGdyneLS1dBdYoa2195tf8w+XmpKMmm2tiFlEGjU8QF6SsU6l3+OejLgxAK/Ssmesjt/o4CWqAAc1a5DLLpLRl1Ct9U3CCCya076uwYtBD89I= 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 1778567421106629.7896485018781; Mon, 11 May 2026 23:30:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgaF-0001dI-GM; Tue, 12 May 2026 02:27:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wMgZc-0000QH-OE for qemu-devel@nongnu.org; Tue, 12 May 2026 02:26:33 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wMgZa-0007oW-IT for qemu-devel@nongnu.org; Tue, 12 May 2026 02:26:32 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-488a14c31eeso35010975e9.0 for ; Mon, 11 May 2026 23:26:30 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48e8e62a2desm12281745e9.9.2026.05.11.23.26.27 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:26:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778567189; x=1779171989; 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; bh=Z97yc5ej7ciCg7EXR/9lOGcsIIseUEUiyXY4n4ob4ck=; b=nKP69l+Zz6WbuW1PiostDNoE2Inp3np/YH3tCjEEleriaq89frRo3xMRtb/rjnBSJm PLrYSJpwKYO4ky5hNIKlbne6Mb2ExZ+LVDHW8bLHQcWJrTaE4SgyzjLJcdoV+ZHZmZH/ lNZnRh7XhvOMzZ0TDdlaxxVIK/FJ3CNzGnrcHV1xKtRJHBqViVwmBlNejIV2/QohQflg xIudUOnLAcmpIRFH9JRBanKK10Nyi1vTAvJpHrIFY0Yc5pG4SeQUph+Fg1EareTRQ1GF 3pa40w8xQhpep9CuIZAgNsI76tAwVOcmuAe5yq7b/PwJ66TLYEB9Z5y5/LKHnG2GB1EO tfSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778567189; x=1779171989; 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; bh=Z97yc5ej7ciCg7EXR/9lOGcsIIseUEUiyXY4n4ob4ck=; b=DZeIxg6GmRKsvjaaa56htnLHFSu39ZdCYzoqbTg89lrUgT+0me4s8mZovSQ6Ry2+EE 26U/CKoq9joKBND7l+G1VjC+Ez1NYdhN+yr4uhojhtrjiplMIAU039GB0E66oIcMHMiY G7BmGGo4LbFnIgm2rfhbLkrDR7t4qc/B8jtmY7gQ3o0wHhFYqsPEK7Geol449GZfJLYG xt1zqVPbbq9SX1gmzQhT6P4OxsVfPKj+3jJnbnrHXSRA9fwykiprMcxChDheE7u4jUjF CqDBHSTOuGYaFt3Q82kPitvuNmS4Ov3/a9XczDB+5YPiLfarvodOXs+laWPBBemF7mxv xg3Q== X-Gm-Message-State: AOJu0Yy8NZ7bu2eYBpyeONMOD/1DU29WmSz/E587ncuNQSfPAup6pY5+ LIX3abdomkX7aA1ooq2M2i58jbqfsguHLhHUY2wz+zMfis17HYxH7c//RP0qaqw1RjUPc8+l0c6 nsJzeLqc= X-Gm-Gg: Acq92OEmSFSusi320vPF8vuNXrNswCpcDzSoshZil8Ab57btI1OU8Gty1gpwyVaLjnj h85+rHES3sljNvp7NCUzLn4MSoIKbmkaXiwquoorUxuiDzGx9YDs6nErcLgY/htxUTKIvHzqdTk g95wXS1/znSygfO6RMODlmdi6ibkTjte1V5o+nQREuw/CNqMo872lPLDkESQoT4qn2SWo+cwvni vPuPlFrWI0v2zciVz6pxv4Bi/ixjjaKav/hLlXByhG6HR+axIuuTECcRDt3vrDQj4MVsF6t19RG 2fZxXW3HAUWH8AqFaZNzvZRk0OuH+oShemUpndZCFULW9kPJmlqxyg3zf9s4b+sW52kmXUgyaPu TOT5fVXveYygXbukXeRGvqsFpTi2KZ2mFR+iKaNY/RrykgMHcOSo0KqmlnKmK/uELnExVmZ4rze lQnLipIppp8cZ4sSNKM5ZoJMJeab5Nk0nvU5W+DgRiojYc6uTZgEo9yAKPagOuJ7TQAdB4q12qc NlBdrhe1aQ= X-Received: by 2002:a05:600c:8904:b0:488:a916:14a8 with SMTP id 5b1f17b1804b1-48e6767ddf9mr191883165e9.10.1778567188468; Mon, 11 May 2026 23:26:28 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 40/41] ati-vga: fix ati_set_dirty address calculation Date: Tue, 12 May 2026 08:21:41 +0200 Message-ID: <20260512062142.67998-41-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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: 1778567423513154100 From: Chad Jablonski This fixes three bugs with the ati_set_dirty address calculation. First, vbe_start_addr is a word offset. All other values in the calculation are byte offsets. It must be converted to bytes. Second, when setting the dirty region with memory_region_set_dirty the vbe_start_addr is used to calculate the start of the dirty region. This is a problem because the vbe_start_addr is the offset at which scan out begins. This puts it in the visible screen coordinate system. The dirty region however is in the virtual screen coordinate system. This can cause b= oth overmarking and missed updates. This is removed from the calculation. Third, when the start address of a blit is outside of the bounds check the entire blit is missed and not set to dirty. This happens even if the blit does partially overlap with the visible screen. The fix here is to find the intersection of the visible screen and the blit and mark only that region as dirty. This does not attempt to apply clipping to the blit. So there will be overmarking in some cases. Signed-off-by: Chad Jablonski [balaton: drop excess parenthesis, use offsets instead of pointers] Reviewed-by: BALATON Zoltan Tested-by: BALATON Zoltan Signed-off-by: BALATON Zoltan Message-ID: <20260506153920.C6B27596978@zero.eik.bme.hu> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/display/ati_2d.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/hw/display/ati_2d.c b/hw/display/ati_2d.c index 504d1c57085..48498677c7e 100644 --- a/hw/display/ati_2d.c +++ b/hw/display/ati_2d.c @@ -69,18 +69,28 @@ typedef struct { static void ati_set_dirty(VGACommonState *vga, const ATI2DCtx *ctx) { DisplaySurface *ds =3D qemu_console_surface(vga->con); + unsigned int bypp =3D ctx->bpp / 8; + hwaddr dirty_start =3D ctx->dst_offset + ctx->dst.x * bypp + + ctx->dst.y * ctx->dst_stride; + hwaddr dirty_end =3D dirty_start + ctx->dst.width * bypp + + (ctx->dst.height - 1) * ctx->dst_stride; + /* + * The blit may be outside of the visible screen (e.g. virtual desktop= s.) + * Dirty only the intersection of the visible screen and the blit. + */ + hwaddr vis_start =3D vga->vbe_start_addr * 4; + hwaddr vis_end =3D vis_start + vga->vbe_regs[VBE_DISPI_INDEX_YRES] * + vga->vbe_line_offset; + hwaddr start =3D MAX(vis_start, dirty_start); + hwaddr end =3D MIN(vis_end, dirty_end); =20 (void)ds; DPRINTF("%p %u ds: %p %d %d rop: %x\n", vga->vram_ptr, vga->vbe_start_= addr, surface_data(ds), surface_stride(ds), surface_bits_per_pixel(d= s), ctx->rop3 >> 16); - if (ctx->dst_bits >=3D vga->vram_ptr + vga->vbe_start_addr && - ctx->dst_bits < vga->vram_ptr + vga->vbe_start_addr + - vga->vbe_regs[VBE_DISPI_INDEX_YRES] * vga->vbe_line_offset) { - memory_region_set_dirty(&vga->vram, - vga->vbe_start_addr + ctx->dst_offset + - ctx->dst.y * ctx->dst_stride, - ctx->dst.height * ctx->dst_stride); + + if (start < end) { + memory_region_set_dirty(&vga->vram, start, end - start); } } =20 --=20 2.53.0 From nobody Sat May 30 17:44:13 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=1778567285; cv=none; d=zohomail.com; s=zohoarc; b=UzawvS9wzapGVVpdVOH1vheCcW/Jg6ZS21G6SFDIh0AWkLUcpcme6FquI8tCux9MZI+qyjJ2JokkZVDI0pyF7RFbMZx8EaZEizcg0sSuI3u2dIf09tEmjVBKBmX/n07vtKUcYIlSmseauZEnoie3C8kMZE5EeErJZZS/AcVxh94= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778567285; 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=s1ugNJYOLmq0RMJfysTgh5azhOcAvfEAh2lvllhKwK4=; b=SQItehXLxHJZmK32yMhYIQjDF1krYn4FnfbWDdEKzMlemrTE7t1ghEKMzWUKWb8f02ieZCht6wK/g7+NySoJH5mom89b0s0XD/D+yQUr1tkwwmLKZK1Pakesvdap4snc8Qr1Dzgah3yLbdh+kfbJhHAbJjTdVL6Euoolu4uCGqc= 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 1778567285824397.31434977214667; Mon, 11 May 2026 23:28:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMgaH-0001pQ-FD; Tue, 12 May 2026 02:27: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 1wMgZk-00015e-FK for qemu-devel@nongnu.org; Tue, 12 May 2026 02:26:44 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wMgZh-0007zh-Vd for qemu-devel@nongnu.org; Tue, 12 May 2026 02:26:39 -0400 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-43d734223e4so3147071f8f.0 for ; Mon, 11 May 2026 23:26:37 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-45491cab9c2sm31988196f8f.31.2026.05.11.23.26.34 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 May 2026 23:26:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778567195; x=1779171995; 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; bh=s1ugNJYOLmq0RMJfysTgh5azhOcAvfEAh2lvllhKwK4=; b=qHdKraGOPSSbyVrKeZqkBfdj4e7tG06EM+jO0NUHDrKN3F4R9F6l6VK1qK3gs7uQHe At+dO7UqY96m72asvAtcKtVarQs74cq0S6an7GS9vlzRebz8SGgQB9iOxRATPpn0mHIy SYpD79IcO14yJghXzbWtuc1ygC4qp8Li3q6o2c2ZlbU6QVFxAYfaWfellZe0T3TnwQy7 LufT1CrQA5dk/5V8bFnXGRx5E5ZoIqSi8IGpT+fcTZ7yc4aUI8BzuYptR/eMVto9FkyF zGw1OLAOPDOtiyhM0BD7lcafDPWSawVxsI5hIYG99g/DAq0w77HozwJ5ASmotVPxoC8H p+qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778567195; x=1779171995; 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; bh=s1ugNJYOLmq0RMJfysTgh5azhOcAvfEAh2lvllhKwK4=; b=lqPAJYo3uYF9v19+Ie3xdOg3b7wG82COaRQ8Y/V1rB3vYqGgyFZ/Ifw7elXRRgKfUi geX17XUUGiIVDV0trEwjXXei5AvMllCL9qKOdjPH5v/y3+O8wpa9CM4SpiMFjs4Krm2k Chl69rSL9Nk4Bs9utrCIoQ1DDvSICKUIKYZBaaxw+j9Y/H8sba7HKWOI9Qe7lQqFpNrL 69ecJ9nW6MwZHRWO3S780OVyqbZnUtZQSMxJL2oWLJhxCCfQ1l1dN0DO7wpPTVvs27J7 FA/nJWq1xAh9w6FYDa/+Lac2VBj6ammOhyDu/D+PC6oDIYVkcV4eIVc3RekEmo6WHz/h 4VHg== X-Gm-Message-State: AOJu0Ywda68oPW6NvfcRLf/KYzsohyX+W9XOyKJ/4nzvlP1J1M5M21rs ckWHq/8l5NsnfGUsuf2JI0bszz2CaU9UsDyoOpF1lk/VSsi64cQiW08I99fcbCMlQFzuwVUAmV2 RcKyks4o= X-Gm-Gg: Acq92OG2oRSLo4xjFcsygJa3OaJKiV/r7yRP029H0syuO+7nJsYnxVC7lAMyaOCF72k NZjMOZsMpmGPwJzhwfDmYoBzQsazledyiYh9dIN3Jo+/eEahzY+DoZyjSc76vC1Lv2ZYZUXG7wM 3V1DKCPGyQ40gtqp5iEf42GoCMx1ookQPrx18Q6K0qA4JlzMZtKMhJ9dDTpS3Ev8aAywVwwC5+2 V5O9pPLSmUsq3xI9Ql2w9WNxjNAzhxJ780YLN1lzXCXrm5IEDjN2zqetS+BGFH/Qioy8XViqpkO Cexo4B4yn9kRGq3gWCgIm8SMKsdl8VW3TYWgrAf+cGV9+g4+yl2hIap4FLdL+6cvPStzzOzGDJs Br6oVi72ZUf1cir26aKF254iJHFDT/qb8+ro6RNEgQpvfDtaOci9pBeaKwr2E3FqLGFg5U1GCXg tDiM1HCf4Eqs8HIt/xJx1O1miSiyhf79jIxSyUM5DR0R8pYyEXwYI7FsyLA8bol2ZiDjiHk8FZ X-Received: by 2002:a05:6000:24c3:b0:455:51cf:9f92 with SMTP id ffacd0b85a97d-45ac4224ea5mr3323033f8f.18.1778567195111; Mon, 11 May 2026 23:26:35 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 41/41] scripts: strip leading './' when searching MAINTAINERS file Date: Tue, 12 May 2026 08:21:42 +0200 Message-ID: <20260512062142.67998-42-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512062142.67998-1-philmd@linaro.org> References: <20260512062142.67998-1-philmd@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::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.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: 1778567287345154100 From: Daniel P. Berrang=C3=A9 The following two uses of get_maintainer.pl should return the same results, but do not: $ ./scripts/get_maintainer.pl -f ./hw/net/vmxnet3.c get_maintainer.pl: No maintainers found, printing recent contributors. get_maintainer.pl: Do not blindly cc: them on patches! Use common sense. "Philippe Mathieu-Daud=C3=A9" (commit_signer:4/7=3D57= %) "Michael S. Tsirkin" (commit_signer:4/7=3D57%) Xiaoyao Li (commit_signer:3/7=3D43%) Thomas Huth (commit_signer:3/7=3D43%) Zhao Liu (commit_signer:3/7=3D43%) qemu-devel@nongnu.org (open list:All patches CC here) $ ./scripts/get_maintainer.pl -f hw/net/vmxnet3.c Dmitry Fleytman (maintainer:VMware) Jason Wang (odd fixer:Network devices) qemu-devel@nongnu.org (open list:All patches CC here) In the former case, the leading "./" needs to be removed before trying to find a filename match. Blindly stripping the "./" is valid because the script already enforces that it is run from the QEMU git root directory, so canonicalizing the filename vs $CWD is not required. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20260511093858.82753-1-berrange@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- scripts/get_maintainer.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index 00a0870b267..76be402e11e 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl @@ -384,6 +384,7 @@ foreach my $file (@ARGV) { } elsif (!(stat $file)) { die "$P: file '${file}' not found: $!\n"; } + $file =3D~ s,^./,,; } if ($from_filename) { push(@files, $file); --=20 2.53.0