From nobody Fri May 17 03:39:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1689973232; cv=none; d=zohomail.com; s=zohoarc; b=MhcsVm2ct8gwLl2ufqtVatlI/xOQGEv590Z+o/g5zSVxiZPSp82MTaCPtGvx4+ft5mkkHvaJdUhGuLqF8K3iQYFWrQvwwePUtTWHIa0MynILH7EOJPe/dzartDa1Qn+zcV0vt83b/ExQ6ZCGm0kk7Y2JnaZruYLg0qUWvTZJPUg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689973232; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=Zbi48NxQvipXaInK+Zcp7fdV2J2dAjKOdiliJlNfLPs=; b=h0i59qpZr+wN2H9j6rfpjq2mMd1S+/G0Y4KZpVBpOfsx1Qb/rHwShxFZI/bkaRGxnBCAJ53tRODMV2rFAKzgpEyKkH9RbD1Wn4v0i/xfW0al6kSH7nkxgmsAe05x0jEXe5tb3VEp1+gAnjoiyzXIJgN1Ls8NbCh8Uc7+4b7AmKo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1689973232341477.9792788033003; Fri, 21 Jul 2023 14:00:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qMxD8-0006Vh-BZ; Fri, 21 Jul 2023 16:58:50 -0400 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 1qMxD5-0006Id-EE for qemu-devel@nongnu.org; Fri, 21 Jul 2023 16:58:47 -0400 Received: from rev.ng ([5.9.113.41]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qMxD3-0004PV-GP for qemu-devel@nongnu.org; Fri, 21 Jul 2023 16:58:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=rev.ng; s=dkim; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Zbi48NxQvipXaInK+Zcp7fdV2J2dAjKOdiliJlNfLPs=; b=cB0U2h89mRfwrOlhZ+Lh8vdggL izeZc7/giOWswigs5b6k9SsA4Pj7VdH2rNSMgVd7o9feXTEiXzkNZJJKstsg5oRmSd/z82cHYv7uO 54Vn5+wIeXEjAs3frui+S7kSLwf+CY44My71z6GLe/6XBI2uiVoDKLxJB+KvuWZ0HMMA=; To: qemu-devel@nongnu.org Cc: ale@rev.ng, richard.henderson@linaro.org, pbonzini@redhat.com, philmd@linaro.org, agraf@csgraf.de, dirty@apple.com, rbolshakov@ddn.com, anielhb413@gmail.com, pasic@linux.ibm.com, borntraeger@linux.ibm.com, palmer@dabbelt.com, alistair.francis@wdc.com, bin.meng@windriver.com, ysato@users.sourceforge.jp, peter.maydell@linaro.org Subject: [PATCH 1/9] accel/kvm: Widen pc/saved_insn for kvm_sw_breakpoint Date: Fri, 21 Jul 2023 22:58:19 +0200 Message-ID: <20230721205827.7502-2-anjo@rev.ng> In-Reply-To: <20230721205827.7502-1-anjo@rev.ng> References: <20230721205827.7502-1-anjo@rev.ng> 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=lists.gnu.org; Received-SPF: pass client-ip=5.9.113.41; envelope-from=anjo@rev.ng; helo=rev.ng 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Reply-to: Anton Johansson From: Anton Johansson via Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1689973232713100001 Content-Type: text/plain; charset="utf-8" Widens the pc and saved_insn fields of kvm_sw_breakpoint from target_ulong to vaddr. The pc argument of kvm_find_sw_breakpoint is also widened to match. Signed-off-by: Anton Johansson Reviewed-by: Richard Henderson --- include/sysemu/kvm.h | 6 +++--- accel/kvm/kvm-all.c | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index 115f0cca79..5670306dbf 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -411,14 +411,14 @@ struct kvm_guest_debug; struct kvm_debug_exit_arch; =20 struct kvm_sw_breakpoint { - target_ulong pc; - target_ulong saved_insn; + vaddr pc; + vaddr saved_insn; int use_count; QTAILQ_ENTRY(kvm_sw_breakpoint) entry; }; =20 struct kvm_sw_breakpoint *kvm_find_sw_breakpoint(CPUState *cpu, - target_ulong pc); + vaddr pc); =20 int kvm_sw_breakpoints_active(CPUState *cpu); =20 diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 373d876c05..3a5f71b48a 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -3306,8 +3306,7 @@ bool kvm_arm_supports_user_irq(void) } =20 #ifdef KVM_CAP_SET_GUEST_DEBUG -struct kvm_sw_breakpoint *kvm_find_sw_breakpoint(CPUState *cpu, - target_ulong pc) +struct kvm_sw_breakpoint *kvm_find_sw_breakpoint(CPUState *cpu, vaddr pc) { struct kvm_sw_breakpoint *bp; =20 --=20 2.41.0 From nobody Fri May 17 03:39:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1689973207; cv=none; d=zohomail.com; s=zohoarc; b=JiGUZzpOhd48km6gSDjoQJSSbPfNN7snyKlJK9YzeuIXcsZtBy8pddG57jSiupoBgL6Rmmc2j7o1V6fO/8ENhCRT8ptptRr6KJku38IyFqjsi/W31QUR/ZjUUGgO9Is813kfUwPkCCXgFnqf7QEujOrjmRzS++Zh0hdwiY2YR9k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689973207; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=dTZAwIQ8rYhXY9pnXJW2GSw7mck2eo4ddqyZcFZBI0g=; b=P8vWJ2C/LTqpCSmPtS+ET28HWdj4Nevzwxa92dyqnqbkMwK5kJj1qzPZZpNqbTEO4GeYSQrVuVVKj7bNww9CDBxpc1X+666bdEFqT2XP1ACp0LnaXqTOxR68gdMFrX2UiNTCqgAELy5Vn/ZyUtant/A5jxRoxdlRCnI2VhdLzMM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1689973207167696.3005659862084; Fri, 21 Jul 2023 14:00:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qMxD8-0006X1-Lf; Fri, 21 Jul 2023 16:58:50 -0400 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 1qMxD6-0006Nn-U5 for qemu-devel@nongnu.org; Fri, 21 Jul 2023 16:58:48 -0400 Received: from rev.ng ([5.9.113.41]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qMxD5-0004Pk-EF for qemu-devel@nongnu.org; Fri, 21 Jul 2023 16:58:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=rev.ng; s=dkim; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=dTZAwIQ8rYhXY9pnXJW2GSw7mck2eo4ddqyZcFZBI0g=; b=SgfbXA62d2+9VHyFlllPNMyRr+ M0N5ucP0JLKF/NsuINVcrMernbfOlxhM+h7oAfjvSJdH+aWcMUF/kSqqGBzOQ1GKp2Dw9Y2C6CeA+ dGBIPKyG6FxoeioqJTMTtLfOtzG2KTRdjkFs0Kbsd1VbB7mjybxXh8uaYhPsiilffu/Q=; To: qemu-devel@nongnu.org Cc: ale@rev.ng, richard.henderson@linaro.org, pbonzini@redhat.com, philmd@linaro.org, agraf@csgraf.de, dirty@apple.com, rbolshakov@ddn.com, anielhb413@gmail.com, pasic@linux.ibm.com, borntraeger@linux.ibm.com, palmer@dabbelt.com, alistair.francis@wdc.com, bin.meng@windriver.com, ysato@users.sourceforge.jp, peter.maydell@linaro.org Subject: [PATCH 2/9] accel/hvf: Widen pc/saved_insn for hvf_sw_breakpoint Date: Fri, 21 Jul 2023 22:58:20 +0200 Message-ID: <20230721205827.7502-3-anjo@rev.ng> In-Reply-To: <20230721205827.7502-1-anjo@rev.ng> References: <20230721205827.7502-1-anjo@rev.ng> 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=lists.gnu.org; Received-SPF: pass client-ip=5.9.113.41; envelope-from=anjo@rev.ng; helo=rev.ng 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Reply-to: Anton Johansson From: Anton Johansson via Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1689973208514100003 Content-Type: text/plain; charset="utf-8" Widens the pc and saved_insn fields of hvf_sw_breakpoint from target_ulong to vaddr. Other hvf_* functions accessing hvf_sw_breakpoint are also widened to match. Signed-off-by: Anton Johansson Reviewed-by: Richard Henderson --- include/sysemu/hvf.h | 6 +++--- accel/hvf/hvf-accel-ops.c | 4 ++-- accel/hvf/hvf-all.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/sysemu/hvf.h b/include/sysemu/hvf.h index 70549b9158..4cbae87ced 100644 --- a/include/sysemu/hvf.h +++ b/include/sysemu/hvf.h @@ -39,14 +39,14 @@ DECLARE_INSTANCE_CHECKER(HVFState, HVF_STATE, =20 #ifdef NEED_CPU_H struct hvf_sw_breakpoint { - target_ulong pc; - target_ulong saved_insn; + vaddr pc; + vaddr saved_insn; int use_count; QTAILQ_ENTRY(hvf_sw_breakpoint) entry; }; =20 struct hvf_sw_breakpoint *hvf_find_sw_breakpoint(CPUState *cpu, - target_ulong pc); + vaddr pc); int hvf_sw_breakpoints_active(CPUState *cpu); =20 int hvf_arch_insert_sw_breakpoint(CPUState *cpu, struct hvf_sw_breakpoint = *bp); diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-ops.c index a44cf1c144..3c94c79747 100644 --- a/accel/hvf/hvf-accel-ops.c +++ b/accel/hvf/hvf-accel-ops.c @@ -474,7 +474,7 @@ static void hvf_start_vcpu_thread(CPUState *cpu) cpu, QEMU_THREAD_JOINABLE); } =20 -static int hvf_insert_breakpoint(CPUState *cpu, int type, hwaddr addr, hwa= ddr len) +static int hvf_insert_breakpoint(CPUState *cpu, int type, vaddr addr, vadd= r len) { struct hvf_sw_breakpoint *bp; int err; @@ -512,7 +512,7 @@ static int hvf_insert_breakpoint(CPUState *cpu, int typ= e, hwaddr addr, hwaddr le return 0; } =20 -static int hvf_remove_breakpoint(CPUState *cpu, int type, hwaddr addr, hwa= ddr len) +static int hvf_remove_breakpoint(CPUState *cpu, int type, vaddr addr, vadd= r len) { struct hvf_sw_breakpoint *bp; int err; diff --git a/accel/hvf/hvf-all.c b/accel/hvf/hvf-all.c index 4920787af6..db05b81be5 100644 --- a/accel/hvf/hvf-all.c +++ b/accel/hvf/hvf-all.c @@ -51,7 +51,7 @@ void assert_hvf_ok(hv_return_t ret) abort(); } =20 -struct hvf_sw_breakpoint *hvf_find_sw_breakpoint(CPUState *cpu, target_ulo= ng pc) +struct hvf_sw_breakpoint *hvf_find_sw_breakpoint(CPUState *cpu, vaddr pc) { struct hvf_sw_breakpoint *bp; =20 --=20 2.41.0 From nobody Fri May 17 03:39:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1689973148; cv=none; d=zohomail.com; s=zohoarc; b=iMhAJnT2LAX+qaBA6udaQSPskrHJDSh6jZqDVJwz7hdtcoPTpq5r+a1XCSBQAW6RifYIEhtCEf94xhkhPUGlgPwDGS8ayt0iKyEyw79wTl3KHl3hqNle72PQHROvMk6IqH0WntCRRneyV7zmm/CeCbAv2NREVw5Nng6v9kYXs5E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689973148; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=qSenWqYuSyNh/q18xmnP8IHpN6vsuEpnmfFbwQmxats=; b=Tl+0zYVAVvuYdtNnk3xVOPRr65hnIQ09L7SpgZKkV2FZGHXP0vYrtXfdJqrhs8WI7FJGOs9S8iTeU8iJ2yw3Hf/RuFPCloAZZQffeuuewFntvBlUK8WBpVPT5uCnAzc9u0M69tQKiSRIY2z1x2+vWy1ZnCM29TlbbLS4T92hL1g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16899731481001004.2769777868397; Fri, 21 Jul 2023 13:59:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qMxDB-0006aN-Fy; Fri, 21 Jul 2023 16:58:53 -0400 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 1qMxD9-0006ZD-HZ for qemu-devel@nongnu.org; Fri, 21 Jul 2023 16:58:51 -0400 Received: from rev.ng ([5.9.113.41]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qMxD7-0004Pp-Nx for qemu-devel@nongnu.org; Fri, 21 Jul 2023 16:58:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=rev.ng; s=dkim; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=qSenWqYuSyNh/q18xmnP8IHpN6vsuEpnmfFbwQmxats=; b=BscVv8RmklIbGSx5Vir97Gswzb TVLpYxiAGovufPIcsfwpp1gBjeCOM9UN1nPSZR69N7pNFDpOFMQHgZQlZVVme4fmGkm8GBZW35Ltd fpFK5pumTRkna7v7u5QeWlSX8+XrYUHm0IsQXOW02hY7SeaYctRqZS3svJS6a8xzXlOc=; To: qemu-devel@nongnu.org Cc: ale@rev.ng, richard.henderson@linaro.org, pbonzini@redhat.com, philmd@linaro.org, agraf@csgraf.de, dirty@apple.com, rbolshakov@ddn.com, anielhb413@gmail.com, pasic@linux.ibm.com, borntraeger@linux.ibm.com, palmer@dabbelt.com, alistair.francis@wdc.com, bin.meng@windriver.com, ysato@users.sourceforge.jp, peter.maydell@linaro.org Subject: [PATCH 3/9] target: Use vaddr for kvm_arch_[insert|remove]_hw_breakpoint Date: Fri, 21 Jul 2023 22:58:21 +0200 Message-ID: <20230721205827.7502-4-anjo@rev.ng> In-Reply-To: <20230721205827.7502-1-anjo@rev.ng> References: <20230721205827.7502-1-anjo@rev.ng> 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=lists.gnu.org; Received-SPF: pass client-ip=5.9.113.41; envelope-from=anjo@rev.ng; helo=rev.ng 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Reply-to: Anton Johansson From: Anton Johansson via Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1689973150475100003 Content-Type: text/plain; charset="utf-8" Changes the signature of the target-defined functions for inserting/removing kvm hw breakpoints. The address and length arguments are now of vaddr type, which both matches the type used internally in accel/kvm/kvm-all.c and makes the api target-agnostic. Signed-off-by: Anton Johansson --- include/sysemu/kvm.h | 6 ++---- target/arm/kvm64.c | 16 ++++++++-------- target/i386/kvm/kvm.c | 15 +++++++-------- target/ppc/kvm.c | 15 +++++++-------- target/s390x/kvm/kvm.c | 11 +++++------ 5 files changed, 29 insertions(+), 34 deletions(-) diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index 5670306dbf..19d87b20e8 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -426,10 +426,8 @@ int kvm_arch_insert_sw_breakpoint(CPUState *cpu, struct kvm_sw_breakpoint *bp); int kvm_arch_remove_sw_breakpoint(CPUState *cpu, struct kvm_sw_breakpoint *bp); -int kvm_arch_insert_hw_breakpoint(target_ulong addr, - target_ulong len, int type); -int kvm_arch_remove_hw_breakpoint(target_ulong addr, - target_ulong len, int type); +int kvm_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type); +int kvm_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type); void kvm_arch_remove_all_hw_breakpoints(void); =20 void kvm_arch_update_guest_debug(CPUState *cpu, struct kvm_guest_debug *db= g); diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c index 94bbd9661f..c0750792cb 100644 --- a/target/arm/kvm64.c +++ b/target/arm/kvm64.c @@ -49,32 +49,32 @@ void kvm_arm_init_debug(KVMState *s) return; } =20 -int kvm_arch_insert_hw_breakpoint(target_ulong addr, - target_ulong len, int type) +int kvm_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type) { switch (type) { case GDB_BREAKPOINT_HW: - return insert_hw_breakpoint(addr); + return insert_hw_breakpoint((target_ulong) addr); break; case GDB_WATCHPOINT_READ: case GDB_WATCHPOINT_WRITE: case GDB_WATCHPOINT_ACCESS: - return insert_hw_watchpoint(addr, len, type); + return insert_hw_watchpoint((target_ulong) addr, + (target_ulong) len, type); default: return -ENOSYS; } } =20 -int kvm_arch_remove_hw_breakpoint(target_ulong addr, - target_ulong len, int type) +int kvm_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type) { switch (type) { case GDB_BREAKPOINT_HW: - return delete_hw_breakpoint(addr); + return delete_hw_breakpoint((target_ulong) addr); case GDB_WATCHPOINT_READ: case GDB_WATCHPOINT_WRITE: case GDB_WATCHPOINT_ACCESS: - return delete_hw_watchpoint(addr, len, type); + return delete_hw_watchpoint((target_ulong) addr, + (target_ulong) len, type); default: return -ENOSYS; } diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index ebfaf3d24c..4c237083e5 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -4995,7 +4995,7 @@ MemTxAttrs kvm_arch_post_run(CPUState *cpu, struct kv= m_run *run) kvm_rate_limit_on_bus_lock(); } =20 -#ifdef CONFIG_XEN_EMU =20 +#ifdef CONFIG_XEN_EMU /* * If the callback is asserted as a GSI (or PCI INTx) then check if * vcpu_info->evtchn_upcall_pending has been cleared, and deassert @@ -5156,8 +5156,7 @@ static int find_hw_breakpoint(target_ulong addr, int = len, int type) return -1; } =20 -int kvm_arch_insert_hw_breakpoint(target_ulong addr, - target_ulong len, int type) +int kvm_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type) { switch (type) { case GDB_BREAKPOINT_HW: @@ -5189,20 +5188,20 @@ int kvm_arch_insert_hw_breakpoint(target_ulong addr, if (find_hw_breakpoint(addr, len, type) >=3D 0) { return -EEXIST; } - hw_breakpoint[nb_hw_breakpoint].addr =3D addr; - hw_breakpoint[nb_hw_breakpoint].len =3D len; + hw_breakpoint[nb_hw_breakpoint].addr =3D (target_ulong) addr; + hw_breakpoint[nb_hw_breakpoint].len =3D (int) len; hw_breakpoint[nb_hw_breakpoint].type =3D type; nb_hw_breakpoint++; =20 return 0; } =20 -int kvm_arch_remove_hw_breakpoint(target_ulong addr, - target_ulong len, int type) +int kvm_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type) { int n; =20 - n =3D find_hw_breakpoint(addr, (type =3D=3D GDB_BREAKPOINT_HW) ? 1 : l= en, type); + n =3D find_hw_breakpoint((target_ulong) addr, + (type =3D=3D GDB_BREAKPOINT_HW) ? 1 : len, type= ); if (n < 0) { return -ENOENT; } diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index a8a935e267..7ff88d341a 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -1444,15 +1444,15 @@ static int find_hw_watchpoint(target_ulong addr, in= t *flag) return -1; } =20 -int kvm_arch_insert_hw_breakpoint(target_ulong addr, - target_ulong len, int type) +int kvm_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type) { - if ((nb_hw_breakpoint + nb_hw_watchpoint) >=3D ARRAY_SIZE(hw_debug_poi= nts)) { + const unsigned breakpoint_index =3D nb_hw_breakpoint + nb_hw_watchpoin= t; + if (breakpoint_index >=3D ARRAY_SIZE(hw_debug_points)) { return -ENOBUFS; } =20 - hw_debug_points[nb_hw_breakpoint + nb_hw_watchpoint].addr =3D addr; - hw_debug_points[nb_hw_breakpoint + nb_hw_watchpoint].type =3D type; + hw_debug_points[breakpoint_index].addr =3D (target_ulong) addr; + hw_debug_points[breakpoint_index].type =3D type; =20 switch (type) { case GDB_BREAKPOINT_HW: @@ -1488,12 +1488,11 @@ int kvm_arch_insert_hw_breakpoint(target_ulong addr, return 0; } =20 -int kvm_arch_remove_hw_breakpoint(target_ulong addr, - target_ulong len, int type) +int kvm_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type) { int n; =20 - n =3D find_hw_breakpoint(addr, type); + n =3D find_hw_breakpoint((target_ulong) addr, type); if (n < 0) { return -ENOENT; } diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c index a9e5880349..c7c96b4198 100644 --- a/target/s390x/kvm/kvm.c +++ b/target/s390x/kvm/kvm.c @@ -995,8 +995,7 @@ static int insert_hw_breakpoint(target_ulong addr, int = len, int type) return 0; } =20 -int kvm_arch_insert_hw_breakpoint(target_ulong addr, - target_ulong len, int type) +int kvm_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type) { switch (type) { case GDB_BREAKPOINT_HW: @@ -1011,14 +1010,14 @@ int kvm_arch_insert_hw_breakpoint(target_ulong addr, default: return -ENOSYS; } - return insert_hw_breakpoint(addr, len, type); + return insert_hw_breakpoint((target_ulong) addr, (target_ulong) len, t= ype); } =20 -int kvm_arch_remove_hw_breakpoint(target_ulong addr, - target_ulong len, int type) +int kvm_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type) { int size; - struct kvm_hw_breakpoint *bp =3D find_hw_breakpoint(addr, len, type); + struct kvm_hw_breakpoint *bp =3D find_hw_breakpoint((target_ulong) add= r, + (target_ulong) len, = type); =20 if (bp =3D=3D NULL) { return -ENOENT; --=20 2.41.0 From nobody Fri May 17 03:39:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1689973160; cv=none; d=zohomail.com; s=zohoarc; b=a8jQBcJuW6ks72DSVNaeGE5KL3FcmTYvboHEx76lehHQOCGyQTrXqd6Jk7A6HYNw6CkzFytNFhDqIYAL5E7cOLh1IKHf6nComdOJEAXVvghdzRm54dFmPVz7QEQfGeXzo2LGcv426CrY3vdG+I42GiS+TT1oUGpBPb7n5x+1aKU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689973160; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=sGnqufgoauuHGtPkq1UwjlQLPW0+8ZgFaT887U6mb4M=; b=S2iA6fxTdYsFh/V8xyYxUHJ36B6TNSh5e7Ztt0c2Xa4wJFo2kYJ/G0pTbMZJOAOhGFrlXpMeNd4b6VvR2GSp/m8/EO9JUkich2QzFeOFvYle/LWC0Or1Ucay7VXEZpQX6gThxjtmzOlSWJV5XEml1VnGGTJ0GN4VLr1hmX+e6ho= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1689973160522165.39672789557403; Fri, 21 Jul 2023 13:59:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qMxD9-0006YJ-2u; Fri, 21 Jul 2023 16:58:51 -0400 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 1qMxD6-0006MU-KP for qemu-devel@nongnu.org; Fri, 21 Jul 2023 16:58:48 -0400 Received: from rev.ng ([5.9.113.41]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qMxD3-0004Q0-VE for qemu-devel@nongnu.org; Fri, 21 Jul 2023 16:58:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=rev.ng; s=dkim; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=sGnqufgoauuHGtPkq1UwjlQLPW0+8ZgFaT887U6mb4M=; b=i+IqiY1y9mMEESz5ytW51K4Psv Ue1YpHcKoQfjz+P6jrgfw0h9YDMPoYdnaPZoKP/d2ug4TWVmAYRkDXDexT9zUb1vpCoilGskc57ui 7zmzuhAlkFdlltcAgoAKUB+Rw5q4zk6zYtcRPhaw+oNWiJXE4YSna9fTySJLwB8goLq0=; To: qemu-devel@nongnu.org Cc: ale@rev.ng, richard.henderson@linaro.org, pbonzini@redhat.com, philmd@linaro.org, agraf@csgraf.de, dirty@apple.com, rbolshakov@ddn.com, anielhb413@gmail.com, pasic@linux.ibm.com, borntraeger@linux.ibm.com, palmer@dabbelt.com, alistair.francis@wdc.com, bin.meng@windriver.com, ysato@users.sourceforge.jp, peter.maydell@linaro.org Subject: [PATCH 4/9] target: Use vaddr for hvf_arch_[insert|remove]_hw_breakpoint Date: Fri, 21 Jul 2023 22:58:22 +0200 Message-ID: <20230721205827.7502-5-anjo@rev.ng> In-Reply-To: <20230721205827.7502-1-anjo@rev.ng> References: <20230721205827.7502-1-anjo@rev.ng> 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=lists.gnu.org; Received-SPF: pass client-ip=5.9.113.41; envelope-from=anjo@rev.ng; helo=rev.ng 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Reply-to: Anton Johansson From: Anton Johansson via Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1689973161933100007 Content-Type: text/plain; charset="utf-8" Changes the signature of the target-defined functions for inserting/removing hvf hw breakpoints. The address and length arguments are now of vaddr type, which both matches the type used internally in accel/hvf/hvf-all.c and makes the api target-agnostic. Signed-off-by: Anton Johansson --- include/sysemu/hvf.h | 6 ++---- target/arm/hvf/hvf.c | 14 ++++++++------ target/i386/hvf/hvf.c | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/sysemu/hvf.h b/include/sysemu/hvf.h index 4cbae87ced..4037cd6a73 100644 --- a/include/sysemu/hvf.h +++ b/include/sysemu/hvf.h @@ -51,10 +51,8 @@ int hvf_sw_breakpoints_active(CPUState *cpu); =20 int hvf_arch_insert_sw_breakpoint(CPUState *cpu, struct hvf_sw_breakpoint = *bp); int hvf_arch_remove_sw_breakpoint(CPUState *cpu, struct hvf_sw_breakpoint = *bp); -int hvf_arch_insert_hw_breakpoint(target_ulong addr, target_ulong len, - int type); -int hvf_arch_remove_hw_breakpoint(target_ulong addr, target_ulong len, - int type); +int hvf_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type); +int hvf_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type); void hvf_arch_remove_all_hw_breakpoints(void); =20 /* diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index 8fce64bbf6..f8649bdb1b 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -2063,29 +2063,31 @@ int hvf_arch_remove_sw_breakpoint(CPUState *cpu, st= ruct hvf_sw_breakpoint *bp) return 0; } =20 -int hvf_arch_insert_hw_breakpoint(target_ulong addr, target_ulong len, int= type) +int hvf_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type) { switch (type) { case GDB_BREAKPOINT_HW: - return insert_hw_breakpoint(addr); + return insert_hw_breakpoint((target_ulong) addr); case GDB_WATCHPOINT_READ: case GDB_WATCHPOINT_WRITE: case GDB_WATCHPOINT_ACCESS: - return insert_hw_watchpoint(addr, len, type); + return insert_hw_watchpoint((target_ulong) addr, + (target_ulong) len, type); default: return -ENOSYS; } } =20 -int hvf_arch_remove_hw_breakpoint(target_ulong addr, target_ulong len, int= type) +int hvf_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type) { switch (type) { case GDB_BREAKPOINT_HW: - return delete_hw_breakpoint(addr); + return delete_hw_breakpoint((target_ulong) addr); case GDB_WATCHPOINT_READ: case GDB_WATCHPOINT_WRITE: case GDB_WATCHPOINT_ACCESS: - return delete_hw_watchpoint(addr, len, type); + return delete_hw_watchpoint((target_ulong) addr, + (target_ulong) len, type); default: return -ENOSYS; } diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c index b9cbcc02a8..cb2cd0b02f 100644 --- a/target/i386/hvf/hvf.c +++ b/target/i386/hvf/hvf.c @@ -690,12 +690,12 @@ int hvf_arch_remove_sw_breakpoint(CPUState *cpu, stru= ct hvf_sw_breakpoint *bp) return -ENOSYS; } =20 -int hvf_arch_insert_hw_breakpoint(target_ulong addr, target_ulong len, int= type) +int hvf_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type) { return -ENOSYS; } =20 -int hvf_arch_remove_hw_breakpoint(target_ulong addr, target_ulong len, int= type) +int hvf_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type) { return -ENOSYS; } --=20 2.41.0 From nobody Fri May 17 03:39:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1689973201; cv=none; d=zohomail.com; s=zohoarc; b=aZZqhdy9NrZZHFBrXjDWEgOkshIYs93FqITS9xVs0QN6oLQBPKrN9cEK55WNScofhs9EPFVKEPqu45mwGk+m/Nt9oeByYazu1SNvTYjRoMfKmo6r1bD6IKBmoRlAjoo6DOxpvaCz9Oxa8g5RI6QsdnZXPIZZUXK6FJqed/Bmq54= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689973201; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=mcGIZbvmv9lqtj6M5QUBRbrC0zoPNWLSCrzz+dAM9CE=; b=JdQvFkuUU/nEIzzMSxnELQhj/zBI6USnfoIEBEc44ceksages7s+SMsLEMDU1jJWIPj49kxpXUbIGqJMp1YOCyqK8ef4B3+a+S9ye1iDEYnnPkhU38XVIF4s0xMqpwxw4SKdFuc5zn+gOMrr6jggU8VRa+ItfgJzQmyRpbnRHB0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1689973201204135.07472722700857; Fri, 21 Jul 2023 14:00:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qMxDB-0006a8-76; Fri, 21 Jul 2023 16:58:53 -0400 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 1qMxD7-0006TP-Rr for qemu-devel@nongnu.org; Fri, 21 Jul 2023 16:58:49 -0400 Received: from rev.ng ([5.9.113.41]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qMxD5-0004Q4-MH for qemu-devel@nongnu.org; Fri, 21 Jul 2023 16:58:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=rev.ng; s=dkim; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=mcGIZbvmv9lqtj6M5QUBRbrC0zoPNWLSCrzz+dAM9CE=; b=guECfnwZGa0HVq1bFoMpO06vas 4/5o8aLEhD37KfmYkHDaq4ugl4VOiP+HdNF4e1MsHD77wOkUQou4hSKXgQWEE3JvwcN2gyZI/sn5I Q5rHSu2Z1BNQ2Q6swqc56G/mxJ8a5FKwOW5WMxYvZLnfhR9eAWOwx1ZVCBGZG9oVr0K8=; To: qemu-devel@nongnu.org Cc: ale@rev.ng, richard.henderson@linaro.org, pbonzini@redhat.com, philmd@linaro.org, agraf@csgraf.de, dirty@apple.com, rbolshakov@ddn.com, anielhb413@gmail.com, pasic@linux.ibm.com, borntraeger@linux.ibm.com, palmer@dabbelt.com, alistair.francis@wdc.com, bin.meng@windriver.com, ysato@users.sourceforge.jp, peter.maydell@linaro.org Subject: [PATCH 5/9] Replace target_ulong with abi_ptr in cpu_[st|ld]*() Date: Fri, 21 Jul 2023 22:58:23 +0200 Message-ID: <20230721205827.7502-6-anjo@rev.ng> In-Reply-To: <20230721205827.7502-1-anjo@rev.ng> References: <20230721205827.7502-1-anjo@rev.ng> 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=lists.gnu.org; Received-SPF: pass client-ip=5.9.113.41; envelope-from=anjo@rev.ng; helo=rev.ng 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Reply-to: Anton Johansson From: Anton Johansson via Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1689973202320100003 Content-Type: text/plain; charset="utf-8" Changes the address type of the guest memory read/write functions from target_ulong to abi_ptr. (abi_ptr is currently typedef'd to target_ulong but that will change in a following commit.) This will reduce the coupling between accel/ and target/. Note: Function pointers that point to cpu_[st|ld]*() in target/riscv and target/rx are also updated in this commit. Signed-off-by: Anton Johansson Reviewed-by: Richard Henderson --- accel/tcg/atomic_template.h | 16 ++++++++-------- include/exec/cpu_ldst.h | 24 ++++++++++++------------ accel/tcg/cputlb.c | 10 +++++----- target/riscv/vector_helper.c | 2 +- target/rx/op_helper.c | 6 +++--- 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/accel/tcg/atomic_template.h b/accel/tcg/atomic_template.h index e312acd16d..84c08b1425 100644 --- a/accel/tcg/atomic_template.h +++ b/accel/tcg/atomic_template.h @@ -69,7 +69,7 @@ # define END _le #endif =20 -ABI_TYPE ATOMIC_NAME(cmpxchg)(CPUArchState *env, target_ulong addr, +ABI_TYPE ATOMIC_NAME(cmpxchg)(CPUArchState *env, abi_ptr addr, ABI_TYPE cmpv, ABI_TYPE newv, MemOpIdx oi, uintptr_t retaddr) { @@ -87,7 +87,7 @@ ABI_TYPE ATOMIC_NAME(cmpxchg)(CPUArchState *env, target_u= long addr, } =20 #if DATA_SIZE < 16 -ABI_TYPE ATOMIC_NAME(xchg)(CPUArchState *env, target_ulong addr, ABI_TYPE = val, +ABI_TYPE ATOMIC_NAME(xchg)(CPUArchState *env, abi_ptr addr, ABI_TYPE val, MemOpIdx oi, uintptr_t retaddr) { DATA_TYPE *haddr =3D atomic_mmu_lookup(env, addr, oi, DATA_SIZE, retad= dr); @@ -100,7 +100,7 @@ ABI_TYPE ATOMIC_NAME(xchg)(CPUArchState *env, target_ul= ong addr, ABI_TYPE val, } =20 #define GEN_ATOMIC_HELPER(X) \ -ABI_TYPE ATOMIC_NAME(X)(CPUArchState *env, target_ulong addr, \ +ABI_TYPE ATOMIC_NAME(X)(CPUArchState *env, abi_ptr addr, \ ABI_TYPE val, MemOpIdx oi, uintptr_t retaddr) \ { \ DATA_TYPE *haddr, ret; \ @@ -131,7 +131,7 @@ GEN_ATOMIC_HELPER(xor_fetch) * of CF_PARALLEL's value, we'll trace just a read and a write. */ #define GEN_ATOMIC_HELPER_FN(X, FN, XDATA_TYPE, RET) \ -ABI_TYPE ATOMIC_NAME(X)(CPUArchState *env, target_ulong addr, \ +ABI_TYPE ATOMIC_NAME(X)(CPUArchState *env, abi_ptr addr, \ ABI_TYPE xval, MemOpIdx oi, uintptr_t retaddr) \ { \ XDATA_TYPE *haddr, cmp, old, new, val =3D xval; \ @@ -172,7 +172,7 @@ GEN_ATOMIC_HELPER_FN(umax_fetch, MAX, DATA_TYPE, new) # define END _be #endif =20 -ABI_TYPE ATOMIC_NAME(cmpxchg)(CPUArchState *env, target_ulong addr, +ABI_TYPE ATOMIC_NAME(cmpxchg)(CPUArchState *env, abi_ptr addr, ABI_TYPE cmpv, ABI_TYPE newv, MemOpIdx oi, uintptr_t retaddr) { @@ -190,7 +190,7 @@ ABI_TYPE ATOMIC_NAME(cmpxchg)(CPUArchState *env, target= _ulong addr, } =20 #if DATA_SIZE < 16 -ABI_TYPE ATOMIC_NAME(xchg)(CPUArchState *env, target_ulong addr, ABI_TYPE = val, +ABI_TYPE ATOMIC_NAME(xchg)(CPUArchState *env, abi_ptr addr, ABI_TYPE val, MemOpIdx oi, uintptr_t retaddr) { DATA_TYPE *haddr =3D atomic_mmu_lookup(env, addr, oi, DATA_SIZE, retad= dr); @@ -203,7 +203,7 @@ ABI_TYPE ATOMIC_NAME(xchg)(CPUArchState *env, target_ul= ong addr, ABI_TYPE val, } =20 #define GEN_ATOMIC_HELPER(X) \ -ABI_TYPE ATOMIC_NAME(X)(CPUArchState *env, target_ulong addr, \ +ABI_TYPE ATOMIC_NAME(X)(CPUArchState *env, abi_ptr addr, \ ABI_TYPE val, MemOpIdx oi, uintptr_t retaddr) \ { \ DATA_TYPE *haddr, ret; \ @@ -231,7 +231,7 @@ GEN_ATOMIC_HELPER(xor_fetch) * of CF_PARALLEL's value, we'll trace just a read and a write. */ #define GEN_ATOMIC_HELPER_FN(X, FN, XDATA_TYPE, RET) \ -ABI_TYPE ATOMIC_NAME(X)(CPUArchState *env, target_ulong addr, \ +ABI_TYPE ATOMIC_NAME(X)(CPUArchState *env, abi_ptr addr, \ ABI_TYPE xval, MemOpIdx oi, uintptr_t retaddr) \ { \ XDATA_TYPE *haddr, ldo, ldn, old, new, val =3D xval; \ diff --git a/include/exec/cpu_ldst.h b/include/exec/cpu_ldst.h index 645476f0e5..da10ba1433 100644 --- a/include/exec/cpu_ldst.h +++ b/include/exec/cpu_ldst.h @@ -223,31 +223,31 @@ void cpu_stq_mmu(CPUArchState *env, abi_ptr ptr, uint= 64_t val, void cpu_st16_mmu(CPUArchState *env, abi_ptr addr, Int128 val, MemOpIdx oi, uintptr_t ra); =20 -uint32_t cpu_atomic_cmpxchgb_mmu(CPUArchState *env, target_ulong addr, +uint32_t cpu_atomic_cmpxchgb_mmu(CPUArchState *env, abi_ptr addr, uint32_t cmpv, uint32_t newv, MemOpIdx oi, uintptr_t retaddr); -uint32_t cpu_atomic_cmpxchgw_le_mmu(CPUArchState *env, target_ulong addr, +uint32_t cpu_atomic_cmpxchgw_le_mmu(CPUArchState *env, abi_ptr addr, uint32_t cmpv, uint32_t newv, MemOpIdx oi, uintptr_t retaddr); -uint32_t cpu_atomic_cmpxchgl_le_mmu(CPUArchState *env, target_ulong addr, +uint32_t cpu_atomic_cmpxchgl_le_mmu(CPUArchState *env, abi_ptr addr, uint32_t cmpv, uint32_t newv, MemOpIdx oi, uintptr_t retaddr); -uint64_t cpu_atomic_cmpxchgq_le_mmu(CPUArchState *env, target_ulong addr, +uint64_t cpu_atomic_cmpxchgq_le_mmu(CPUArchState *env, abi_ptr addr, uint64_t cmpv, uint64_t newv, MemOpIdx oi, uintptr_t retaddr); -uint32_t cpu_atomic_cmpxchgw_be_mmu(CPUArchState *env, target_ulong addr, +uint32_t cpu_atomic_cmpxchgw_be_mmu(CPUArchState *env, abi_ptr addr, uint32_t cmpv, uint32_t newv, MemOpIdx oi, uintptr_t retaddr); -uint32_t cpu_atomic_cmpxchgl_be_mmu(CPUArchState *env, target_ulong addr, +uint32_t cpu_atomic_cmpxchgl_be_mmu(CPUArchState *env, abi_ptr addr, uint32_t cmpv, uint32_t newv, MemOpIdx oi, uintptr_t retaddr); -uint64_t cpu_atomic_cmpxchgq_be_mmu(CPUArchState *env, target_ulong addr, +uint64_t cpu_atomic_cmpxchgq_be_mmu(CPUArchState *env, abi_ptr addr, uint64_t cmpv, uint64_t newv, MemOpIdx oi, uintptr_t retaddr); =20 -#define GEN_ATOMIC_HELPER(NAME, TYPE, SUFFIX) \ -TYPE cpu_atomic_ ## NAME ## SUFFIX ## _mmu \ - (CPUArchState *env, target_ulong addr, TYPE val, \ +#define GEN_ATOMIC_HELPER(NAME, TYPE, SUFFIX) \ +TYPE cpu_atomic_ ## NAME ## SUFFIX ## _mmu \ + (CPUArchState *env, abi_ptr addr, TYPE val, \ MemOpIdx oi, uintptr_t retaddr); =20 #ifdef CONFIG_ATOMIC64 @@ -293,10 +293,10 @@ GEN_ATOMIC_HELPER_ALL(xchg) #undef GEN_ATOMIC_HELPER_ALL #undef GEN_ATOMIC_HELPER =20 -Int128 cpu_atomic_cmpxchgo_le_mmu(CPUArchState *env, target_ulong addr, +Int128 cpu_atomic_cmpxchgo_le_mmu(CPUArchState *env, abi_ptr addr, Int128 cmpv, Int128 newv, MemOpIdx oi, uintptr_t retaddr); -Int128 cpu_atomic_cmpxchgo_be_mmu(CPUArchState *env, target_ulong addr, +Int128 cpu_atomic_cmpxchgo_be_mmu(CPUArchState *env, abi_ptr addr, Int128 cmpv, Int128 newv, MemOpIdx oi, uintptr_t retaddr); =20 diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index e0079c9a9d..8e9dc51cd1 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -3038,14 +3038,14 @@ static void plugin_store_cb(CPUArchState *env, abi_= ptr addr, MemOpIdx oi) qemu_plugin_vcpu_mem_cb(env_cpu(env), addr, oi, QEMU_PLUGIN_MEM_W); } =20 -void cpu_stb_mmu(CPUArchState *env, target_ulong addr, uint8_t val, +void cpu_stb_mmu(CPUArchState *env, abi_ptr addr, uint8_t val, MemOpIdx oi, uintptr_t retaddr) { helper_stb_mmu(env, addr, val, oi, retaddr); plugin_store_cb(env, addr, oi); } =20 -void cpu_stw_mmu(CPUArchState *env, target_ulong addr, uint16_t val, +void cpu_stw_mmu(CPUArchState *env, abi_ptr addr, uint16_t val, MemOpIdx oi, uintptr_t retaddr) { tcg_debug_assert((get_memop(oi) & MO_SIZE) =3D=3D MO_16); @@ -3053,7 +3053,7 @@ void cpu_stw_mmu(CPUArchState *env, target_ulong addr= , uint16_t val, plugin_store_cb(env, addr, oi); } =20 -void cpu_stl_mmu(CPUArchState *env, target_ulong addr, uint32_t val, +void cpu_stl_mmu(CPUArchState *env, abi_ptr addr, uint32_t val, MemOpIdx oi, uintptr_t retaddr) { tcg_debug_assert((get_memop(oi) & MO_SIZE) =3D=3D MO_32); @@ -3061,7 +3061,7 @@ void cpu_stl_mmu(CPUArchState *env, target_ulong addr= , uint32_t val, plugin_store_cb(env, addr, oi); } =20 -void cpu_stq_mmu(CPUArchState *env, target_ulong addr, uint64_t val, +void cpu_stq_mmu(CPUArchState *env, abi_ptr addr, uint64_t val, MemOpIdx oi, uintptr_t retaddr) { tcg_debug_assert((get_memop(oi) & MO_SIZE) =3D=3D MO_64); @@ -3069,7 +3069,7 @@ void cpu_stq_mmu(CPUArchState *env, target_ulong addr= , uint64_t val, plugin_store_cb(env, addr, oi); } =20 -void cpu_st16_mmu(CPUArchState *env, target_ulong addr, Int128 val, +void cpu_st16_mmu(CPUArchState *env, abi_ptr addr, Int128 val, MemOpIdx oi, uintptr_t retaddr) { tcg_debug_assert((get_memop(oi) & MO_SIZE) =3D=3D MO_128); diff --git a/target/riscv/vector_helper.c b/target/riscv/vector_helper.c index 4d06754826..bf7e0029a1 100644 --- a/target/riscv/vector_helper.c +++ b/target/riscv/vector_helper.c @@ -235,7 +235,7 @@ static inline int vext_elem_mask(void *v0, int index) } =20 /* elements operations for load and store */ -typedef void vext_ldst_elem_fn(CPURISCVState *env, target_ulong addr, +typedef void vext_ldst_elem_fn(CPURISCVState *env, abi_ptr addr, uint32_t idx, void *vd, uintptr_t retaddr); =20 #define GEN_VEXT_LD_ELEM(NAME, ETYPE, H, LDSUF) \ diff --git a/target/rx/op_helper.c b/target/rx/op_helper.c index dc0092ca99..691a12b2be 100644 --- a/target/rx/op_helper.c +++ b/target/rx/op_helper.c @@ -216,19 +216,19 @@ void helper_scmpu(CPURXState *env) } =20 static uint32_t (* const cpu_ldufn[])(CPUArchState *env, - target_ulong ptr, + abi_ptr ptr, uintptr_t retaddr) =3D { cpu_ldub_data_ra, cpu_lduw_data_ra, cpu_ldl_data_ra, }; =20 static uint32_t (* const cpu_ldfn[])(CPUArchState *env, - target_ulong ptr, + abi_ptr ptr, uintptr_t retaddr) =3D { cpu_ldub_data_ra, cpu_lduw_data_ra, cpu_ldl_data_ra, }; =20 static void (* const cpu_stfn[])(CPUArchState *env, - target_ulong ptr, + abi_ptr ptr, uint32_t val, uintptr_t retaddr) =3D { cpu_stb_data_ra, cpu_stw_data_ra, cpu_stl_data_ra, --=20 2.41.0 From nobody Fri May 17 03:39:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1689973143; cv=none; d=zohomail.com; s=zohoarc; b=JwxdHbDa+2WuM0xBVPKtcW6B0roUXxYMtyaeCARynpCptFtacjdkO6NbHHOrnb3ZJbRmOxVu45l+/XlKQhM66wUkp0YHZXRkthE02NNX/W+KPRSLnoLylR/K9Gcc4KfDCvQSboNyBHMNV2q3Blonrg3QMUthGeGPFHK+oJ7QPJ8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689973143; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=Y1UU1LDKH1hTZPZdBiqE1snAV/bC24htdc/Y5+41wVE=; b=hdJU07AkxfD0Hv76pyEJi6Lob5+nJtggqItVjlV54YlGxvSLwQeAjBWlWPPYv39E1GyJrnYf3FpXi5W66o0I1bZmosP+AwH9XvjKFfASyG7mojImMR2UIn8mscGr/ZsNTrzPax0h0qgvJY2C2XD6T4RQfxKXTdkh/eKmbNCRj+I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1689973143816142.2679918367154; Fri, 21 Jul 2023 13:59:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qMxD9-0006ZE-Pw; Fri, 21 Jul 2023 16:58:51 -0400 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 1qMxD8-0006V8-8O for qemu-devel@nongnu.org; Fri, 21 Jul 2023 16:58:50 -0400 Received: from rev.ng ([5.9.113.41]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qMxD6-0004QM-PM for qemu-devel@nongnu.org; Fri, 21 Jul 2023 16:58:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=rev.ng; s=dkim; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Y1UU1LDKH1hTZPZdBiqE1snAV/bC24htdc/Y5+41wVE=; b=BMNkGhlvSTfL91yOkqkTlnRGeh VtP0xZKNRiIkgfWDn12CN5s62BfT8MIT7gExrpHzGBgiaZVIyFxd+zu5RYDuphSOMBjmq4HCXkJvB pqecvpg1QDghdh1dkCBsLegna0X6LZSFtwAJJnl3yYUVlZXacITqj3olsTzhlXNCPLf4=; To: qemu-devel@nongnu.org Cc: ale@rev.ng, richard.henderson@linaro.org, pbonzini@redhat.com, philmd@linaro.org, agraf@csgraf.de, dirty@apple.com, rbolshakov@ddn.com, anielhb413@gmail.com, pasic@linux.ibm.com, borntraeger@linux.ibm.com, palmer@dabbelt.com, alistair.francis@wdc.com, bin.meng@windriver.com, ysato@users.sourceforge.jp, peter.maydell@linaro.org Subject: [PATCH 6/9] include/exec: typedef abi_ptr to vaddr in softmmu Date: Fri, 21 Jul 2023 22:58:24 +0200 Message-ID: <20230721205827.7502-7-anjo@rev.ng> In-Reply-To: <20230721205827.7502-1-anjo@rev.ng> References: <20230721205827.7502-1-anjo@rev.ng> 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=lists.gnu.org; Received-SPF: pass client-ip=5.9.113.41; envelope-from=anjo@rev.ng; helo=rev.ng 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Reply-to: Anton Johansson From: Anton Johansson via Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1689973146341100003 Content-Type: text/plain; charset="utf-8" In system mode, abi_ptr is primarily used for representing addresses when accessing guest memory with cpu_[st|ld]*(). Widening it from target_ulong to vaddr reduces the target dependence of these functions and is step towards building accel/ once for system mode. Signed-off-by: Anton Johansson Reviewed-by: Richard Henderson --- include/exec/cpu_ldst.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/exec/cpu_ldst.h b/include/exec/cpu_ldst.h index da10ba1433..f3ce4eb1d0 100644 --- a/include/exec/cpu_ldst.h +++ b/include/exec/cpu_ldst.h @@ -121,8 +121,8 @@ static inline bool guest_range_valid_untagged(abi_ulong= start, abi_ulong len) h2g_nocheck(x); \ }) #else -typedef target_ulong abi_ptr; -#define TARGET_ABI_FMT_ptr TARGET_FMT_lx +typedef vaddr abi_ptr; +#define TARGET_ABI_FMT_ptr "%016" VADDR_PRIx #endif =20 uint32_t cpu_ldub_data(CPUArchState *env, abi_ptr ptr); --=20 2.41.0 From nobody Fri May 17 03:39:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1689973222; cv=none; d=zohomail.com; s=zohoarc; b=GrV7yEKtolm65haTvAVUwQ4J8kIvn+tzJxuF8W946lk/stuvEBCEzZMreRO8hE0EJSwfKZQ6WCpTA9+OOwiAjftQe1Z1LtVay00V/dlu8OU+W1z9a0wJGXbMu/YMcgxBA/NfHNx3TSskg7KGpARTVrk9vXseoC9SUz94r34EZqU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689973222; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=5F3lH1+nT4GucAsP0HhVZxiLvA88in7yC8PC1DDMSuc=; b=VJlpMXz67FDoHAmmyTrSV7sZqeyyY3vtzmLCI/i4+gFbmNez8evMPv0WVG9jsgseNwTDOc/6ovrEmkziN36NTiQ917vnNsSInMZywxiRjEmByhpCLhCTe1DwBFW47vQeaf8C62j308p3ufW+J9rMuceZcUWjV91ievG+JA4ssi0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1689973222394309.9618512666036; Fri, 21 Jul 2023 14:00:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qMxDC-0006ah-Op; Fri, 21 Jul 2023 16:58:54 -0400 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 1qMxDA-0006Zl-3A for qemu-devel@nongnu.org; Fri, 21 Jul 2023 16:58:52 -0400 Received: from rev.ng ([5.9.113.41]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qMxD8-0004Qo-Np for qemu-devel@nongnu.org; Fri, 21 Jul 2023 16:58:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=rev.ng; s=dkim; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=5F3lH1+nT4GucAsP0HhVZxiLvA88in7yC8PC1DDMSuc=; b=nPXXkHGsxIdlese79Mfgx5LHNB CDyNi2Rjv7zgXQikHfQskUDT1X0k5VMSFJXjF74N8SQWxGG/kJRzI3uhD4My3QQA1kkrfxVyDCzKK 7JRcd/69GwNnCDFvQSFHUY4+4cNeBWaBu/6HerUwNHOIw0zyErIpErBHFcRO82+Y+cZ0=; To: qemu-devel@nongnu.org Cc: ale@rev.ng, richard.henderson@linaro.org, pbonzini@redhat.com, philmd@linaro.org, agraf@csgraf.de, dirty@apple.com, rbolshakov@ddn.com, anielhb413@gmail.com, pasic@linux.ibm.com, borntraeger@linux.ibm.com, palmer@dabbelt.com, alistair.francis@wdc.com, bin.meng@windriver.com, ysato@users.sourceforge.jp, peter.maydell@linaro.org Subject: [PATCH 7/9] include/exec: Widen tlb_hit/tlb_hit_page() Date: Fri, 21 Jul 2023 22:58:25 +0200 Message-ID: <20230721205827.7502-8-anjo@rev.ng> In-Reply-To: <20230721205827.7502-1-anjo@rev.ng> References: <20230721205827.7502-1-anjo@rev.ng> 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=lists.gnu.org; Received-SPF: pass client-ip=5.9.113.41; envelope-from=anjo@rev.ng; helo=rev.ng 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Reply-to: Anton Johansson From: Anton Johansson via Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1689973224395100007 Content-Type: text/plain; charset="utf-8" tlb_addr is changed from target_ulong to uint64_t to match the type of a CPUTLBEntry value, and the addressed is changed to vaddr. Signed-off-by: Anton Johansson Reviewed-by: Richard Henderson --- include/exec/cpu-all.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 94f44f1f59..c2c62160c6 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -397,7 +397,7 @@ QEMU_BUILD_BUG_ON(TLB_FLAGS_MASK & TLB_SLOW_FLAGS_MASK); * @addr: virtual address to test (must be page aligned) * @tlb_addr: TLB entry address (a CPUTLBEntry addr_read/write/code value) */ -static inline bool tlb_hit_page(target_ulong tlb_addr, target_ulong addr) +static inline bool tlb_hit_page(uint64_t tlb_addr, vaddr addr) { return addr =3D=3D (tlb_addr & (TARGET_PAGE_MASK | TLB_INVALID_MASK)); } @@ -408,7 +408,7 @@ static inline bool tlb_hit_page(target_ulong tlb_addr, = target_ulong addr) * @addr: virtual address to test (need not be page aligned) * @tlb_addr: TLB entry address (a CPUTLBEntry addr_read/write/code value) */ -static inline bool tlb_hit(target_ulong tlb_addr, target_ulong addr) +static inline bool tlb_hit(uint64_t tlb_addr, vaddr addr) { return tlb_hit_page(tlb_addr, addr & TARGET_PAGE_MASK); } --=20 2.41.0 From nobody Fri May 17 03:39:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1689973221; cv=none; d=zohomail.com; s=zohoarc; b=KOEdWzrdrgkIVIHvovs5oEdiioHmiTlOg4fV5JGWM20mWUZHsUn1BVcHF6hyh7iZMABMEGOKZWn6xseR7d0010LTHkDLObRDWLKmQ2gvKHUpkcbQL45H9EWksHIkGF+UP9ah+fmF5EbOHnoyOtQXX5knMhRH5L0gZfiQWMixu2E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689973221; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=IyRUaUrZmROjsZyb/fgnX9P/cehJ9xeR6m1pZL2X7bw=; b=bEXcgU0HtLDMk1WBjlUxUH8lkIMtXfGozBJx+7wi0MQEQM2xAFKqUeq7tbSiib42DXYsgNklUBCnFtpHt835CB2ClTA/+G8bAlZNZwu83nVqg0Y11xL6VpvRNhggmC6l66bD7vsgZuqovcdJaJkFIOBQmInJRLGlDewR31BROuM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1689973221676841.5283661690612; Fri, 21 Jul 2023 14:00:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qMxDC-0006aX-C9; Fri, 21 Jul 2023 16:58:54 -0400 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 1qMxDB-0006a2-2H for qemu-devel@nongnu.org; Fri, 21 Jul 2023 16:58:53 -0400 Received: from rev.ng ([5.9.113.41]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qMxD9-0004R0-QA for qemu-devel@nongnu.org; Fri, 21 Jul 2023 16:58:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=rev.ng; s=dkim; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=IyRUaUrZmROjsZyb/fgnX9P/cehJ9xeR6m1pZL2X7bw=; b=dQE1PHaZyB+utiSxRCl/Yv+pMT QfP9G+4m4DAt26fTmLOIgNYiakkX98xeBCzNGj6jC7OwbwcVHIqfHk6MkjAZ6wAqGgzLL83au0/ph LwOYxrQROq1mBxMFTZ5TqNSPxsTwOF3QVSDwjbipBSUVm06fnrYPs4KQKGpxVpguHYq8=; To: qemu-devel@nongnu.org Cc: ale@rev.ng, richard.henderson@linaro.org, pbonzini@redhat.com, philmd@linaro.org, agraf@csgraf.de, dirty@apple.com, rbolshakov@ddn.com, anielhb413@gmail.com, pasic@linux.ibm.com, borntraeger@linux.ibm.com, palmer@dabbelt.com, alistair.francis@wdc.com, bin.meng@windriver.com, ysato@users.sourceforge.jp, peter.maydell@linaro.org Subject: [PATCH 8/9] accel/tcg: Widen address arg. in tlb_compare_set() Date: Fri, 21 Jul 2023 22:58:26 +0200 Message-ID: <20230721205827.7502-9-anjo@rev.ng> In-Reply-To: <20230721205827.7502-1-anjo@rev.ng> References: <20230721205827.7502-1-anjo@rev.ng> 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=lists.gnu.org; Received-SPF: pass client-ip=5.9.113.41; envelope-from=anjo@rev.ng; helo=rev.ng 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Reply-to: Anton Johansson From: Anton Johansson via Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1689973222094100002 Content-Type: text/plain; charset="utf-8" Signed-off-by: Anton Johansson Reviewed-by: Richard Henderson --- accel/tcg/cputlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 8e9dc51cd1..2f97ae2fda 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -1108,7 +1108,7 @@ static void tlb_add_large_page(CPUArchState *env, int= mmu_idx, } =20 static inline void tlb_set_compare(CPUTLBEntryFull *full, CPUTLBEntry *ent, - target_ulong address, int flags, + vaddr address, int flags, MMUAccessType access_type, bool enable) { if (enable) { --=20 2.41.0 From nobody Fri May 17 03:39:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1689973183; cv=none; d=zohomail.com; s=zohoarc; b=hV818HzYoPwCCpzKi8Ta100VZxiOIMBZ1VV6ZgTTndfqTxaWNHWdsP03d0mc+F7DubR2jfZW6ABEctkPhuTabpnVQFJVWWgiaOjfi8UQwSbqE7DKTv9IbeseeFMIkNoImmOLHio3lO8E/wI6ezxmOmy/2DHHCTUgORKsAjTNf3Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689973183; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=XPPHiGmBwZAaiBJ88wQREhEnhlllZfO+BHiYOfFP/4I=; b=THMqnEGuaYyot/qMc5Ycmq/JHkRToAReNvF38p4wjt2wJgzeH6ubnUf0Cc4/oNWA+hhN1rF2S2v43NguBrsBnhCcC1+FkMbCwr4SJwkTYSvQA2uByRFu0f2aMxhZArTZdgD314fFDGhoYwr2oWkMY0V4T3XJqY4MXgIVLj+8Pfo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1689973183781210.9479198004683; Fri, 21 Jul 2023 13:59:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qMxDE-0006bz-TQ; Fri, 21 Jul 2023 16:58:56 -0400 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 1qMxDD-0006ai-4h for qemu-devel@nongnu.org; Fri, 21 Jul 2023 16:58:55 -0400 Received: from rev.ng ([5.9.113.41]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qMxDB-0004RL-OZ for qemu-devel@nongnu.org; Fri, 21 Jul 2023 16:58:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=rev.ng; s=dkim; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=XPPHiGmBwZAaiBJ88wQREhEnhlllZfO+BHiYOfFP/4I=; b=jeoIKJE1iLqjlajfwSZfE7OR3C mEsEvx+tbDIyST2dnJoftXT7sshTqRCWMe8SBoS2l2tAgx609MlsMu/ul9rHi7BcOkIu3YGpCT7je AgyLZ+gvtFz3OKjndkHRr95lc+9W0m3w/MKhQ16Xo9+QnWZwtkoKEuMekgSQkc4sx+G8=; To: qemu-devel@nongnu.org Cc: ale@rev.ng, richard.henderson@linaro.org, pbonzini@redhat.com, philmd@linaro.org, agraf@csgraf.de, dirty@apple.com, rbolshakov@ddn.com, anielhb413@gmail.com, pasic@linux.ibm.com, borntraeger@linux.ibm.com, palmer@dabbelt.com, alistair.francis@wdc.com, bin.meng@windriver.com, ysato@users.sourceforge.jp, peter.maydell@linaro.org Subject: [PATCH 9/9] accel/tcg: Update run_on_cpu_data static assert Date: Fri, 21 Jul 2023 22:58:27 +0200 Message-ID: <20230721205827.7502-10-anjo@rev.ng> In-Reply-To: <20230721205827.7502-1-anjo@rev.ng> References: <20230721205827.7502-1-anjo@rev.ng> 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=lists.gnu.org; Received-SPF: pass client-ip=5.9.113.41; envelope-from=anjo@rev.ng; helo=rev.ng 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Reply-to: Anton Johansson From: Anton Johansson via Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1689973185815100003 Content-Type: text/plain; charset="utf-8" As we are now using vaddr for representing guest addresses, update the static assert to check that vaddr fits in the run_on_cpu_data union. Signed-off-by: Anton Johansson Reviewed-by: Richard Henderson --- accel/tcg/cputlb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 2f97ae2fda..b558da04af 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -74,8 +74,9 @@ } while (0) =20 /* run_on_cpu_data.target_ptr should always be big enough for a - * target_ulong even on 32 bit builds */ -QEMU_BUILD_BUG_ON(sizeof(target_ulong) > sizeof(run_on_cpu_data)); + * vaddr even on 32 bit builds + */ +QEMU_BUILD_BUG_ON(sizeof(vaddr) > sizeof(run_on_cpu_data)); =20 /* We currently can't handle more than 16 bits in the MMUIDX bitmask. */ --=20 2.41.0