From nobody Sat May 30 18:35:06 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=1778849888; cv=none; d=zohomail.com; s=zohoarc; b=SoVyRunSlq1CupM0L2NIsBCFBgxxldo5xcltHS5EPq4kgFNDGtphaiKUmqzGJPzRs/S10HJwNMGcNCueBsqr3j/C+YmzjDhYV6sv08akq8YuRwSEyuT0NV7N8opVBncXb+w9rmimGCXJoSuouvo9c78XyO1VE2JWuezjZJWCHYo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778849888; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=X9LWXq81PmoJ4M5/Kig4f6Q90NNHPt9NWDEzmnCq//U=; b=MZUg4W9FuaZZ0cRmDt56UzMUHWqASRNjURysT0VwBuLYRyp//pLwkEhnXoADFC/Qpi48xBy+4AHVAe++BhqVuOBBk/4nGUPMcfNh+Bkf5XRjyjKN1lJvjqaCzVn4di+uqh2nt/L0k8Bz9G6bxyzT7mBEe5egDaTuDSVya8he6kY= 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 1778849888261107.05996332590962; Fri, 15 May 2026 05:58:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wNs6j-000642-Nw; Fri, 15 May 2026 08:57:37 -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 1wNs6g-00062b-Q0 for qemu-devel@nongnu.org; Fri, 15 May 2026 08:57:34 -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 1wNs6f-0000V9-2e for qemu-devel@nongnu.org; Fri, 15 May 2026 08:57:34 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-48fe26a177cso12687985e9.1 for ; Fri, 15 May 2026 05:57:32 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48fe4c833fcsm57526515e9.2.2026.05.15.05.57.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2026 05:57:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778849851; x=1779454651; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=X9LWXq81PmoJ4M5/Kig4f6Q90NNHPt9NWDEzmnCq//U=; b=tw4N09Jf25eURFmyJxHa16XHes1RUCP9z3OiYNuuCmwk2lKGwo2JTa2b20W0051e4A v7fLXURMl1cH0q7VgcLweVn2JX2HG8Q0i2Y9Cr/OHnKlIZgLMEV78ItsE8A2I4PO/IoZ PCiHParZEopsO+mCW0WxkSKYZzHXlLAnFj0zuCAbZa7MdH+qxVbU+kOVD/3oOhJ/bpqe XHYml4xIaHe0QstCUqE19foe6UILOa6sTaVl17NO67GcHi35F5M/Bt0GLESeAcVUiLEz NcGGYkSum0EKdsz0Igpw5OEHF+lRTy0oiVR4Ry/L34oJGPp2COZnOLUA31j4FQPMGZ2m twMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778849851; x=1779454651; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=X9LWXq81PmoJ4M5/Kig4f6Q90NNHPt9NWDEzmnCq//U=; b=CitakSVMMWSs2OpwIqGKtX+McX/66KbLwr7HjrIiks8YKUPmm+ybXXYWak5bhWLXtV 5FzUtjuUX48qE4sdNV9Sw+Br3flgrRh9VpaPxBeJa+6uQPGixr2vTzCpO+RIi5CQRj3K VvrwHxOCyON2eWwMy2t+qJHhI1TSTsFqXED8W5ktviGkNKbtWZ3V6Mwsq9u4Q/O6EY5m hcFbyJVyeKajepsL4zmrmE05QBwvbCOIFCmlD8TZzYOGPA+Tct1vtjBOVOZNfKlxvE5k 02Q92InQgbNc2Q5r3nK3rvXV/1Dtp56lhPgWYsFi9Vsw2EqK/+MEkcEBKb2iN0lCBf5P xneA== X-Gm-Message-State: AOJu0YwQ5TFvPxWkEf0ebR+1eEmi9N0HN17VuV83fBlVeM/JKpsh5YN0 Ug7OpE3AkkuMvKhqDSJH1RGqyvQg2oDunZ873axDFLvh4yu24eOVYC6nP2p9WeK9jZiV2NJhP8U PfgRx X-Gm-Gg: Acq92OEln9fVlk3VMw/leA0jr9DUF3bOF1v3v+TKQCXaMi9MSVH4toTdD2JtPtVJXIW Dld3bS7ozCmTwrR6rXlPhPVByWMZjPtTmJHDsXQGdd3xyLYblI6dzRy5EtAbfi/p47i22QnOTPq eJfRuK4dARKEcFqa9/WXMQGltCsI3FuAVTVHBk4A0TCtpbWUvVxVeDMEDTXnq0zspdKd2v0WIye 71huR6J78QxZ2qaL8pD9u2GVd6gHmA4w1PZBO/m/+qJipOLxLUof8I3281jMEM1C6O4dE3yhtBE pNoQd7wdg0TgPnuqBApuHaDxozodcuoCGektrQqyj+n9kXy2XqaHsqBdZF7VysNMYIvMUHbAM63 7Fb6v/IbIdWZcrGuDkr9+N+Mz81De1dXiYQ87VuVn4ibkLmfz0qTt+QFE22BDW25zTBYC5q67nW b3pppkRfDuTzG7Njqpo13B4gGEWKYOpelCo2DQOzmkVQRbcJN5t/95y1dNkL7/07hjdvcQKP5GP /12oir7txPxui1dh3H4tr2X6BgIqKcuImn5gC4+ZQONyO9KWb/j X-Received: by 2002:a05:600c:b95:b0:48a:8b02:ae91 with SMTP id 5b1f17b1804b1-48fe60ea2dfmr55508855e9.11.1778849851236; Fri, 15 May 2026 05:57:31 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Zhao Liu , "Edgar E. Iglesias" Subject: [PATCH 1/3] target/microblaze: Convert to translate_for_debug Date: Fri, 15 May 2026 13:57:25 +0100 Message-ID: <20260515125727.349675-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260515125727.349675-1-peter.maydell@linaro.org> References: <20260515125727.349675-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=peter.maydell@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: 1778849890826158500 Content-Type: text/plain; charset="utf-8" The get_phys_addr_attrs_debug method of SysemuCPUOps is used only by x86 and microblaze. Convert microblaze to the newer translate_for_debug method, as a step towards being able to remove get_phys_addr_attrs_debug. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- target/microblaze/cpu.c | 2 +- target/microblaze/cpu.h | 4 ++-- target/microblaze/helper.c | 25 ++++++++++++++----------- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index c6a456dd5e..a97c92a7b6 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_addr_attrs_debug =3D mb_cpu_get_phys_addr_attrs_debug, + .translate_for_debug =3D mb_cpu_translate_for_debug, }; #endif =20 diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h index 068da60529..b9602f72b9 100644 --- a/target/microblaze/cpu.h +++ b/target/microblaze/cpu.h @@ -369,8 +369,8 @@ 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_addr_attrs_debug(CPUState *cpu, vaddr addr, - MemTxAttrs *attrs); +bool mb_cpu_translate_for_debug(CPUState *cs, vaddr addr, + TranslateForDebugResult *result); #endif /* !CONFIG_USER_ONLY */ G_NORETURN void mb_cpu_do_unaligned_access(CPUState *cs, vaddr vaddr, MMUAccessType access_type, diff --git a/target/microblaze/helper.c b/target/microblaze/helper.c index f81c4f625b..9c49c510dd 100644 --- a/target/microblaze/helper.c +++ b/target/microblaze/helper.c @@ -280,30 +280,33 @@ void mb_cpu_do_interrupt(CPUState *cs) } } =20 -hwaddr mb_cpu_get_phys_addr_attrs_debug(CPUState *cs, vaddr addr, - MemTxAttrs *attrs) +bool mb_cpu_translate_for_debug(CPUState *cs, vaddr addr, + TranslateForDebugResult *result) { MicroBlazeCPU *cpu =3D MICROBLAZE_CPU(cs); - hwaddr paddr =3D 0; MicroBlazeMMULookup lu; int mmu_idx =3D cpu_mmu_index(cs, false); unsigned int hit; =20 - /* Caller doesn't initialize */ - *attrs =3D (MemTxAttrs) {}; - attrs->secure =3D mb_cpu_access_is_secure(cpu, MMU_DATA_LOAD); + result->attrs =3D (MemTxAttrs) { + .secure =3D mb_cpu_access_is_secure(cpu, MMU_DATA_LOAD), + .debug =3D 1, + }; + + result->lg_page_size =3D TARGET_PAGE_SIZE; =20 if (mmu_idx !=3D MMU_NOMMU_IDX) { hit =3D mmu_translate(cpu, &lu, addr, 0, 0); if (hit) { - paddr =3D lu.paddr + addr - lu.vaddr; - } else - paddr =3D 0; /* ???. */ + result->physaddr =3D lu.paddr + addr - lu.vaddr; + } else { + result->physaddr =3D 0; /* ???. */ + } } else { - paddr =3D addr; + result->physaddr =3D addr; } =20 - return paddr; + return true; } =20 bool mb_cpu_exec_interrupt(CPUState *cs, int interrupt_request) --=20 2.43.0 From nobody Sat May 30 18:35:06 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=1778849902; cv=none; d=zohomail.com; s=zohoarc; b=PsLgI6dzbrRt2hS/gQ98h72KWDsoEsK2ORRO3VSTPHYqbION/oE9OsGoJfXPvnHZ4hqV75kg2K1LDW6tIf2bfy/IYyzdaKvTSr8XK5f1jbYZbj0PR4RV8672U4LrTLeYXm7Rc/lFqdidSTukV3KzA8bmCUmucLgdH0kIUCGM9uM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778849902; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=qUZU6u71aCwD/4KUkNLJfoAqg471k8NpUAI/K5qb+F4=; b=H5I7Bqazzq6PP9Wtm1hcsGv/l5IR5Rk2MU+hgfIVifeiJb9MZXB+U9OYztxzy4vBFMK62xVWSPlBcv1XwnCTXcah9LN7N/QLGtvuc/ZNVQ34huh9nMv8o3PIiK/VvNQFvM1f8ekkoyUhyzOHg7HR5cdRXF1g0O5hBoctUPJdZAw= 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 17788499023271016.182873652639; Fri, 15 May 2026 05:58:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wNs6i-00063M-VY; Fri, 15 May 2026 08:57: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 1wNs6i-000632-6q for qemu-devel@nongnu.org; Fri, 15 May 2026 08:57:36 -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 1wNs6f-0000VL-Lx for qemu-devel@nongnu.org; Fri, 15 May 2026 08:57:35 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-488a88aeec9so101468785e9.2 for ; Fri, 15 May 2026 05:57:33 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48fe4c833fcsm57526515e9.2.2026.05.15.05.57.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2026 05:57:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778849852; x=1779454652; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qUZU6u71aCwD/4KUkNLJfoAqg471k8NpUAI/K5qb+F4=; b=Upc0J5Q81cFquhN8mJHvqeZIHtvNO7RzJZcJLZHRqeljdZ4Ahq1MYmL/YBawsDu1qB 8sKs3Gy4ILWjYWB5JBBKwX/EkKip4u8kTVPggZjZxMsLVy6oxyXYCHgfsBQ/3KqJxHGO JTMrYHISIvqW5lK+1OG4nmeeiGuVeiqOrzWjpTdrCZu/FNUP9UAdGGNX578pwaZ0WjUm KHteXICZvwa1eliKXvXOUXBR3nI/9zHQ7kNuiAw9u1tWu5Ewb7eBIcZb7Oe2PIA8Ic3c m6g5gy2+T/cLQ6q57KvWOECSnJXqFavH41xS2dU9JUH0L04WWV0MyQbWi84F2azQdknj oIsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778849852; x=1779454652; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=qUZU6u71aCwD/4KUkNLJfoAqg471k8NpUAI/K5qb+F4=; b=g80487rpVLI+EnqArgpiooiTjM5IWQLGAX0Ei2ldzbAxkhg6NIZLIA0K6ddSSV0iz/ m+ADziNmAcO9sxjTtbTBCPmZ7zRbjJybIHpkY4iUuqEbEmGGjQSQcDlAz2XiTRSqSyYG c8x9uBlG+sfYwO4lb6VQDdpfQVQQg9icvhxEi06tDTP8lkSg//EpAeQVJlIl6xZWBHMF MwnIdcUxXCwsdqyYMX+OnmYJ47G3o3Q7wQj6odvXJEl1gqRZ3QzgIJIi0QvI8LSc1cOy /T1ym3BBfleaFm4E5H/AwbWUaD5sL5d35j3lhCGKzax+Usemd8UzsHv+X2l/rYj4csA9 iPkA== X-Gm-Message-State: AOJu0YyXUYoYwlpyZiaXZHGsr6R4CWSdKvLtrEXUvFQhzzx4q/kr/yRG VRR2k1Y03f5zI2RW14m1R7s4L/koKGRFBeKFSEGEFS7xMpDo4yCZjI7KcElwNhGrcYmHvlk1njl 96Mxh X-Gm-Gg: Acq92OFaqp39LTlOumnJnuPWQVdXZL5dX31F57A40OiX2UiSqRdNWGgag9cIKBcrPnV KGTj1w4KtzBl/BnPzhvmUTLMcGoC0Pa7BX/y2ZOECoi7gysEh13vovhPdnL6+Zowzto298oQTrV z/IJusjUdIv8I+fMw52idsn82DNcOlU/0PmHcL8eTnoUKxkQVdE4YKtW8WxBY7GQ+AP93e3drma cKuWjeyMzMtsQCgN+S3Xo6T/Mmrt4LDHdvW0pNWl2cIhESHnUz9heI2Hcb3EdcNmfXEuATFEeUP yvC1Qs+X7UsU+BxVl1/fvG5H7Cv9LhEvEA8g1xDM0j56E/PfQp7z3xOO0eGMZTr8hsecYIyD8mJ b0EhXH+Me4KlqLp44tFiC7Misjc3KEoPSGRxD3Nj8XDU3NPDGvSKBYAq07jlzFwE3Zs/q4uRg/y 5v/Q/nmiWE36/C0U2igJUnX1SscVgisABPcnsRWmtoshe8CF21xOUcBL8VBj+OPY1qQJPPpwyRm A8Qd2U7PzJh+tbrAB8Hk5bemfwJbTk= X-Received: by 2002:a05:600d:10:b0:48a:568f:ae6d with SMTP id 5b1f17b1804b1-48fe60e7d79mr47207735e9.8.1778849852153; Fri, 15 May 2026 05:57:32 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Zhao Liu , "Edgar E. Iglesias" Subject: [PATCH 2/3] target/i386: Convert to translate_for_debug Date: Fri, 15 May 2026 13:57:26 +0100 Message-ID: <20260515125727.349675-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260515125727.349675-1-peter.maydell@linaro.org> References: <20260515125727.349675-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=peter.maydell@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: 1778849904485158500 Content-Type: text/plain; charset="utf-8" The get_phys_addr_attrs_debug method of SysemuCPUOps is used only by x86 and microblaze. Convert x86 to the newer translate_for_debug method, as a step towards being able to remove get_phys_addr_attrs_debug. The new API allows us to tell the caller the actual size of the mapping via lg_page_size, so we do that, although no caller will care since it's always at least TARGET_PAGE_BITS. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- target/i386/cpu.c | 2 +- target/i386/cpu.h | 4 ++-- target/i386/helper.c | 31 +++++++++++++++++-------------- target/i386/whpx/whpx-all.c | 2 +- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 7248720a0e..8929a75c7c 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_addr_attrs_debug =3D x86_cpu_get_phys_addr_attrs_debug, + .translate_for_debug =3D x86_cpu_translate_for_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/cpu.h b/target/i386/cpu.h index bdd4fff89d..67e2ecf325 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -2581,8 +2581,8 @@ 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_addr_attrs_debug(CPUState *cpu, vaddr addr, - MemTxAttrs *attrs); +bool x86_cpu_translate_for_debug(CPUState *cpu, vaddr addr, + TranslateForDebugResult *result); int cpu_get_pic_interrupt(CPUX86State *s); =20 /* MS-DOS compatibility mode FPU exception support */ diff --git a/target/i386/helper.c b/target/i386/helper.c index 8cc73f619a..30f1fa41b3 100644 --- a/target/i386/helper.c +++ b/target/i386/helper.c @@ -252,8 +252,8 @@ void cpu_x86_update_cr4(CPUX86State *env, uint32_t new_= cr4) } =20 #if !defined(CONFIG_USER_ONLY) -hwaddr x86_cpu_get_phys_addr_attrs_debug(CPUState *cs, vaddr addr, - MemTxAttrs *attrs) +bool x86_cpu_translate_for_debug(CPUState *cs, vaddr addr, + TranslateForDebugResult *result) { X86CPU *cpu =3D X86_CPU(cs); CPUX86State *env =3D &cpu->env; @@ -263,8 +263,6 @@ hwaddr x86_cpu_get_phys_addr_attrs_debug(CPUState *cs, = vaddr addr, uint32_t page_offset; int page_size; =20 - *attrs =3D cpu_get_mem_attrs(env); - a20_mask =3D x86_get_a20_mask(env); if (!(env->cr[0] & CR0_PG_MASK)) { pte =3D addr & a20_mask; @@ -283,7 +281,7 @@ hwaddr x86_cpu_get_phys_addr_attrs_debug(CPUState *cs, = vaddr addr, /* test virtual address sign extension */ sext =3D la57 ? (int64_t)addr >> 56 : (int64_t)addr >> 47; if (sext !=3D 0 && sext !=3D -1) { - return -1; + return false; } =20 if (la57) { @@ -291,7 +289,7 @@ hwaddr x86_cpu_get_phys_addr_attrs_debug(CPUState *cs, = vaddr addr, (((addr >> 48) & 0x1ff) << 3)) & a20_mask; pml5e =3D x86_ldq_phys(cs, pml5e_addr); if (!(pml5e & PG_PRESENT_MASK)) { - return -1; + return false; } } else { pml5e =3D env->cr[3]; @@ -301,13 +299,13 @@ hwaddr x86_cpu_get_phys_addr_attrs_debug(CPUState *cs= , vaddr addr, (((addr >> 39) & 0x1ff) << 3)) & a20_mask; pml4e =3D x86_ldq_phys(cs, pml4e_addr); if (!(pml4e & PG_PRESENT_MASK)) { - return -1; + return false; } pdpe_addr =3D ((pml4e & PG_ADDRESS_MASK) + (((addr >> 30) & 0x1ff) << 3)) & a20_mask; pdpe =3D x86_ldq_phys(cs, pdpe_addr); if (!(pdpe & PG_PRESENT_MASK)) { - return -1; + return false; } if (pdpe & PG_PSE_MASK) { page_size =3D 1024 * 1024 * 1024; @@ -322,14 +320,14 @@ hwaddr x86_cpu_get_phys_addr_attrs_debug(CPUState *cs= , vaddr addr, a20_mask; pdpe =3D x86_ldq_phys(cs, pdpe_addr); if (!(pdpe & PG_PRESENT_MASK)) - return -1; + return false; } =20 pde_addr =3D ((pdpe & PG_ADDRESS_MASK) + (((addr >> 21) & 0x1ff) << 3)) & a20_mask; pde =3D x86_ldq_phys(cs, pde_addr); if (!(pde & PG_PRESENT_MASK)) { - return -1; + return false; } if (pde & PG_PSE_MASK) { /* 2 MB page */ @@ -343,7 +341,7 @@ hwaddr x86_cpu_get_phys_addr_attrs_debug(CPUState *cs, = vaddr addr, pte =3D x86_ldq_phys(cs, pte_addr); } if (!(pte & PG_PRESENT_MASK)) { - return -1; + return false; } } else { uint32_t pde; @@ -352,7 +350,7 @@ hwaddr x86_cpu_get_phys_addr_attrs_debug(CPUState *cs, = vaddr addr, pde_addr =3D ((env->cr[3] & ~0xfff) + ((addr >> 20) & 0xffc)) & a2= 0_mask; pde =3D x86_ldl_phys(cs, pde_addr); if (!(pde & PG_PRESENT_MASK)) - return -1; + return false; if ((pde & PG_PSE_MASK) && (env->cr[4] & CR4_PSE_MASK)) { pte =3D pde | ((pde & 0x1fe000LL) << (32 - 13)); page_size =3D 4096 * 1024; @@ -361,7 +359,7 @@ hwaddr x86_cpu_get_phys_addr_attrs_debug(CPUState *cs, = vaddr addr, pte_addr =3D ((pde & ~0xfff) + ((addr >> 10) & 0xffc)) & a20_m= ask; pte =3D x86_ldl_phys(cs, pte_addr); if (!(pte & PG_PRESENT_MASK)) { - return -1; + return false; } page_size =3D 4096; } @@ -373,7 +371,12 @@ out: #endif pte &=3D PG_ADDRESS_MASK & ~(page_size - 1); page_offset =3D addr & (page_size - 1); - return pte | page_offset; + + result->attrs =3D cpu_get_mem_attrs(env); + result->attrs.debug =3D 1; + result->physaddr =3D pte | page_offset; + result->lg_page_size =3D ctz64(page_size); + return true; } =20 typedef struct MCEInjectionParams { diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index 7943adb93f..e626acef2f 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_addr_attrs_debug() for a + * than it may seem. See x86_cpu_translate_for_debug() for a * rough idea. * * 3. In order to properly support guest-level debugging in parallel w= ith --=20 2.43.0 From nobody Sat May 30 18:35:06 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=1778849892; cv=none; d=zohomail.com; s=zohoarc; b=WbV4SG5uZ2cmHqobbhYmvdptTbfnAyfUT8K4Wsd+RIOKFL0iu7odZjCW071RFo1tppzwsaITargMCV6bLr2CTU1UjYTxDq4v1VX+B0CSMUPOMveSQkswMeUQQ2iK4pWv0EXpWVgBLFHSsN0Vdx/FmDk9M8q7Q89EQUSPaThKRB8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778849892; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=JuPFKRaiB2fHObLjLFJOcy++OZ2S1wxCfyuKUlasefg=; b=HTkAhfpQZqgfj2SkHTboPZIkGkqOPFhXidYWhfovliRi163wZCQob+DdMBooAwNUyz9OHGlfIOhHlkEo9LFpYx+5cjWT14cBTZKu87LZ76LbLnP9RvS6UoE8DrRtJoOXtB6SNePBsdsKLo4y2H08lKtQsy7GPg0GoTfyH/HUuY8= 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 177884989218444.4074329351422; Fri, 15 May 2026 05:58:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wNs6k-000649-Mb; Fri, 15 May 2026 08:57: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 1wNs6j-00063P-33 for qemu-devel@nongnu.org; Fri, 15 May 2026 08:57:37 -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 1wNs6h-0000VU-BQ for qemu-devel@nongnu.org; Fri, 15 May 2026 08:57:36 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-48896199cbaso78869775e9.1 for ; Fri, 15 May 2026 05:57:34 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48fe4c833fcsm57526515e9.2.2026.05.15.05.57.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2026 05:57:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778849854; x=1779454654; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JuPFKRaiB2fHObLjLFJOcy++OZ2S1wxCfyuKUlasefg=; b=mdyGYS52/J39fIaFwU/j6OKxyWVGV1J9Y10ahn/Am/ASd2QwkUJivXfrGbUth2Ef4Y eGb8i2NUAVvOQbm2tSZCJD1uIIpkCQptgpWlLEpqfA245wqz+Hj0e8/NI9Y7Rz28C/aG +qnDCl1KzVl5m6Ak4Hg3yUaQzbgJo7DOINGYlhcal8UfJdV45RrhEipYWo8+MUWyFPW1 bNU04G68FW5FjFN7DzM5Z1mUVKOGs9bmZujhP0WGeeyEW779czpFbb1crrzJmLR2Ricl wYq59MmARKPK2ifJ08utYzMR8a5GUxxhRBjYY0vIFyDOrmhHvhoDdaoSopWI1HmB5Zgn IBYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778849854; x=1779454654; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=JuPFKRaiB2fHObLjLFJOcy++OZ2S1wxCfyuKUlasefg=; b=eak4az0hMVLe5HQWWz5bxrtDYYTNPqXCdlXWAg2d5B9wT5P1Mcm6aVRWvoYP3c2hTK dU7InU9i+57zEPNFvXcAy7cLk3zAczbmZ5b8eFzy9VAux/fT3qLoH6DHmlnWNmPtVwow fI5q+e0jLQ50li3HAKJOO013T14kBMIEAequ9V6utlwlO0fZ9RBbh3CU9CJOUrgxiJ5h GmFLknhgxVkB6Mn5e7dtFQrioQmZjk+uXAXJcQZHlOh8f/z3a+oledjA5mI6Yo2obyxv spMlBut3CytEHjcFTp/L3o2+q2qRmx3l7yUVlGdeIsqwiXqY26PAGYAmU+FYtvUbVlFF c56g== X-Gm-Message-State: AOJu0Yx/+F/xpIivAupf5oWdRqRXIISHgT5eg3Gfo3cnFTmRYIgbuvAL WUMUhkLs2lVk18B7/OJtcequWo5QgPf06iSoMR3dIumAtelsFiglq+EM2x+ueX+49jsSG8WNyh1 uDlJD X-Gm-Gg: Acq92OHKzxCcU+DUuHCtTxAVZRr72/47UKgRcNHxwLpYRAy/MaSa3eGLYm8Fe1ogjU2 J41c+4k6r3hugstfxPsl+8PHzLDpDe7VMrmJ8Fr1xN7Qyec+6LckWSPMBMI0szMdXuaQSGZG9fi hiCO58o1TmLhJn66jy5sK3uWaA0XMbuxGUiQUBlmQ38/ItbrPhi7f1elevv1EMbKJ12TVnUDOVE 7d/jNBfyP3JCWCprjjMH5lHUH8GEMyM/gymtrPmw3Kf4KpKQhIH7Zy2AWf6Lg/THnnlXPvvEbHD eB9QO8NDkEYE7kzEWyyKV34IVpUkYR2yjB0/CyJ0h2gG6wyK/+u+bb35BTjdde4KWPEWagKdB4b yAKyWSmRCfuCpFmskkTv1KMagjLCt6Qcvwxb1YBOQXPuZn5x6XcdzeTYU8rgU+VfdwyR9lLGqxy PVJOyo8soOZc+fUJHvnmPBCyOdTF/Iu6to+x0xROyUu4pVfUpmNJSFszjENcdURdoU+IM8xOTdj IqUyg50WQj6JYOE3M8uLukDYcDsmvs= X-Received: by 2002:a05:600c:8184:b0:48f:d1b8:9aa5 with SMTP id 5b1f17b1804b1-48fe60ecd7dmr50984535e9.8.1778849853832; Fri, 15 May 2026 05:57:33 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Zhao Liu , "Edgar E. Iglesias" Subject: [PATCH 3/3] hw/core: Remove SysemuCPUOps::get_phys_addr_attrs_debug Date: Fri, 15 May 2026 13:57:27 +0100 Message-ID: <20260515125727.349675-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260515125727.349675-1-peter.maydell@linaro.org> References: <20260515125727.349675-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=peter.maydell@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: 1778849894925158500 Content-Type: text/plain; charset="utf-8" No targets use the SysemuCPUOps::get_phys_addr_attrs_debug method any more, so we can remove it, together with the handling of it in cpu_translate_for_debug(). Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- hw/core/cpu-system.c | 11 ++--------- include/hw/core/sysemu-cpu-ops.h | 14 -------------- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/hw/core/cpu-system.c b/hw/core/cpu-system.c index 16f048c956..14eb4ed87f 100644 --- a/hw/core/cpu-system.c +++ b/hw/core/cpu-system.c @@ -63,15 +63,8 @@ bool cpu_translate_for_debug(CPUState *cpu, vaddr addr, 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; - } + 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; } diff --git a/include/hw/core/sysemu-cpu-ops.h b/include/hw/core/sysemu-cpu-= ops.h index 441901fae8..8be6a84bd5 100644 --- a/include/hw/core/sysemu-cpu-ops.h +++ b/include/hw/core/sysemu-cpu-ops.h @@ -39,20 +39,6 @@ typedef struct SysemuCPUOps { * 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. - * - * 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. --=20 2.43.0