From patchwork Thu Dec 8 15:35:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 631882 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp294944pvb; Thu, 8 Dec 2022 07:36:28 -0800 (PST) X-Google-Smtp-Source: AA0mqf69YzHnqP1ExsI/uV2Ien36m2m7a5ThMFFSRUmhW2ke9ODL1G8dANV3uXqIDVAbq/LXF33J X-Received: by 2002:a05:6214:3310:b0:4c7:364c:60f3 with SMTP id mo16-20020a056214331000b004c7364c60f3mr3950829qvb.12.1670513788422; Thu, 08 Dec 2022 07:36:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670513788; cv=none; d=google.com; s=arc-20160816; b=UtMn7WfIsX4kpQ3/j3LduFx7yN8R50Zlq9UPnm0zwKspeGklJzJgBC0OsHqn/+4RNz EL4vjhS2fGMZRYZ7OI5qR7DN5zBX8FinVYSb1Sn+O9jfwBrd/n23ycTpV+qPXzF30a2b HE8VmgXhe3FHyjZrxZb+SB03eS6RoB0lyDCcMEX8NfzUdWLcf5RlbqFbR+m37581L71l Y9z8qnKykKDVTqBSltB/66xwrom69j6kh3d/jxlfop7KmGUOcNP5oAc4l+khe8mYns89 1o6qHhKG3HFejOuQZhvrlaGfEmOTk8v+vLepP0B2HtHHwGufC0V/2KyQVuNmkCXJJFkO V14Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Q7RS6UvhOjqcYyu9Kw9e2FPYxya3Ny6m4Myksv2MLL4=; b=gR99JIbkmZb/VQIHXMzGBy/0lJfAtLy2UAXLvSZisMMiNVwnCwgjoCBibXpxj5jIvy zJsY66ztr/izjnyXRtPFA/LptovcqAH1i7qxY9Pqq6NqRCyYmjzh/4ONZZBPXDHlpZY6 3GjdYYLd9WFTOkNYWVlfHj0OJ7XvBsSDwNDEV+/P+NYoY1RXW1zX/NmxYsoE01UlcaRs 2/i50j1LbHemoskwLhrLjoffnIztIHMa9FT0/+iyY93D0znIZ5XlLW5C6pSBCBCjGIr4 ddX1L27L1EMDkwvJ5wIxJ5tDANVTqisoaSIGvIh/OJ+MMJRfwPz+k/yFBIcLXPZGLYpV ovEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Jb/HWx35"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e2-20020a0562141d0200b004970f7307f8si11911459qvd.534.2022.12.08.07.36.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Dec 2022 07:36:28 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Jb/HWx35"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p3Iw5-0003JM-MK; Thu, 08 Dec 2022 10:35:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p3Iw1-0003HU-4N for qemu-devel@nongnu.org; Thu, 08 Dec 2022 10:35:41 -0500 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 1p3Ivz-0006Gp-Lr for qemu-devel@nongnu.org; Thu, 08 Dec 2022 10:35:40 -0500 Received: by mail-wm1-x329.google.com with SMTP id v7so1354546wmn.0 for ; Thu, 08 Dec 2022 07:35:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=Q7RS6UvhOjqcYyu9Kw9e2FPYxya3Ny6m4Myksv2MLL4=; b=Jb/HWx35b+MtI6qBxIsRwbEw6joOnDCickQMBxUWMv8ACprcbix5ALhfED1cXn7zyP 1e39u8vTM4eEAUw86m3FLwmt8IPHqE1LoYRyA0VP1apn/ZHnZrsoxZJYG/imRavJfplr O8PFqGz9twAjDzSFzgCvbXviB/s7n4P2xjJlqHXDyV+RoLEmUE+wU2HRXjaf5BoN9Pcs cyhnIASf7v2t63hX7ZpSLSFH9Mrn7NoQ/mwoVfizSw3m77UL4Xz0MOoxxN73ZeLtiVir o8CgfsmLIotwTbS3EfxSzBftxkvWvH1bY5hxcuVW30VPTET/qr9fXy6QGoGxJIDdLmxv g6OQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Q7RS6UvhOjqcYyu9Kw9e2FPYxya3Ny6m4Myksv2MLL4=; b=lehwYQdDO3MJhPJJkd47PVnYkDaJkpxCWqIQ8f9NVZLhEzQHIyAqzw8VfpcVNLSDuw D+6AzuoSWSf1esElQgiTNm2YB/eAEeB8+LRGSpxUxlaBujk1JOetKPmnWWFEmxib14qA ittLmLLqUo4nJi/TvM2ZVru7nq02CRhAGwOXXRmJfHEiLzukZPaB3CQrt+GGQQPDMuXO qIKzvvnpTi4J0xKgnB6ltjKCbWUUVY8KHwGjyY3BC2Ga5BoQ6Xk5ZbNqP9gq08d2H1b8 u6opxGCjdyrq3brJtK7CwxLn/aauv746nXcgGTlxjoW3ue0SIhFjsPEfQVKBBZDgueWk t+/Q== X-Gm-Message-State: ANoB5pmibUsY6qAMKZtfG4KClMsqY8LuTwXS+ofDE9H2MLRa9DNi2yes p+0OGR6otTgTwh74BTvMhA3ij5k7C9rkjPl+GbI= X-Received: by 2002:a7b:c358:0:b0:3d1:f882:43eb with SMTP id l24-20020a7bc358000000b003d1f88243ebmr1952493wmj.10.1670513738126; Thu, 08 Dec 2022 07:35:38 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id f16-20020a05600c4e9000b003c6c182bef9sm7940862wmq.36.2022.12.08.07.35.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 08 Dec 2022 07:35:37 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Greg Kurz , Paolo Bonzini , David Gibson , kvm@vger.kernel.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Richard Henderson , "Edgar E. Iglesias" , Stafford Horne , Anton Johansson , =?utf-8?q?C=C3=A9dric_Le_Goater?= , qemu-ppc@nongnu.org, Eduardo Habkost , Chris Wulff , Yanan Wang , Fabiano Rosas , =?utf-8?q?Alex_Benn=C3=A9e?= , Marek Vasut , Max Filippov , Yoshinori Sato , Laurent Vivier , Daniel Henrique Barboza , Marcel Apfelbaum , Artyom Tarasenko Subject: [PATCH-for-8.0 v2 1/4] cputlb: Restrict SavedIOTLB to system emulation Date: Thu, 8 Dec 2022 16:35:25 +0100 Message-Id: <20221208153528.27238-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221208153528.27238-1-philmd@linaro.org> References: <20221208153528.27238-1-philmd@linaro.org> MIME-Version: 1.0 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Commit 2f3a57ee47 ("cputlb: ensure we save the IOTLB data in case of reset") added the SavedIOTLB structure -- which is system emulation specific -- in the generic CPUState structure. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 8830546121..bc3229ae13 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -222,7 +222,7 @@ struct CPUWatchpoint { QTAILQ_ENTRY(CPUWatchpoint) entry; }; -#ifdef CONFIG_PLUGIN +#if defined(CONFIG_PLUGIN) && !defined(CONFIG_USER_ONLY) /* * For plugins we sometime need to save the resolved iotlb data before * the memory regions get moved around by io_writex. @@ -406,9 +406,11 @@ struct CPUState { #ifdef CONFIG_PLUGIN GArray *plugin_mem_cbs; +#if !defined(CONFIG_USER_ONLY) /* saved iotlb data from io_writex */ SavedIOTLB saved_iotlb; -#endif +#endif /* !CONFIG_USER_ONLY */ +#endif /* CONFIG_PLUGIN */ /* TODO Move common fields from CPUArchState here. */ int cpu_index; From patchwork Thu Dec 8 15:35:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 631883 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp294946pvb; Thu, 8 Dec 2022 07:36:28 -0800 (PST) X-Google-Smtp-Source: AA0mqf747jfRraLhlVJIdP3TwJqGmIXPXnxJn11mW/vqUg8bjS5u7lmrIM0paL2sWC1U8IvsJ5It X-Received: by 2002:a05:6102:3c97:b0:3ac:7c75:370b with SMTP id c23-20020a0561023c9700b003ac7c75370bmr1255810vsv.18.1670513788450; Thu, 08 Dec 2022 07:36:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670513788; cv=none; d=google.com; s=arc-20160816; b=UrpwglXqvbsWPx6656wT2+Aghh5xDlntyYT3Dmr8vv6dXUWyK3qCtPY4v+YEDFWWQA g1Ld2C4o0bcIGN1rUGVbESqJoQYT0KAsDg3qNpbrd5X77XbxQazbk6U0S0/0FGstBj8Q UEwtqlFq77nHzS0fUlEafmRA1oxDTjABwdkLxUtZgOrgoKVwI3rAnE4dqXxbT4AOl0pv tDMSvu0BNjEgNwF/ijT3H7MZttZ8sTRQehZJjIqk5+HUoIu7s8OdE/uAtXk5dTAuvO8l dAWApjzkS1XPHwTtZddGElh3G2aptIOK/jHeNIh85KM9WtkMFIVHbMG1BBUsY7/WSvhi 8u7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=95bE8x/teeNSfVWODs9hXIcMYWYrin/ZvMeXjp0588I=; b=WSaNbZe45hziVb70wLrh9VFV5S0+o6JsXELMiZ8akcRZz/dJFt/lfGV/WmUczDPrni Zo7YMkQYaS0/neWAuFemWn+o9GGVmPI3StaiCmXm7zwy1O0tSe1mSOnuCayzNEtDIc5a RPfmRWlJcBVrS/F+1w/cKHIdoE8TdUd8TnX6jdZj0wCiYCL393n+X/u9ryavuZnmVYiA EhLvhT6wjDv2SGxoaByFLAaln5X9aY7uJiM/Fxc6FbYzoTbWT+mEJV3uMk3yV/sYL+Pa AdlqG+DwspB/PtIdXXJfsH5Jm8fdUJBPl8aBR4WunNz0KpWQZGZPRtC8SB2jcCra1CSX l0mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FV4libTg; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h8-20020a05620a284800b006f3a1c03407si13267295qkp.600.2022.12.08.07.36.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Dec 2022 07:36:28 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FV4libTg; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p3Iw8-0003MD-VE; Thu, 08 Dec 2022 10:35:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p3Iw7-0003Ky-J1 for qemu-devel@nongnu.org; Thu, 08 Dec 2022 10:35:47 -0500 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 1p3Iw5-0006Hh-LF for qemu-devel@nongnu.org; Thu, 08 Dec 2022 10:35:47 -0500 Received: by mail-wm1-x331.google.com with SMTP id f13-20020a1cc90d000000b003d08c4cf679so1295507wmb.5 for ; Thu, 08 Dec 2022 07:35:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=95bE8x/teeNSfVWODs9hXIcMYWYrin/ZvMeXjp0588I=; b=FV4libTgSRAyEFq5Rcf7SgtXnsjGO+MuKWh6usOXAMeakrMSY0jubB0HPdlK43TlTk ChU5F2WAAAotEnb0MzjwpM9Kkv9eQc5zkFn1aPY9tm52lFS3tIqQHz+/N8kOk9hedUxF WxaM2wm3lCF3EB1d8w1tsOy1b/ExeitagmoezoLIIME5TP4cPaHv+lrmc83JnSFKjHPf 4DRgrJhcoNOu9klvQpWLP6Y4YxCWuWWfG0EIm11zqWaBU4y7BRnrSmE+bSi1dmsRc3cY 5lDGkibfhYhz9Pt4bqlRrYV50jnQvhW2odgBSpSpss+ixlPla0j28uTC6Hbp94q8HupO +HuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=95bE8x/teeNSfVWODs9hXIcMYWYrin/ZvMeXjp0588I=; b=j9JZ764DjsgiRdFqSHhDNnYjl84twliWIrPN+l3KVFgDKG4AEMb+A7yntf+2w+9L1P r3F4/hSgYp4VBgv54dnTq+49PnSFPEmqPIpj7H68lqnx1614bdd3YvxfFdNGCrQFlq3i /hA7UK0o8rX/CPrPmD9CtEH4kpBGssZbIxhjHrsVhwxwpVxXv4Xfp2DeFZINIVpOTpBv hyDe4Iljp965dm8cbKV+MLGCf/i349zA+IU/Fk2AoPJ7k0BffF76RCbJdbh6sOqn0VDG tG1KBlJphwjPqJXMiMk+UP/Go7d6jita8ZXRK/dPDKVJALXtqz5bUfkLZSK9THtTizpe J65Q== X-Gm-Message-State: ANoB5pn8h+pVLU6C2KP7ouovDGQKJyPbMeYWLOXC9hRkAJTfC2FFX1Pa Xb7O53pRKPJKBWBK0T9t6mtws8XJC0RafeoJRI0= X-Received: by 2002:a05:600c:4f16:b0:3c6:e62e:2e67 with SMTP id l22-20020a05600c4f1600b003c6e62e2e67mr2265941wmq.2.1670513744109; Thu, 08 Dec 2022 07:35:44 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id k32-20020a05600c1ca000b003b4ff30e566sm12225493wms.3.2022.12.08.07.35.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 08 Dec 2022 07:35:43 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Greg Kurz , Paolo Bonzini , David Gibson , kvm@vger.kernel.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Richard Henderson , "Edgar E. Iglesias" , Stafford Horne , Anton Johansson , =?utf-8?q?C=C3=A9dric_Le_Goater?= , qemu-ppc@nongnu.org, Eduardo Habkost , Chris Wulff , Yanan Wang , Fabiano Rosas , =?utf-8?q?Alex_Benn=C3=A9e?= , Marek Vasut , Max Filippov , Yoshinori Sato , Laurent Vivier , Daniel Henrique Barboza , Marcel Apfelbaum , Artyom Tarasenko Subject: [PATCH-for-8.0 v2 2/4] gdbstub: Use vaddr type for generic insert/remove_breakpoint() API Date: Thu, 8 Dec 2022 16:35:26 +0100 Message-Id: <20221208153528.27238-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221208153528.27238-1-philmd@linaro.org> References: <20221208153528.27238-1-philmd@linaro.org> MIME-Version: 1.0 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Both insert/remove_breakpoint() handlers are used in system and user emulation. We can not use the 'hwaddr' type on user emulation, we have to use 'vaddr' which is defined as "wide enough to contain any #target_ulong virtual address". gdbstub.c doesn't require to include "exec/hwaddr.h" anymore. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Fabiano Rosas --- accel/kvm/kvm-all.c | 4 ++-- accel/kvm/kvm-cpus.h | 4 ++-- accel/tcg/tcg-accel-ops.c | 4 ++-- gdbstub/gdbstub.c | 1 - gdbstub/internals.h | 6 ++++-- gdbstub/softmmu.c | 5 ++--- gdbstub/user.c | 5 ++--- include/sysemu/accel-ops.h | 6 +++--- 8 files changed, 17 insertions(+), 18 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index f99b0becd8..f3b434c717 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -3219,7 +3219,7 @@ bool kvm_supports_guest_debug(void) return kvm_has_guest_debug; } -int kvm_insert_breakpoint(CPUState *cpu, int type, hwaddr addr, hwaddr len) +int kvm_insert_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len) { struct kvm_sw_breakpoint *bp; int err; @@ -3257,7 +3257,7 @@ int kvm_insert_breakpoint(CPUState *cpu, int type, hwaddr addr, hwaddr len) return 0; } -int kvm_remove_breakpoint(CPUState *cpu, int type, hwaddr addr, hwaddr len) +int kvm_remove_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len) { struct kvm_sw_breakpoint *bp; int err; diff --git a/accel/kvm/kvm-cpus.h b/accel/kvm/kvm-cpus.h index fd63fe6a59..ca40add32c 100644 --- a/accel/kvm/kvm-cpus.h +++ b/accel/kvm/kvm-cpus.h @@ -19,8 +19,8 @@ void kvm_cpu_synchronize_post_reset(CPUState *cpu); void kvm_cpu_synchronize_post_init(CPUState *cpu); void kvm_cpu_synchronize_pre_loadvm(CPUState *cpu); bool kvm_supports_guest_debug(void); -int kvm_insert_breakpoint(CPUState *cpu, int type, hwaddr addr, hwaddr len); -int kvm_remove_breakpoint(CPUState *cpu, int type, hwaddr addr, hwaddr len); +int kvm_insert_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len); +int kvm_remove_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len); void kvm_remove_all_breakpoints(CPUState *cpu); #endif /* KVM_CPUS_H */ diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index 19cbf1db3a..d9228fd403 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -116,7 +116,7 @@ static inline int xlat_gdb_type(CPUState *cpu, int gdbtype) return cputype; } -static int tcg_insert_breakpoint(CPUState *cs, int type, hwaddr addr, hwaddr len) +static int tcg_insert_breakpoint(CPUState *cs, int type, vaddr addr, vaddr len) { CPUState *cpu; int err = 0; @@ -147,7 +147,7 @@ static int tcg_insert_breakpoint(CPUState *cs, int type, hwaddr addr, hwaddr len } } -static int tcg_remove_breakpoint(CPUState *cs, int type, hwaddr addr, hwaddr len) +static int tcg_remove_breakpoint(CPUState *cs, int type, vaddr addr, vaddr len) { CPUState *cpu; int err = 0; diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index be88ca0d71..c3fbc31123 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -48,7 +48,6 @@ #include "sysemu/runstate.h" #include "semihosting/semihost.h" #include "exec/exec-all.h" -#include "exec/hwaddr.h" #include "sysemu/replay.h" #include "internals.h" diff --git a/gdbstub/internals.h b/gdbstub/internals.h index eabb0341d1..b23999f951 100644 --- a/gdbstub/internals.h +++ b/gdbstub/internals.h @@ -9,9 +9,11 @@ #ifndef _INTERNALS_H_ #define _INTERNALS_H_ +#include "exec/cpu-common.h" + bool gdb_supports_guest_debug(void); -int gdb_breakpoint_insert(CPUState *cs, int type, hwaddr addr, hwaddr len); -int gdb_breakpoint_remove(CPUState *cs, int type, hwaddr addr, hwaddr len); +int gdb_breakpoint_insert(CPUState *cs, int type, vaddr addr, vaddr len); +int gdb_breakpoint_remove(CPUState *cs, int type, vaddr addr, vaddr len); void gdb_breakpoint_remove_all(CPUState *cs); #endif /* _INTERNALS_H_ */ diff --git a/gdbstub/softmmu.c b/gdbstub/softmmu.c index f208c6cf15..129575e510 100644 --- a/gdbstub/softmmu.c +++ b/gdbstub/softmmu.c @@ -11,7 +11,6 @@ #include "qemu/osdep.h" #include "exec/gdbstub.h" -#include "exec/hwaddr.h" #include "sysemu/cpus.h" #include "internals.h" @@ -24,7 +23,7 @@ bool gdb_supports_guest_debug(void) return false; } -int gdb_breakpoint_insert(CPUState *cs, int type, hwaddr addr, hwaddr len) +int gdb_breakpoint_insert(CPUState *cs, int type, vaddr addr, vaddr len) { const AccelOpsClass *ops = cpus_get_accel(); if (ops->insert_breakpoint) { @@ -33,7 +32,7 @@ int gdb_breakpoint_insert(CPUState *cs, int type, hwaddr addr, hwaddr len) return -ENOSYS; } -int gdb_breakpoint_remove(CPUState *cs, int type, hwaddr addr, hwaddr len) +int gdb_breakpoint_remove(CPUState *cs, int type, vaddr addr, vaddr len) { const AccelOpsClass *ops = cpus_get_accel(); if (ops->remove_breakpoint) { diff --git a/gdbstub/user.c b/gdbstub/user.c index 033e5fdd71..484bd8f461 100644 --- a/gdbstub/user.c +++ b/gdbstub/user.c @@ -9,7 +9,6 @@ */ #include "qemu/osdep.h" -#include "exec/hwaddr.h" #include "exec/gdbstub.h" #include "hw/core/cpu.h" #include "internals.h" @@ -20,7 +19,7 @@ bool gdb_supports_guest_debug(void) return true; } -int gdb_breakpoint_insert(CPUState *cs, int type, hwaddr addr, hwaddr len) +int gdb_breakpoint_insert(CPUState *cs, int type, vaddr addr, vaddr len) { CPUState *cpu; int err = 0; @@ -41,7 +40,7 @@ int gdb_breakpoint_insert(CPUState *cs, int type, hwaddr addr, hwaddr len) } } -int gdb_breakpoint_remove(CPUState *cs, int type, hwaddr addr, hwaddr len) +int gdb_breakpoint_remove(CPUState *cs, int type, vaddr addr, vaddr len) { CPUState *cpu; int err = 0; diff --git a/include/sysemu/accel-ops.h b/include/sysemu/accel-ops.h index 8cc7996def..30690c71bd 100644 --- a/include/sysemu/accel-ops.h +++ b/include/sysemu/accel-ops.h @@ -10,7 +10,7 @@ #ifndef ACCEL_OPS_H #define ACCEL_OPS_H -#include "exec/hwaddr.h" +#include "exec/cpu-common.h" #include "qom/object.h" #define ACCEL_OPS_SUFFIX "-ops" @@ -48,8 +48,8 @@ struct AccelOpsClass { /* gdbstub hooks */ bool (*supports_guest_debug)(void); - int (*insert_breakpoint)(CPUState *cpu, int type, hwaddr addr, hwaddr len); - int (*remove_breakpoint)(CPUState *cpu, int type, hwaddr addr, hwaddr len); + int (*insert_breakpoint)(CPUState *cpu, int type, vaddr addr, vaddr len); + int (*remove_breakpoint)(CPUState *cpu, int type, vaddr addr, vaddr len); void (*remove_all_breakpoints)(CPUState *cpu); }; From patchwork Thu Dec 8 15:35:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 631885 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp295549pvb; Thu, 8 Dec 2022 07:37:31 -0800 (PST) X-Google-Smtp-Source: AA0mqf4wQCbI/LuJpN6oEbqjQLLqn6X2tUMenDSNAYLADv0mNmLJaYjjpZ3b3VZcuW8ruSKrMA1y X-Received: by 2002:ac8:5ecd:0:b0:3a7:f2b0:c4b7 with SMTP id s13-20020ac85ecd000000b003a7f2b0c4b7mr3144906qtx.57.1670513850970; Thu, 08 Dec 2022 07:37:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670513850; cv=none; d=google.com; s=arc-20160816; b=cfsYAQiH8NrinkU7U2IwMZ8V7cjG9zXcJ0MEQMO2BT7si1UnRqUMgq4aqFS9iuuWn6 omnkVm5DJqgnCk7yHh1d95jG2ZYkOvbQA3BPxrMftqC34PiXUwlGwTcqReR6iTJXlPur mra4zZ8bRthZhxGN6eXIWXLEAuqZBgIXo45zpvN7R+S4NFUeis3YXUX2H96AcS1EEr60 pb5hwC0RKcPjquHbqkk6AazuSRDb8Nex490YAkjVJWS3TIwG7dm6993qOVHcmmpEL+m/ nkZQMxoqo2UHQM9uAePBU7/uNrlsnW1lOjdIa1w07v4YHekcPzsOrpG/huZo+7k3c5Aa eXew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=D0ClmvfrnC5uwLcCZt7jUcxr3DIHaRVyT4haTfqPSpU=; b=lR+Jlw89rFC+fd+xKrBPZcg4vhroSB62iS9LLvl4cI6LcAGpdopi5FCZE9Kvu4XgqQ AhxT5sZbX5HCBnzBBEnpSoqq/kYqBIxbT6M/glZww8WonAYuVSUcuNT50wVZihd0lr32 wnqR+erq1Rxn580QquYGQdBvL8A02LM28h2sQY7xFXjSNTCXGg+ZGu6qXgYEFJJ+ciHj 42kv/yK1naKNwWryyGYnIrjQtPKmvm1ClVLYSM2eGBJlFRR2eGsNXUGW7DSlgSZvljB9 A8GM7R4vd0vLmolzQcHxn4scWhtaaxQ5K2xrm6qlaR0dEGFlTJ39X4+KQUZGX/8dWlir MErQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XpzzT24i; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x13-20020a05622a000d00b003a51c600f39si13412911qtw.405.2022.12.08.07.37.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Dec 2022 07:37:30 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XpzzT24i; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p3IwE-0003QR-SD; Thu, 08 Dec 2022 10:35:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p3IwD-0003NJ-Qm for qemu-devel@nongnu.org; Thu, 08 Dec 2022 10:35:53 -0500 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 1p3IwB-0006WS-R7 for qemu-devel@nongnu.org; Thu, 08 Dec 2022 10:35:53 -0500 Received: by mail-wr1-x432.google.com with SMTP id h10so2058922wrx.3 for ; Thu, 08 Dec 2022 07:35:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=D0ClmvfrnC5uwLcCZt7jUcxr3DIHaRVyT4haTfqPSpU=; b=XpzzT24iw0ZShhQVX3SJQm+NbNuVucn667ZU54sKCPOK0bo92MkIa8N8QzmTVRSMiG 63sXpqwP5eWwHMzRp5h/eIy4/fAHBtcH1esawAN94i15yVrZWbbqOq05xGyTwX1c7Z+4 PtDqQRAUE4nhIt5gpAZOP8QMY3LgEenjva5NWuZGf9nUo1Sm+Jbrb8+z8uw/xgmVDXQV xFeuUkSgSPZl8YGm7PY+hm58cZEZyw5sa1kh1lqc2ow9wm5RFY127PL3NrBB0Hm2lrUq 8jX//1MakTmQCDQyIJgBRhc75hPe+dkaz+WQHZ17iqj+HCeSKopLcpqnT7QX36cAUue/ rshA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=D0ClmvfrnC5uwLcCZt7jUcxr3DIHaRVyT4haTfqPSpU=; b=UXMu8bKrjPdcmf8S4DBiVfdpoN12Wo55PVahWqeRlEDzNxD6V+EjtPv1NtiNHmAG3A U+KdW6pK5ELPJBKSkWFPcOrPf5xZ/S5nTFwX5P4PhJE60xyoMszm+XU55aG64fhQ1hTU AMcdToY12+nuX1wxhkRN7L2Eb2Nfw6eT0H0r3IDYAuUpC/zknRqhz597ST/uNbFlr3SC IkP3iYkc1rzDdhGmUtIASzlQmW+GM11E3L0QDGYej5tqVp+gArNO7PmRwTZMFdHNAq8E ZurVyBTBpZkTFU7IVdIvgM2ZHOW9t1T0Y2SZcAsBoJ82fL54xQ3yBHoZ96+gLIo6Oafl QCIg== X-Gm-Message-State: ANoB5pmzKMgD1MPevZzFI5TMlv7jItYp4OuvVSfw3UDryZPaZtRZ1/sg EGO2UvXzv96mVyERpXVSJfS57MbGgZz9gkk9xm4= X-Received: by 2002:adf:f145:0:b0:242:486:5037 with SMTP id y5-20020adff145000000b0024204865037mr1714207wro.32.1670513749928; Thu, 08 Dec 2022 07:35:49 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id t12-20020adfeb8c000000b0023662245d3csm22310885wrn.95.2022.12.08.07.35.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 08 Dec 2022 07:35:49 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Greg Kurz , Paolo Bonzini , David Gibson , kvm@vger.kernel.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Richard Henderson , "Edgar E. Iglesias" , Stafford Horne , Anton Johansson , =?utf-8?q?C=C3=A9dric_Le_Goater?= , qemu-ppc@nongnu.org, Eduardo Habkost , Chris Wulff , Yanan Wang , Fabiano Rosas , =?utf-8?q?Alex_Benn=C3=A9e?= , Marek Vasut , Max Filippov , Yoshinori Sato , Laurent Vivier , Daniel Henrique Barboza , Marcel Apfelbaum , Artyom Tarasenko Subject: [PATCH-for-8.0 v2 3/4] target/cpu: Restrict cpu_get_phys_page_debug() handlers to sysemu Date: Thu, 8 Dec 2022 16:35:27 +0100 Message-Id: <20221208153528.27238-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221208153528.27238-1-philmd@linaro.org> References: <20221208153528.27238-1-philmd@linaro.org> MIME-Version: 1.0 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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The 'hwaddr' type is only available / meaningful on system emulation. Signed-off-by: Philippe Mathieu-Daudé --- target/alpha/cpu.h | 2 +- target/cris/cpu.h | 3 +-- target/hppa/cpu.h | 2 +- target/m68k/cpu.h | 2 +- target/nios2/cpu.h | 2 +- target/openrisc/cpu.h | 3 ++- target/ppc/cpu.h | 2 +- target/rx/cpu.h | 2 +- target/rx/helper.c | 4 ++-- target/sh4/cpu.h | 2 +- target/sparc/cpu.h | 3 ++- target/xtensa/cpu.h | 2 +- 12 files changed, 15 insertions(+), 14 deletions(-) diff --git a/target/alpha/cpu.h b/target/alpha/cpu.h index d0abc949a8..5e67304d81 100644 --- a/target/alpha/cpu.h +++ b/target/alpha/cpu.h @@ -276,9 +276,9 @@ extern const VMStateDescription vmstate_alpha_cpu; 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); #endif /* !CONFIG_USER_ONLY */ void alpha_cpu_dump_state(CPUState *cs, FILE *f, int flags); -hwaddr alpha_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); int alpha_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int alpha_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); diff --git a/target/cris/cpu.h b/target/cris/cpu.h index e6776f25b1..71fa1f96e0 100644 --- a/target/cris/cpu.h +++ b/target/cris/cpu.h @@ -193,12 +193,11 @@ bool cris_cpu_exec_interrupt(CPUState *cpu, int int_req); bool cris_cpu_tlb_fill(CPUState *cs, vaddr address, int size, MMUAccessType access_type, int mmu_idx, bool probe, uintptr_t retaddr); +hwaddr cris_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); #endif void cris_cpu_dump_state(CPUState *cs, FILE *f, int flags); -hwaddr cris_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); - int crisv10_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int cris_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int cris_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 6f3b6beecf..b595ef25a9 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -322,11 +322,11 @@ static inline void cpu_hppa_change_prot_id(CPUHPPAState *env) { } void cpu_hppa_change_prot_id(CPUHPPAState *env); #endif -hwaddr hppa_cpu_get_phys_page_debug(CPUState *cs, vaddr addr); int hppa_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); 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 +hwaddr hppa_cpu_get_phys_page_debug(CPUState *cs, vaddr addr); bool hppa_cpu_tlb_fill(CPUState *cs, vaddr address, int size, MMUAccessType access_type, int mmu_idx, bool probe, uintptr_t retaddr); diff --git a/target/m68k/cpu.h b/target/m68k/cpu.h index 3a9cfe2f33..68ed531fc3 100644 --- a/target/m68k/cpu.h +++ b/target/m68k/cpu.h @@ -176,9 +176,9 @@ struct ArchCPU { #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); #endif /* !CONFIG_USER_ONLY */ void m68k_cpu_dump_state(CPUState *cpu, FILE *f, int flags); -hwaddr m68k_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); int m68k_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int m68k_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h index f85581ee56..2f43b67a8f 100644 --- a/target/nios2/cpu.h +++ b/target/nios2/cpu.h @@ -262,7 +262,6 @@ void nios2_tcg_init(void); void nios2_cpu_do_interrupt(CPUState *cs); void dump_mmu(CPUNios2State *env); void nios2_cpu_dump_state(CPUState *cpu, FILE *f, int flags); -hwaddr nios2_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); G_NORETURN void nios2_cpu_do_unaligned_access(CPUState *cpu, vaddr addr, MMUAccessType access_type, int mmu_idx, uintptr_t retaddr); @@ -288,6 +287,7 @@ static inline int cpu_mmu_index(CPUNios2State *env, bool ifetch) } #ifndef CONFIG_USER_ONLY +hwaddr nios2_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); bool nios2_cpu_tlb_fill(CPUState *cs, vaddr address, int size, MMUAccessType access_type, int mmu_idx, bool probe, uintptr_t retaddr); diff --git a/target/openrisc/cpu.h b/target/openrisc/cpu.h index 1d5efa5ca2..31a4ae5ad3 100644 --- a/target/openrisc/cpu.h +++ b/target/openrisc/cpu.h @@ -312,7 +312,6 @@ struct ArchCPU { void cpu_openrisc_list(void); void openrisc_cpu_dump_state(CPUState *cpu, FILE *f, int flags); -hwaddr openrisc_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); int openrisc_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int openrisc_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); void openrisc_translate_init(void); @@ -321,6 +320,8 @@ int print_insn_or1k(bfd_vma addr, disassemble_info *info); #define cpu_list cpu_openrisc_list #ifndef CONFIG_USER_ONLY +hwaddr openrisc_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); + bool openrisc_cpu_tlb_fill(CPUState *cs, vaddr address, int size, MMUAccessType access_type, int mmu_idx, bool probe, uintptr_t retaddr); diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 81d4263a07..6a7a8634da 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -1346,12 +1346,12 @@ static inline bool vhyp_cpu_in_nested(PowerPCCPU *cpu) #endif /* CONFIG_USER_ONLY */ void ppc_cpu_dump_state(CPUState *cpu, FILE *f, int flags); -hwaddr ppc_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); int ppc_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int ppc_cpu_gdb_read_register_apple(CPUState *cpu, GByteArray *buf, int reg); int ppc_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); int ppc_cpu_gdb_write_register_apple(CPUState *cpu, uint8_t *buf, int reg); #ifndef CONFIG_USER_ONLY +hwaddr ppc_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); void ppc_gdb_gen_spr_xml(PowerPCCPU *cpu); const char *ppc_gdb_get_dynamic_xml(CPUState *cs, const char *xml_name); #endif diff --git a/target/rx/cpu.h b/target/rx/cpu.h index 5655dffeff..555d230f24 100644 --- a/target/rx/cpu.h +++ b/target/rx/cpu.h @@ -123,11 +123,11 @@ const char *rx_crname(uint8_t cr); #ifndef CONFIG_USER_ONLY 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); #endif /* !CONFIG_USER_ONLY */ 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); -hwaddr rx_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); void rx_translate_init(void); void rx_cpu_list(void); diff --git a/target/rx/helper.c b/target/rx/helper.c index f34945e7e2..dad5fb4976 100644 --- a/target/rx/helper.c +++ b/target/rx/helper.c @@ -144,9 +144,9 @@ bool rx_cpu_exec_interrupt(CPUState *cs, int interrupt_request) return false; } -#endif /* !CONFIG_USER_ONLY */ - hwaddr rx_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) { return addr; } + +#endif /* !CONFIG_USER_ONLY */ diff --git a/target/sh4/cpu.h b/target/sh4/cpu.h index 727b829598..02bfd612ea 100644 --- a/target/sh4/cpu.h +++ b/target/sh4/cpu.h @@ -214,7 +214,6 @@ struct ArchCPU { void superh_cpu_dump_state(CPUState *cpu, FILE *f, int flags); -hwaddr superh_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); int superh_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int superh_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); G_NORETURN void superh_cpu_do_unaligned_access(CPUState *cpu, vaddr addr, @@ -225,6 +224,7 @@ void sh4_translate_init(void); void sh4_cpu_list(void); #if !defined(CONFIG_USER_ONLY) +hwaddr superh_cpu_get_phys_page_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 e478c5eb16..ed0069d0b1 100644 --- a/target/sparc/cpu.h +++ b/target/sparc/cpu.h @@ -569,10 +569,11 @@ struct ArchCPU { #ifndef CONFIG_USER_ONLY extern const VMStateDescription vmstate_sparc_cpu; + +hwaddr sparc_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); #endif void sparc_cpu_do_interrupt(CPUState *cpu); -hwaddr sparc_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); int sparc_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int sparc_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); G_NORETURN void sparc_cpu_do_unaligned_access(CPUState *cpu, vaddr addr, diff --git a/target/xtensa/cpu.h b/target/xtensa/cpu.h index 579adcb769..b7a54711a6 100644 --- a/target/xtensa/cpu.h +++ b/target/xtensa/cpu.h @@ -576,9 +576,9 @@ void xtensa_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, vaddr addr, unsigned size, MMUAccessType access_type, int mmu_idx, MemTxAttrs attrs, MemTxResult response, uintptr_t retaddr); +hwaddr xtensa_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); #endif void xtensa_cpu_dump_state(CPUState *cpu, FILE *f, int flags); -hwaddr xtensa_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); void xtensa_count_regs(const XtensaConfig *config, unsigned *n_regs, unsigned *n_core_regs); int xtensa_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); From patchwork Thu Dec 8 15:35:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 631886 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp296257pvb; Thu, 8 Dec 2022 07:38:54 -0800 (PST) X-Google-Smtp-Source: AA0mqf6JSEGZncRAjnIJU/311E2JQe28dxpgSgYPmJw5yVVTXcpXqEHbBB3xIQUeEK5Y8HN2i3GD X-Received: by 2002:ac8:1085:0:b0:3a5:4b28:f4b0 with SMTP id a5-20020ac81085000000b003a54b28f4b0mr3022470qtj.68.1670513934362; Thu, 08 Dec 2022 07:38:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670513934; cv=none; d=google.com; s=arc-20160816; b=A7lMEVAvPNa/2TlAfKvEVSBZ82IKrworcNjroyPfycrx+p/3BPI6TNMD39bTFoRPxt 2WfybMQZzUDfFFbwPO6h/V8WccRIeAePIgA+2BHgrjp/MzxBZODBYz2V8xt7aeulLP7t LNnDbaf8la1SySADP2uU7w4gvY2AkALMqJI7WTj8lDt0EKzgk/3vfrzhdcsiLcu59hnR OCvYjS9q78l5LpjFp3LwBuXsz5FxDdpXlRwnFauQVRpsCwhLzYGnCmYXXDnqRB9CRQG/ Nhurr8D/zoqSzSbnTGTZz+IR4ZyxhimNsATY9vCGSSLsRN52Un/AyOiCdFfp22w6E2kZ MWtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZuF4jChtlBjy8dKWVe0vYW0pjpjwZ/qKs1pftyTULhE=; b=f6lcFinHfka97M1/fY+dKVbHPmwxq7uske63wMHQvTs2S8hwAqX7vIWA1ANUpVGUQD 1Mb4e7m9OYtoqBAt3k1Vq+zV6Mn9LJLESOrIcV/qhiP8tZCg5dEiXLFE10lG8BvbSp5T VmSDp05cAcwL8U5tlm9TK1jMd5gIHd+oN5ISjZDNURAdJpnId2ZeQamF/TkNEFgHY002 wKdVXlfALqvceSeQJfhgmFL038Pd3X3vaNTgZ+UXg6PgbCZ/nzAKocxc9zKJKdH4n6zQ y04Olf8M+LU2SzLnBhtTDUOAiPk722uzl1wrxVkrhdd0OFOUjtNhxUlKYBndIrUXP1aq uEJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dO1rVy8a; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v16-20020a05622a189000b003a5591ca0b1si12683792qtc.521.2022.12.08.07.38.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Dec 2022 07:38:54 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dO1rVy8a; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p3IwK-0003SN-F6; Thu, 08 Dec 2022 10:36:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p3IwI-0003Rc-OB for qemu-devel@nongnu.org; Thu, 08 Dec 2022 10:35:58 -0500 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 1p3IwH-0006Gp-8y for qemu-devel@nongnu.org; Thu, 08 Dec 2022 10:35:58 -0500 Received: by mail-wm1-x329.google.com with SMTP id v7so1355680wmn.0 for ; Thu, 08 Dec 2022 07:35:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=ZuF4jChtlBjy8dKWVe0vYW0pjpjwZ/qKs1pftyTULhE=; b=dO1rVy8a1UmJNv0075+sKdleWJ0ZBR1e/UgGlysFXEGorO8mWuMdwXUEfXsAxNBZ7N qNsS71jo9driQdFOJfvuDDoM4z1PHZ8Oy1Jaa/rj+eCYaVzx71FwSeK1ISFeRL7U5KAA 89Z988n/DMgUtsS5QrNmwOleyUXYykdhU6LzJ7/yXucBtt0FgLSG8R5FXi4EunqQTZRv FR/1/EYdxhbIRQU3fsC9yqne/3YvCIye5fAxc7srypsYFoDgrfrnuuB4xMGGf0CPwB/S hrw7s4KyxuvIWWGMmRzNxdcZMb+JQ8mMq/6Sy1gp68NQEExE5BHewvPSaX5MrozUllb0 Lb3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZuF4jChtlBjy8dKWVe0vYW0pjpjwZ/qKs1pftyTULhE=; b=7/y8gHBkOTYTmukj2GG1m9XX8mGvPwNWGJIgAOPsP/KXZ0MzCX7fmUt91GvyY0YrID R3JoUtaoeHbvuz6I60yCZGlXbZ5D9dHB/kDmtkZENDctjzZNy8BGxMeDMNQtDMCVAaL7 8KAeDT3lEm0XK3t1Wgg+uVxDSpDvIPyfc08G63FNfA619Evi2sZbQ80wZoSH6aAIOJDd nRB+1gJlz/Kx2ehxT18fuy61M0YIcX34Ww/creI/6Q1dW5tNn4WmchFdu6+imeBwimbP NBSG6LX4SSDDCzR3EXRDPxcfxWOAwdWthUuMTJV4ODxMw97wlEDy67ZnWNdIVihQNU3B tMeQ== X-Gm-Message-State: ANoB5pl+uahEskQ7xkMzWBHLerk7SFKyb6+j9WgQJpdZlX/C/idZTzOj u3A9B96SP4BrHbuxu8dQcXoLVipD2g6f6YpW2LI= X-Received: by 2002:a1c:7c15:0:b0:3cf:7197:e67c with SMTP id x21-20020a1c7c15000000b003cf7197e67cmr2335687wmc.25.1670513756301; Thu, 08 Dec 2022 07:35:56 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id 16-20020a05600c021000b003d1e4f3ac8esm5089704wmi.33.2022.12.08.07.35.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 08 Dec 2022 07:35:55 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Greg Kurz , Paolo Bonzini , David Gibson , kvm@vger.kernel.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Richard Henderson , "Edgar E. Iglesias" , Stafford Horne , Anton Johansson , =?utf-8?q?C=C3=A9dric_Le_Goater?= , qemu-ppc@nongnu.org, Eduardo Habkost , Chris Wulff , Yanan Wang , Fabiano Rosas , =?utf-8?q?Alex_Benn=C3=A9e?= , Marek Vasut , Max Filippov , Yoshinori Sato , Laurent Vivier , Daniel Henrique Barboza , Marcel Apfelbaum , Artyom Tarasenko Subject: [PATCH-for-8.0 v2 4/4] target/sparc/sysemu: Remove pointless CONFIG_USER_ONLY guard Date: Thu, 8 Dec 2022 16:35:28 +0100 Message-Id: <20221208153528.27238-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221208153528.27238-1-philmd@linaro.org> References: <20221208153528.27238-1-philmd@linaro.org> MIME-Version: 1.0 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Commit caac44a52a ("target/sparc: Make sparc_cpu_tlb_fill sysemu only") restricted mmu_helper.c to system emulation. Checking whether CONFIG_USER_ONLY is defined is now pointless. Signed-off-by: Philippe Mathieu-Daudé --- target/sparc/mmu_helper.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/sparc/mmu_helper.c b/target/sparc/mmu_helper.c index 919448a494..a7e51e4b7d 100644 --- a/target/sparc/mmu_helper.c +++ b/target/sparc/mmu_helper.c @@ -924,7 +924,6 @@ hwaddr sparc_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) return phys_addr; } -#ifndef CONFIG_USER_ONLY G_NORETURN void sparc_cpu_do_unaligned_access(CPUState *cs, vaddr addr, MMUAccessType access_type, int mmu_idx, @@ -942,4 +941,3 @@ G_NORETURN void sparc_cpu_do_unaligned_access(CPUState *cs, vaddr addr, cpu_raise_exception_ra(env, TT_UNALIGNED, retaddr); } -#endif /* !CONFIG_USER_ONLY */