From nobody Sun Jul 26 11:07:31 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1782875117; cv=none; d=zohomail.com; s=zohoarc; b=W+aaaOO3dqVn39hw1vOJaSPr7MOcvzg90jRS9eUffZwP93mKp3TlxerMCDivZ9KWzzjRpZMWDbb5ht55X//hWGdUm2kSJTQ0aLeUfPBIoNITPqwGgW7hUEi5sNWgiN85s/eK3u02Exxa4o6ulduyFNApuIvrT2MJqKGSR1LTu6Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782875117; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=zxQz3A5cSSHlQV/FJFFLwzuhdIbJxyset0vnu8TQPN0=; b=PkalujsN6VYvq8JwZ2iguGXC3Mcpd8wjsTDb94oMKeNMl1+pbsXVnPOJgITh76KqApOwekEi0wglWuSZubfyXqEGj6d0IzRmVxiQ1c3Fin938kxSiMFnlyrazuNeMcSYeIJ+LL24ucTdMg/PcFjRGefO28ZollRFvA8UB09Tk3k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1782875116974504.28949957094903; Tue, 30 Jun 2026 20:05:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1welFw-0005gu-F7; Tue, 30 Jun 2026 23:04:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1welFr-0005fi-QQ for qemu-devel@nongnu.org; Tue, 30 Jun 2026 23:04:52 -0400 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1welFn-0002n8-W9 for qemu-devel@nongnu.org; Tue, 30 Jun 2026 23:04:51 -0400 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-2c99672293cso995045ad.2 for ; Tue, 30 Jun 2026 20:04:47 -0700 (PDT) Received: from stoup.. (174-21-129-215.tukw.qwest.net. [174.21.129.215]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ca37c74261sm23758085ad.22.2026.06.30.20.04.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2026 20:04:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1782875086; x=1783479886; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zxQz3A5cSSHlQV/FJFFLwzuhdIbJxyset0vnu8TQPN0=; b=boqij1oDtr5aeBat0kEu2rvZrVLcatX3oLPUpOSgxcPhypF0U6tjzq08U4hVtq2zKd +Mvhf/W8/7lCKsK2ry8sKVTgEq7/KZA5+pUkPFEJSKuYVgLxTCVgUVVgrKE7cA5Y3exM UntB34cFFjnmt2ZoCZv/EFQKj58mv6vsqqYfHe1ONubE3pFfY8+v201OC59yAWFjBAGY M0ipMhvuvYHETzZGO3OGwnwd1Yr7DVdNDo/m2oSBGOgJH3LNxWTVqB0A24oiq+NBnkp1 4TX5lFXlIOhVPBRf2od+fPXpF2cJ1wo4Vkp+t3EFmK67nzIKDE1dsKbmOA2AzBAM582j zryw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782875086; x=1783479886; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=zxQz3A5cSSHlQV/FJFFLwzuhdIbJxyset0vnu8TQPN0=; b=p89fetzQBpK17F9kFLhgVL0c+2lTPeIJjmAcN5aqOgNTNgsISE4vMDnH5HhD25wZoN 5pcEKTAthHH9VNTN5/QS/1tfpmbCMJJDsT5sWhy/8YdmQAqZzz8c72iX24IZ7Qf2/HSw SadCMLCzcKuFJP3zDUFeSTJLhlr8PTMFiZIqqpo+pTnglgB+/c72WTMEpynFD6i2lkZo aYP55SWgm/vf01QlqPAQT30+pJkS5Kh0zMSwr+5pZ2PaxRK5ZEU8KDdIKJHxCdEi5MJd PrpmpUXzzx+AFNvvQhyNLHsc799aN6W7f2Nb0vz/EPy7fQT7IsQ8cdAYwIN+503doI1K hNoQ== X-Gm-Message-State: AOJu0YwBCjb6h1Y1su5rAB0KCcbkKfVfekw4hSZOfSn+weYi4ogO43iM UMaTWFLV+ins4KtBEv9Z+WlZFiieS2QHGOLccue9C84ltv7Xj6RN3ZQRf5a0mNTF31SHwVW361B q81W8 X-Gm-Gg: AfdE7cmudX2YhynOZxtYrSIS1LpawwWof5fBw4s06/9ZtTtitdhUTWu1dPK2ZHnOBdX 3VK8EU0fyzbpROI41qmHFl7iJz71ZXD8NrbImPZhpJeFNjropJ4z56KbdDH2UVsCtxs3T49qxOn EzW35GjifTkEZs527JTkAgqWV/qt5pMu40xs/igoPt4TZpMTKA7ipGxsvjeSkRIO/apOYV9JA7s mHtN8FYz4gxu7aFF1xnVe8vpLDs9ewvYUezCIE6XGYf5F+7RiJ5np2INLzz7UVROwlMj1L0wzLD yrt1eQkhpu92z43o/JK28wdbksq/VAbdPpGnKPJ3SEsBtUR1+KzxcTdicxrwg1rTCT/40xVZw8p 5z6U+g4IkZeeoI/Vfsxl+FOkklwrSBHsSb+6ewkzXUJfcuq7pYeyq5Juxot9Nk/gLDa9FuSW9cg 6g0A5PRSeLDR+5kMG4RHZj7apH3E4Kx8nZ6cFQhjDCGxwAdBptCg== X-Received: by 2002:a17:902:ef09:b0:2c9:ae0b:61e3 with SMTP id d9443c01a7336-2ca5a52fceemr27719335ad.2.1782875086020; Tue, 30 Jun 2026 20:04:46 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: shivangu@linux.ibm.com, qemu-arm@nongnu.org, qemu-riscv@nongnu.org Subject: [PATCH 01/17] accel/tcg: Pass CPUBreakpoint to debug_check_breakpoint Date: Tue, 30 Jun 2026 20:04:27 -0700 Message-ID: <20260701030443.1382447-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260701030443.1382447-1-richard.henderson@linaro.org> References: <20260701030443.1382447-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x634.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1782875118988158500 Content-Type: text/plain; charset="utf-8" For 3 of the 4 targets that use this hook, add the argument and ignore it so far. For riscv, drop the loop over all breakpoints and use the new argument. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/accel/tcg/cpu-ops.h | 2 +- target/arm/internals.h | 2 +- target/ppc/internal.h | 2 +- target/riscv/debug.h | 2 +- target/xtensa/cpu.h | 2 +- accel/tcg/cpu-exec.c | 2 +- target/arm/tcg/debug.c | 2 +- target/i386/tcg/tcg-cpu.c | 2 +- target/ppc/tcg-excp_helper.c | 2 +- target/riscv/debug.c | 55 +++++++++++++++++------------------- target/xtensa/dbg_helper.c | 2 +- 11 files changed, 36 insertions(+), 39 deletions(-) diff --git a/include/accel/tcg/cpu-ops.h b/include/accel/tcg/cpu-ops.h index 710da12b82..d2b9079835 100644 --- a/include/accel/tcg/cpu-ops.h +++ b/include/accel/tcg/cpu-ops.h @@ -265,7 +265,7 @@ struct TCGCPUOps { * @debug_check_breakpoint: return true if the architectural * breakpoint whose PC has matched should really fire. */ - bool (*debug_check_breakpoint)(CPUState *cpu); + bool (*debug_check_breakpoint)(CPUState *cpu, const CPUBreakpoint *bp); =20 /** * @io_recompile_replay_branch: Callback for cpu_io_recompile. diff --git a/target/arm/internals.h b/target/arm/internals.h index fcce3804f3..c78c86a1fc 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -680,7 +680,7 @@ void hw_breakpoint_update(ARMCPU *cpu, int n); void hw_breakpoint_update_all(ARMCPU *cpu); =20 /* Callback function for checking if a breakpoint should trigger. */ -bool arm_debug_check_breakpoint(CPUState *cs); +bool arm_debug_check_breakpoint(CPUState *cs, const CPUBreakpoint *bp); =20 /* Callback function for checking if a watchpoint should trigger. */ bool arm_debug_check_watchpoint(CPUState *cs, CPUWatchpoint *wp); diff --git a/target/ppc/internal.h b/target/ppc/internal.h index a3bb12afd9..f3e694c4cd 100644 --- a/target/ppc/internal.h +++ b/target/ppc/internal.h @@ -304,7 +304,7 @@ void ppc_cpu_do_transaction_failed(CPUState *cs, hwaddr= physaddr, int mmu_idx, MemTxAttrs attrs, MemTxResult response, uintptr_t retaddr= ); void ppc_cpu_debug_excp_handler(CPUState *cs); -bool ppc_cpu_debug_check_breakpoint(CPUState *cs); +bool ppc_cpu_debug_check_breakpoint(CPUState *cs, const CPUBreakpoint *bp); bool ppc_cpu_debug_check_watchpoint(CPUState *cs, CPUWatchpoint *wp); =20 G_NORETURN void powerpc_checkstop(CPUPPCState *env, const char *reason); diff --git a/target/riscv/debug.h b/target/riscv/debug.h index 55a3ac72e6..91690404df 100644 --- a/target/riscv/debug.h +++ b/target/riscv/debug.h @@ -144,7 +144,7 @@ void tdata_csr_write(CPURISCVState *env, int tdata_inde= x, target_ulong val); target_ulong tinfo_csr_read(CPURISCVState *env); =20 void riscv_cpu_debug_excp_handler(CPUState *cs); -bool riscv_cpu_debug_check_breakpoint(CPUState *cs); +bool riscv_cpu_debug_check_breakpoint(CPUState *cs, const CPUBreakpoint *b= p); bool riscv_cpu_debug_check_watchpoint(CPUState *cs, CPUWatchpoint *wp); =20 void riscv_trigger_realize(CPURISCVState *env); diff --git a/target/xtensa/cpu.h b/target/xtensa/cpu.h index 442e98bd1b..9323f45e4b 100644 --- a/target/xtensa/cpu.h +++ b/target/xtensa/cpu.h @@ -591,7 +591,7 @@ void xtensa_cpu_do_transaction_failed(CPUState *cs, hwa= ddr physaddr, vaddr addr, int mmu_idx, MemTxAttrs attrs, MemTxResult response, uintptr_t reta= ddr); hwaddr xtensa_cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr); -bool xtensa_debug_check_breakpoint(CPUState *cs); +bool xtensa_debug_check_breakpoint(CPUState *cs, const CPUBreakpoint *bp); #endif void xtensa_cpu_dump_state(CPUState *cpu, FILE *f, int flags); void xtensa_count_regs(const XtensaConfig *config, diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 9c754b0365..66ec656861 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -328,7 +328,7 @@ static bool check_for_breakpoints_slow(CPUState *cpu, v= addr pc, #else const TCGCPUOps *tcg_ops =3D cpu->cc->tcg_ops; assert(tcg_ops->debug_check_breakpoint); - match_bp =3D tcg_ops->debug_check_breakpoint(cpu); + match_bp =3D tcg_ops->debug_check_breakpoint(cpu, bp); #endif } =20 diff --git a/target/arm/tcg/debug.c b/target/arm/tcg/debug.c index 07a52643e7..565af7b985 100644 --- a/target/arm/tcg/debug.c +++ b/target/arm/tcg/debug.c @@ -373,7 +373,7 @@ static bool check_watchpoints(ARMCPU *cpu) return false; } =20 -bool arm_debug_check_breakpoint(CPUState *cs) +bool arm_debug_check_breakpoint(CPUState *cs, const CPUBreakpoint *bp) { ARMCPU *cpu =3D ARM_CPU(cs); CPUARMState *env =3D &cpu->env; diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c index 6f5dc06b3b..ee534f0a15 100644 --- a/target/i386/tcg/tcg-cpu.c +++ b/target/i386/tcg/tcg-cpu.c @@ -132,7 +132,7 @@ static int x86_cpu_mmu_index(CPUState *cs, bool ifetch) } =20 #ifndef CONFIG_USER_ONLY -static bool x86_debug_check_breakpoint(CPUState *cs) +static bool x86_debug_check_breakpoint(CPUState *cs, const CPUBreakpoint *= bp) { X86CPU *cpu =3D X86_CPU(cs); CPUX86State *env =3D &cpu->env; diff --git a/target/ppc/tcg-excp_helper.c b/target/ppc/tcg-excp_helper.c index b04f07a637..7715cae342 100644 --- a/target/ppc/tcg-excp_helper.c +++ b/target/ppc/tcg-excp_helper.c @@ -331,7 +331,7 @@ void ppc_cpu_debug_excp_handler(CPUState *cs) #endif } =20 -bool ppc_cpu_debug_check_breakpoint(CPUState *cs) +bool ppc_cpu_debug_check_breakpoint(CPUState *cs, const CPUBreakpoint *bp) { #if defined(TARGET_PPC64) CPUPPCState *env =3D cpu_env(cs); diff --git a/target/riscv/debug.c b/target/riscv/debug.c index 30d39ee5cd..1acec77caa 100644 --- a/target/riscv/debug.c +++ b/target/riscv/debug.c @@ -939,47 +939,44 @@ void riscv_cpu_debug_excp_handler(CPUState *cs) } } =20 -bool riscv_cpu_debug_check_breakpoint(CPUState *cs) +bool riscv_cpu_debug_check_breakpoint(CPUState *cs, const CPUBreakpoint *b= p) { RISCVCPU *cpu =3D RISCV_CPU(cs); CPURISCVState *env =3D &cpu->env; - CPUBreakpoint *bp; target_ulong ctrl; target_ulong pc; int trigger_type; int i; =20 - QTAILQ_FOREACH(bp, &cs->breakpoints, entry) { - for (i =3D 0; i < RV_MAX_TRIGGERS; i++) { - trigger_type =3D get_trigger_type(env, i); + for (i =3D 0; i < RV_MAX_TRIGGERS; i++) { + trigger_type =3D get_trigger_type(env, i); =20 - if (!trigger_common_match(env, trigger_type, i)) { - continue; + if (!trigger_common_match(env, trigger_type, i)) { + continue; + } + + switch (trigger_type) { + case TRIGGER_TYPE_AD_MATCH: + ctrl =3D env->tdata1[i]; + pc =3D env->tdata2[i]; + + if ((ctrl & TYPE2_EXEC) && (bp->pc =3D=3D pc)) { + env->badaddr =3D pc; + return true; } + break; + case TRIGGER_TYPE_AD_MATCH6: + ctrl =3D env->tdata1[i]; + pc =3D env->tdata2[i]; =20 - switch (trigger_type) { - case TRIGGER_TYPE_AD_MATCH: - ctrl =3D env->tdata1[i]; - pc =3D env->tdata2[i]; - - if ((ctrl & TYPE2_EXEC) && (bp->pc =3D=3D pc)) { - env->badaddr =3D pc; - return true; - } - break; - case TRIGGER_TYPE_AD_MATCH6: - ctrl =3D env->tdata1[i]; - pc =3D env->tdata2[i]; - - if ((ctrl & TYPE6_EXEC) && (bp->pc =3D=3D pc)) { - env->badaddr =3D pc; - return true; - } - break; - default: - /* other trigger types are not supported or irrelevant */ - break; + if ((ctrl & TYPE6_EXEC) && (bp->pc =3D=3D pc)) { + env->badaddr =3D pc; + return true; } + break; + default: + /* other trigger types are not supported or irrelevant */ + break; } } =20 diff --git a/target/xtensa/dbg_helper.c b/target/xtensa/dbg_helper.c index 3b91f7c38a..3d1143ad5e 100644 --- a/target/xtensa/dbg_helper.c +++ b/target/xtensa/dbg_helper.c @@ -64,7 +64,7 @@ void HELPER(wsr_ibreaka)(CPUXtensaState *env, uint32_t i,= uint32_t v) env->sregs[IBREAKA + i] =3D v; } =20 -bool xtensa_debug_check_breakpoint(CPUState *cs) +bool xtensa_debug_check_breakpoint(CPUState *cs, const CPUBreakpoint *bp) { CPUXtensaState *env =3D cpu_env(cs); unsigned int i; --=20 2.43.0 From nobody Sun Jul 26 11:07:31 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1782875213; cv=none; d=zohomail.com; s=zohoarc; b=f/wbTKm2wmybIVgearOpCsA7nmjuwkmKinToLZh7EhPKBsYmtfo4dABFy1iHOO/g/iE29ZErGWJkWK+9/RCQs5EV/0m7e/o9rTPif1sFmOt4uMbQPaeuPTmJs9AF6v0pPpLP+l7nBSvVzbwL8tQILydLk20Z8FpPNh/kc2xskdE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782875213; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=eKzv/F+MqToZ/Pnc1grvNtlQkuB0Qopo7yaWf0hhW0E=; b=ZNzGrNMzE1VEMiGLut5LqOALRVWOUxKCV7CfClt3z7yfDP4pRcqT0IAzQmfThFmotLZ5Ohz3CALZWGl9m7tQNfLuyhxipAHZssZBvdzzTHUDDQO7Dr3wH0UDcmafRgWvyFcwvRM/9GnDXUHS0p/uQtfTHlWei6BxCvFNzQW6kO8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1782875213194619.5943637664782; Tue, 30 Jun 2026 20:06:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1welFy-0005iZ-IN; Tue, 30 Jun 2026 23:04:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1welFs-0005fq-3w for qemu-devel@nongnu.org; Tue, 30 Jun 2026 23:04:52 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1welFo-0002nP-9X for qemu-devel@nongnu.org; Tue, 30 Jun 2026 23:04:51 -0400 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-2c979d03538so1018255ad.1 for ; Tue, 30 Jun 2026 20:04:47 -0700 (PDT) Received: from stoup.. (174-21-129-215.tukw.qwest.net. [174.21.129.215]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ca37c74261sm23758085ad.22.2026.06.30.20.04.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2026 20:04:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1782875087; x=1783479887; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eKzv/F+MqToZ/Pnc1grvNtlQkuB0Qopo7yaWf0hhW0E=; b=cDDbxA21tkTrtoGG70KF/788xMOol/1Ju3+fdPW900iy1NVYUfEByVhOXA0737XHr4 FYAdM62vo7woJLLlYWulkBHAimuDQnpxaWP6Gj3zHfgiQiVzHVC5r6c9JfoMn2lEgHYo 3Drc4I+zVu4Sv0nhYYb15DRQMMYJ7Lzw7f8vbe+HSdK0DX6zc4lTUhEOZ3YzPYX71wOX vTLhU8MvCqti4FLSQOlNNPOtnuhMZihDt/Tcbh4GfAGdR6nNMTQyW16G4SgmEw9cVWNy PO7Cs6FXo4a2Tupvkm7we/Ov8YvvzN8JUbCrNhDxKoL8k4CpfgtdKw4Ll6PM6Nzl9LQK ibQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782875087; x=1783479887; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=eKzv/F+MqToZ/Pnc1grvNtlQkuB0Qopo7yaWf0hhW0E=; b=LEgIgTV7pzBmiSOeoYK1B6ZcyWZuAxl97UwH2uu6jocnaOqN6vcC3eVSIHXuLc3xC0 FBU7bag5J/U+BlTHujgSPQKoTaZxvFkIg5pvWfnQKHWTgchDyens4tSlva7gbH0qEHUu wcUW9WpABT+/iWZCk30TcJb6HoStwnJ1/hxSFrJ3GangGkDBP0YIflalV2s9YOSzwM+X S5/LB4Bi6I32uAHzt5dtDbsDpCD7ZV5nNsVs60190cs1+T+W6uIhTmGRPaS8A/x7k/7H 4xj6e4jCxfecBNlG6K76NcSlSmH3TTxKx9xc3YYlFB4fElwnJXaD6w4/4Po5/+0g9EeB oKqw== X-Gm-Message-State: AOJu0YzLVmsyNI2spfFlfPKMk3vNedhLK9VsKUMAXScfPvO5NU3uaI2n Q8elW/1KvKYP5dc4LUYSIv3uHj1Zg0NemkmBTf4qKvFlN7g2wCEmkLvPvc47XdR2HFe3Tm2v6Gr tD8k/ X-Gm-Gg: AfdE7cmh3ADUl1uRQBm5OE0FApJhScB1OISxY+1Hqotg3u1+IrCAe6Y7Xxn2Gw9M11h e7yNzf0P1E2hz6veRGEb5ADkDW3SQGCR3xuCDcOQrRT70kxkDtijTbAH7ntFSA3DWRpfEtceuQf DoufPNshacoks5K3hz4/a0hVHmtU2VBgd/nZNxX8xCMSZehh0n/l9TMUAfIrVd/jwasXyX/mzlU N1aR/c8Nh+J7ut8w66cVmC1JkEqu/FW8FAh5HjGS5h91hgfGLsJE/0GWNxWX8hNOxaAyuKvCEOI EEhEefLqhUzlB89q+QG0jnDniGJ5505qW5IxQ1PE23u1Y2yfb0iJCuiOdx8W4qG4WQ+O0Rjf0mB MQtewNWYZkIN/YjD8e06elQCphY5oxJ3LJrgfhSYyZr4rP25I4peXHXnY/Yl1hDbOBBo8Cfq8vo rZ04DjdT3jpE0gWN6DAnMiY/IAVE6GXtgDKoRiej4IJJKNEpGZYLKtemAY7sAJ X-Received: by 2002:a17:902:eccd:b0:2ca:6514:9201 with SMTP id d9443c01a7336-2ca6514ad48mr18691595ad.15.1782875086705; Tue, 30 Jun 2026 20:04:46 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: shivangu@linux.ibm.com, qemu-arm@nongnu.org, qemu-riscv@nongnu.org Subject: [PATCH 02/17] accel/tcg: Constify CPUWatchpoint for debug_check_watchpoint Date: Tue, 30 Jun 2026 20:04:28 -0700 Message-ID: <20260701030443.1382447-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260701030443.1382447-1-richard.henderson@linaro.org> References: <20260701030443.1382447-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1782875215146158500 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/accel/tcg/cpu-ops.h | 2 +- target/arm/internals.h | 2 +- target/ppc/internal.h | 2 +- target/riscv/debug.h | 2 +- target/arm/tcg/debug.c | 2 +- target/ppc/tcg-excp_helper.c | 2 +- target/riscv/debug.c | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/accel/tcg/cpu-ops.h b/include/accel/tcg/cpu-ops.h index d2b9079835..1e163176f7 100644 --- a/include/accel/tcg/cpu-ops.h +++ b/include/accel/tcg/cpu-ops.h @@ -259,7 +259,7 @@ struct TCGCPUOps { * watchpoint whose address has matched should really fire, used by ARM * and RISC-V */ - bool (*debug_check_watchpoint)(CPUState *cpu, CPUWatchpoint *wp); + bool (*debug_check_watchpoint)(CPUState *cpu, const CPUWatchpoint *wp); =20 /** * @debug_check_breakpoint: return true if the architectural diff --git a/target/arm/internals.h b/target/arm/internals.h index c78c86a1fc..7a4f6938b7 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -683,7 +683,7 @@ void hw_breakpoint_update_all(ARMCPU *cpu); bool arm_debug_check_breakpoint(CPUState *cs, const CPUBreakpoint *bp); =20 /* Callback function for checking if a watchpoint should trigger. */ -bool arm_debug_check_watchpoint(CPUState *cs, CPUWatchpoint *wp); +bool arm_debug_check_watchpoint(CPUState *cs, const CPUWatchpoint *wp); =20 /* Adjust addresses (in BE32 mode) before testing against watchpoint * addresses. diff --git a/target/ppc/internal.h b/target/ppc/internal.h index f3e694c4cd..fd089ebba5 100644 --- a/target/ppc/internal.h +++ b/target/ppc/internal.h @@ -305,7 +305,7 @@ void ppc_cpu_do_transaction_failed(CPUState *cs, hwaddr= physaddr, MemTxResult response, uintptr_t retaddr= ); void ppc_cpu_debug_excp_handler(CPUState *cs); bool ppc_cpu_debug_check_breakpoint(CPUState *cs, const CPUBreakpoint *bp); -bool ppc_cpu_debug_check_watchpoint(CPUState *cs, CPUWatchpoint *wp); +bool ppc_cpu_debug_check_watchpoint(CPUState *cs, const CPUWatchpoint *wp); =20 G_NORETURN void powerpc_checkstop(CPUPPCState *env, const char *reason); void powerpc_excp(PowerPCCPU *cpu, int excp); diff --git a/target/riscv/debug.h b/target/riscv/debug.h index 91690404df..230d517f01 100644 --- a/target/riscv/debug.h +++ b/target/riscv/debug.h @@ -145,7 +145,7 @@ target_ulong tinfo_csr_read(CPURISCVState *env); =20 void riscv_cpu_debug_excp_handler(CPUState *cs); bool riscv_cpu_debug_check_breakpoint(CPUState *cs, const CPUBreakpoint *b= p); -bool riscv_cpu_debug_check_watchpoint(CPUState *cs, CPUWatchpoint *wp); +bool riscv_cpu_debug_check_watchpoint(CPUState *cs, const CPUWatchpoint *w= p); =20 void riscv_trigger_realize(CPURISCVState *env); void riscv_trigger_reset_hold(CPURISCVState *env); diff --git a/target/arm/tcg/debug.c b/target/arm/tcg/debug.c index 565af7b985..ed94b20739 100644 --- a/target/arm/tcg/debug.c +++ b/target/arm/tcg/debug.c @@ -419,7 +419,7 @@ bool arm_debug_check_breakpoint(CPUState *cs, const CPU= Breakpoint *bp) return false; } =20 -bool arm_debug_check_watchpoint(CPUState *cs, CPUWatchpoint *wp) +bool arm_debug_check_watchpoint(CPUState *cs, const CPUWatchpoint *wp) { /* * Called by core code when a CPU watchpoint fires; need to check if t= his diff --git a/target/ppc/tcg-excp_helper.c b/target/ppc/tcg-excp_helper.c index 7715cae342..7fbedbc8e3 100644 --- a/target/ppc/tcg-excp_helper.c +++ b/target/ppc/tcg-excp_helper.c @@ -358,7 +358,7 @@ bool ppc_cpu_debug_check_breakpoint(CPUState *cs, const= CPUBreakpoint *bp) return false; } =20 -bool ppc_cpu_debug_check_watchpoint(CPUState *cs, CPUWatchpoint *wp) +bool ppc_cpu_debug_check_watchpoint(CPUState *cs, const CPUWatchpoint *wp) { #if defined(TARGET_PPC64) CPUPPCState *env =3D cpu_env(cs); diff --git a/target/riscv/debug.c b/target/riscv/debug.c index 1acec77caa..ad9df09cf7 100644 --- a/target/riscv/debug.c +++ b/target/riscv/debug.c @@ -983,7 +983,7 @@ bool riscv_cpu_debug_check_breakpoint(CPUState *cs, con= st CPUBreakpoint *bp) return false; } =20 -bool riscv_cpu_debug_check_watchpoint(CPUState *cs, CPUWatchpoint *wp) +bool riscv_cpu_debug_check_watchpoint(CPUState *cs, const CPUWatchpoint *w= p) { RISCVCPU *cpu =3D RISCV_CPU(cs); CPURISCVState *env =3D &cpu->env; --=20 2.43.0 From nobody Sun Jul 26 11:07:31 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1782875251; cv=none; d=zohomail.com; s=zohoarc; b=ndXFv95AePysod1DRbp0ECohph3625XdD4q9JKhsAGhiY76W8DaNAUeEAKFieNJVgKcxCqdFPLFRHh/Itz+t5kpY6nPwSGWy8dQke83ybl6ZGFMotpqtA+a22vR407UL4li9UFXShml2aMHoI/6hxKApMeriqXDpYZe1LuLnKJ0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782875251; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=jyK+CTy7AHFZZvKhxQNNFWU8l3C1vqLCkOkPJFqKdno=; b=LxufEyrfAg3TFoY2mY90aebQdh8pDUQi6H+mRQNS0ErOHrbIU6HxF/Jvx/uDUWP7JIS00b/Yv4k5KUKJv0Qzptx04xLZVcrPiAK7oBvsWS66V3KuJ+oD4deaQze53+QADbYTzRI1TTJp+w5dAnWSMYZu2ET16cnO4hdmlAJgKj8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1782875251034281.1074300764899; Tue, 30 Jun 2026 20:07:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1welG2-0005nK-O0; Tue, 30 Jun 2026 23:05:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1welFs-0005gP-S5 for qemu-devel@nongnu.org; Tue, 30 Jun 2026 23:04:52 -0400 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1welFp-0002nb-1z for qemu-devel@nongnu.org; Tue, 30 Jun 2026 23:04:52 -0400 Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-c99eaa1f020so103225a12.2 for ; Tue, 30 Jun 2026 20:04:48 -0700 (PDT) Received: from stoup.. (174-21-129-215.tukw.qwest.net. [174.21.129.215]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ca37c74261sm23758085ad.22.2026.06.30.20.04.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2026 20:04:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1782875087; x=1783479887; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jyK+CTy7AHFZZvKhxQNNFWU8l3C1vqLCkOkPJFqKdno=; b=eMcx10feUvaW01GHjD4MJrkbFDzX+Iben4Ja+hbwM5LmaBO9xfmQ9RTb5ivh6Bgav7 eaLbU+1ZV3MT4bbj6X3slZsQtAui+Uf7PyLFtrMdgmXLXi6GPgPEwG1hJvnATq+ors6z idAPYt/+DvqMmRGDShG5FOXVtXNRSa4pI5U83FxEPz3ddfqe7p2EnnX3RhAQq9silJAC 64p2gnj3Ud48Q9pWJ3SshJPFkBQ70occYllkjjtn2taH2odB62rC7KDvZH/6lw741sME XboLM2TJnRNKjr5Fz8CspnIVCyCmxtNSydEX3XEMZGnN/YzBfFyqgMEWo5zevp+rPv/3 gSZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782875087; x=1783479887; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=jyK+CTy7AHFZZvKhxQNNFWU8l3C1vqLCkOkPJFqKdno=; b=NlgaLBZSFvrFSdNPHN505+SYNK0i6pmZxN7cgHmKh8bLkjxVN3qqBzKXgx5lERSjyU /WjPRXAx0myD+cilIri+fnN5Rlh4G/t9P/8XxbhtuF1lYoVXgtqXSwVflZN1bMX8SV5a saJPh6242IyA56IF5d4QN7NbXYubwuwkZEdjzLkbYa9478JQpCHurjaGE/0hFfZvQ/dY rK8ECyQ7D65VYC5i1wApvxGsRSAlIutf3q1wVyuw3ASXV+JNsxQEaj+37LEJYuVH9pC3 0jG2KfF6LRfZkF/9ej6X9Pn5b2jTD1dHGutep5ki+cKvPkWyFGQQH4upGVUkCPzWO2zM dlIw== X-Gm-Message-State: AOJu0YxXdmJSaxY2XydfAjY7dBf2lDsXga0lHm5c6gBWaI7B/1tj8akq niLLanpLvXxg+/rfcyDk607qKocQhlUV7eMYMbK3WTnvQBobsnOMdfj+un+hIF0VH9EGboTl1e3 loD5m X-Gm-Gg: AfdE7ckqVVHk74ycaCfPpFJ4FoPu84MhTOIypjQYpt9Xnr8l29uorzAj03BWAgYzAc+ 58dC6YUeaY6pmSu14pv1H2s4frWNJ1J4PJmnjQeRpeGjQgJoXBPDKEl5AoHaCOQKbcqZoLl7vRQ pKcZU0cR5saWCEc8x7k8/iDWls0FdB4Go3O0p+qXltkkigWlRmzpi4TOukJDHBS9aqbinqquI81 Cwyb/HU0xT6GHoP0ltIXF7tLOMq/022DzcnCeR6X0z8Tj3p7wYIRVHCFQlOup1RAU5CHAZWlcVE 8s1ZvMLSMb3sRL5/b594UiD/xWd1C3B3F7udeGPOV5Bg6FiUC0aG5F/F9U5UbkveS6Q+07eiZ+J R2owde57nyvV693UgrULe9zp6Y6WW7X5NsIFA4cNBCXQjkl7yDli7LMwYdQ4A9lyZZruEVgQcWe +036lDMK6Fm5iSfEuY3SDZUPmJP7cUW/WqCdCvERvIY708FYlq4pHeSt/7QVyW X-Received: by 2002:a17:903:15cf:b0:2ba:924b:3948 with SMTP id d9443c01a7336-2ca2d56494cmr53298245ad.15.1782875087461; Tue, 30 Jun 2026 20:04:47 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: shivangu@linux.ibm.com, qemu-arm@nongnu.org, qemu-riscv@nongnu.org Subject: [PATCH 03/17] cpu: Move cpu_breakpoint_test out of line Date: Tue, 30 Jun 2026 20:04:29 -0700 Message-ID: <20260701030443.1382447-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260701030443.1382447-1-richard.henderson@linaro.org> References: <20260701030443.1382447-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::52b; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1782875253610158500 Content-Type: text/plain; charset="utf-8" Move the function to cpu-common.c, with the other breakpoint functions. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/core/cpu.h | 16 +--------------- cpu-common.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 59d601465b..b853824e47 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -1157,21 +1157,7 @@ int cpu_breakpoint_insert(CPUState *cpu, vaddr pc, i= nt flags, int cpu_breakpoint_remove(CPUState *cpu, vaddr pc, int flags); void cpu_breakpoint_remove_by_ref(CPUState *cpu, CPUBreakpoint *breakpoint= ); void cpu_breakpoint_remove_all(CPUState *cpu, int mask); - -/* Return true if PC matches an installed breakpoint. */ -static inline bool cpu_breakpoint_test(CPUState *cpu, vaddr pc, int mask) -{ - CPUBreakpoint *bp; - - if (unlikely(!QTAILQ_EMPTY(&cpu->breakpoints))) { - QTAILQ_FOREACH(bp, &cpu->breakpoints, entry) { - if (bp->pc =3D=3D pc && (bp->flags & mask)) { - return true; - } - } - } - return false; -} +bool cpu_breakpoint_test(CPUState *cpu, vaddr pc, int mask); =20 /** * cpu_get_address_space: diff --git a/cpu-common.c b/cpu-common.c index 988d057d84..adb76b3a78 100644 --- a/cpu-common.c +++ b/cpu-common.c @@ -388,6 +388,21 @@ void process_queued_cpu_work(CPUState *cpu) qemu_cond_broadcast(&qemu_work_cond); } =20 +/* Return true if PC matches an installed breakpoint. */ +bool cpu_breakpoint_test(CPUState *cpu, vaddr pc, int mask) +{ + CPUBreakpoint *bp; + + if (unlikely(!QTAILQ_EMPTY(&cpu->breakpoints))) { + QTAILQ_FOREACH(bp, &cpu->breakpoints, entry) { + if (bp->pc =3D=3D pc && (bp->flags & mask)) { + return true; + } + } + } + return false; +} + /* Add a breakpoint. */ int cpu_breakpoint_insert(CPUState *cpu, vaddr pc, int flags, CPUBreakpoint **breakpoint) --=20 2.43.0 From nobody Sun Jul 26 11:07:31 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1782875119; cv=none; d=zohomail.com; s=zohoarc; b=BxGqNZmGnWpVINWLPTwaHTMhAO4NLDtnS3B+kmVTdD5MFSoAWNGRjPpf/IhJUNlxkpZQLGbLme5ihplAEBAAUrD2XdAmVbeLPdD9PcFyVJjkFfKz4STs4uBphlCikaQ4nf5PFcAwA4+0rLeflSXR/urqj8y1WtvOl4fKDA7mE5I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782875119; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=QYQVNWpWGwmaVZc4jT8q1D8DLBPAuVdV88yXOr2IM3U=; b=RavlRS9Jxwk/D+W2ry3pV46+pBQjPxSiKgnEWv43XACWlvgmAQu2XoTAGH/RHXUuNCNkYambWJp1En3dGKzcmDwrgENfRDqDqEn7iKz3b8a1WfLkUledY6aCG/4HRWrK+sUHAXpE+1JMV1yODqS53239JtmM7U3iYjWh2ND7RfM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1782875119760428.1313418409999; Tue, 30 Jun 2026 20:05:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1welG3-0005pG-Py; Tue, 30 Jun 2026 23:05:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1welFu-0005gw-2o for qemu-devel@nongnu.org; Tue, 30 Jun 2026 23:04:56 -0400 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1welFq-0002ns-Lc for qemu-devel@nongnu.org; Tue, 30 Jun 2026 23:04:53 -0400 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-2c7ebfb63c6so1375655ad.3 for ; Tue, 30 Jun 2026 20:04:49 -0700 (PDT) Received: from stoup.. (174-21-129-215.tukw.qwest.net. [174.21.129.215]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ca37c74261sm23758085ad.22.2026.06.30.20.04.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2026 20:04:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1782875088; x=1783479888; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QYQVNWpWGwmaVZc4jT8q1D8DLBPAuVdV88yXOr2IM3U=; b=iabYDam/BRf1WY0sPLi64df++03gX1uJoSxWj+aPpA71NYglojakXsun5X1xPb48OU /z6+FgRhHhroZiZAvSAVy8TrYB6wfUWJI7Um4NvdwoYfaAZhXnoCRPBFEmAK2Exz90fV iswi1wCTtqg0Sa6sNOpa3vASyUEyEuA3+JcDXptd/mIBrr3Zjd2Rxs8bEEz8sDqpUsou DivJh+8QwEpEP1lC6/Cr4XvZ1RVgxw/j5HdK7+zVTinm6Kza5bbA+5knuHFhyaLvG4xz gnO5J6dEXXXF9vAetnAB/Ym8CEHwJQd0dPVKnhwwgvZ56I1/0OPuz+oIM/VOBz119Ipu 15Mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782875088; x=1783479888; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=QYQVNWpWGwmaVZc4jT8q1D8DLBPAuVdV88yXOr2IM3U=; b=PsdizAK/35GScQk6/ab1uAPip6sJM+PkaWDNQ48S+tW5QDfQYcCl827isWmg5Ifn7X v6VGSApoqK8mz+Roc6RSBCvKMxgivW+FGY8ZzILjGfolT+FJwKWB4zjPScX6h4b8qy2X bipcBFCkFA44CaJSvV/twh9x5zcjnchrxWpRvQIEpceqLZRr2U6UIqD3fzalB22tn24L 8W/hdFXliVjMMljMb+kHVU+yvaG8QjBRQ3/5muW+7zVGzJjhmPcLGQ4jAdu+s50jj+l4 6vd2anvUGuQOtJe6Qk5NIxYiZJ6vwNCVFVb59FR56YtEWduqmlDUAJOhrXW0WLbREHb5 R/oQ== X-Gm-Message-State: AOJu0Ywbs8RIEBNRBbAyLAyNRSGwQlwVC6aAHil9O/UGz6ePaSEaEagJ xFdjarzynptz51XsN2Vat1Q0+sBU2TTyi0EIAJ7r/875CVlNuIZFr8yHUYFe6SpopIJ0gNJJOjd L7CBk X-Gm-Gg: AfdE7cklM2NUq5x287v+yqianStP+nsiF4uVjiQWZNKQvyvVCBNktfvfL+Af4QdJrQs 1qXE+8B8VR7fSsZRIAfAMSOn9BWgkWfmH8WN8etdVY97x29+UZhubpRAG+glnYP9YrUY5TeRuH6 rL2RE9KLV60a1n6nmtluY0kXSgnH4hEsXSqhWxxu0WMYnhPH86swHGuQy/gAkFgYDnxUJ62PBgL 4HDdfsv5u/C2+WlogW1LnldIAuwxK9VW1LFDVOu15jcY/y1GeSWULaEn+ofVBP7Zkvx4eB+/o5F /LqvHBkH/5uU9fTzoyINvrWaELo7DoVZdL2J3ZP3NRY5AG9z7Z7aB1iQ3CRHH6tFZ9ML8wNrIJm IEcwiBVsBHMkjQrO/ReXOY4s4B7CmLdR/qCvmzx6ynM+PYcknnisTCfy4FVrxKbhhMoDaq3MsX+ cMpS29JjZU43GAHS9KXiRs9VVJbtrjJqywJTYicQkXg8YR7MPGjg== X-Received: by 2002:a17:903:41c8:b0:2c9:c952:6e9 with SMTP id d9443c01a7336-2ca2d52ad0amr52835295ad.2.1782875088326; Tue, 30 Jun 2026 20:04:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: shivangu@linux.ibm.com, qemu-arm@nongnu.org, qemu-riscv@nongnu.org Subject: [PATCH 04/17] exec/breakpoint: Move BP declarations from hw/core/cpu.h Date: Tue, 30 Jun 2026 20:04:30 -0700 Message-ID: <20260701030443.1382447-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260701030443.1382447-1-richard.henderson@linaro.org> References: <20260701030443.1382447-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62e.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1782875120642158500 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson --- include/exec/breakpoint.h | 21 +++++++++++++++++++++ include/hw/core/cpu.h | 21 --------------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/include/exec/breakpoint.h b/include/exec/breakpoint.h index 95f0482e6d..4013d9a07c 100644 --- a/include/exec/breakpoint.h +++ b/include/exec/breakpoint.h @@ -12,6 +12,20 @@ #include "exec/vaddr.h" #include "exec/memattrs.h" =20 +/* Breakpoint/watchpoint flags */ +#define BP_MEM_READ 0x01 +#define BP_MEM_WRITE 0x02 +#define BP_MEM_ACCESS (BP_MEM_READ | BP_MEM_WRITE) +#define BP_STOP_BEFORE_ACCESS 0x04 +/* 0x08 currently unused */ +#define BP_GDB 0x10 +#define BP_CPU 0x20 +#define BP_ANY (BP_GDB | BP_CPU) +#define BP_HIT_SHIFT 6 +#define BP_WATCHPOINT_HIT_READ (BP_MEM_READ << BP_HIT_SHIFT) +#define BP_WATCHPOINT_HIT_WRITE (BP_MEM_WRITE << BP_HIT_SHIFT) +#define BP_WATCHPOINT_HIT (BP_MEM_ACCESS << BP_HIT_SHIFT) + typedef struct CPUBreakpoint { vaddr pc; int flags; /* BP_* */ @@ -27,4 +41,11 @@ typedef struct CPUWatchpoint { QTAILQ_ENTRY(CPUWatchpoint) entry; } CPUWatchpoint; =20 +int cpu_breakpoint_insert(CPUState *cpu, vaddr pc, int flags, + CPUBreakpoint **breakpoint); +int cpu_breakpoint_remove(CPUState *cpu, vaddr pc, int flags); +void cpu_breakpoint_remove_by_ref(CPUState *cpu, CPUBreakpoint *breakpoint= ); +void cpu_breakpoint_remove_all(CPUState *cpu, int mask); +bool cpu_breakpoint_test(CPUState *cpu, vaddr pc, int mask); + #endif diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index b853824e47..e05e261883 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -1138,27 +1138,6 @@ void qemu_init_vcpu(CPUState *cpu); */ void cpu_single_step(CPUState *cpu, int enabled); =20 -/* Breakpoint/watchpoint flags */ -#define BP_MEM_READ 0x01 -#define BP_MEM_WRITE 0x02 -#define BP_MEM_ACCESS (BP_MEM_READ | BP_MEM_WRITE) -#define BP_STOP_BEFORE_ACCESS 0x04 -/* 0x08 currently unused */ -#define BP_GDB 0x10 -#define BP_CPU 0x20 -#define BP_ANY (BP_GDB | BP_CPU) -#define BP_HIT_SHIFT 6 -#define BP_WATCHPOINT_HIT_READ (BP_MEM_READ << BP_HIT_SHIFT) -#define BP_WATCHPOINT_HIT_WRITE (BP_MEM_WRITE << BP_HIT_SHIFT) -#define BP_WATCHPOINT_HIT (BP_MEM_ACCESS << BP_HIT_SHIFT) - -int cpu_breakpoint_insert(CPUState *cpu, vaddr pc, int flags, - CPUBreakpoint **breakpoint); -int cpu_breakpoint_remove(CPUState *cpu, vaddr pc, int flags); -void cpu_breakpoint_remove_by_ref(CPUState *cpu, CPUBreakpoint *breakpoint= ); -void cpu_breakpoint_remove_all(CPUState *cpu, int mask); -bool cpu_breakpoint_test(CPUState *cpu, vaddr pc, int mask); - /** * cpu_get_address_space: * @cpu: CPU to get address space from --=20 2.43.0 From nobody Sun Jul 26 11:07:31 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1782875356; cv=none; d=zohomail.com; s=zohoarc; b=EvE4mBWlna73qcSh0GdqFjbUegDQaJzdHE7Ii7ZhVltZLUUYwT0sqU7vrapKdF9oaQzH8DbL1LByuopYAeSegZjb/LkHzNm1PZt9aUE81sbUkT54sCL6VaRkl1KZUEozh23hlmdWw7HT1CWCFtBF6r5jrrYROIzB/zv3h+bh96k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782875356; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=453lJLYfSza/GUfaKZX+AmJfUJI+W0lWC7DD9POCfCA=; b=aqUv13fsULOG2L8spcYJ6DREKB4HVRBhD8pQMB8FUfhsUVW2dzXV2OGdfopzVStl2eP6d4/A09o0zTT7lS7EN1jYU04Nn6Ne/FYxlFgiu2Zronzr1uP8EYHEj3Sq8gE/+N3L057sGr+bOWId0w4AOJI6DcE3qHEtXof/ilxJWQE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1782875356483818.2260651601345; Tue, 30 Jun 2026 20:09:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1welG8-0005w8-Us; Tue, 30 Jun 2026 23:05:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1welFu-0005gy-Nz for qemu-devel@nongnu.org; Tue, 30 Jun 2026 23:04:56 -0400 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1welFq-0002oB-Lk for qemu-devel@nongnu.org; Tue, 30 Jun 2026 23:04:54 -0400 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-2c821a50615so953575ad.0 for ; Tue, 30 Jun 2026 20:04:50 -0700 (PDT) Received: from stoup.. (174-21-129-215.tukw.qwest.net. [174.21.129.215]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ca37c74261sm23758085ad.22.2026.06.30.20.04.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2026 20:04:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1782875089; x=1783479889; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=453lJLYfSza/GUfaKZX+AmJfUJI+W0lWC7DD9POCfCA=; b=DbkmgQhsTPiN93TarzKWntJgDzmm4sYiXLRapZHfGq975of//2F4//tiP03XkSCdtR 6BH6LvoTFOHEM47WjDdvrvbIiBEDTgXu7hs+vf6AF5a+P48i7SCm4nM5tzl/DxolZvmr /NMPI2fHl3pOd+ARyQd6nuE5C4QGLHeSAAMzpj3TPrEIEYRpOhK7uSoxEC0GwRP+9zdL kscxxJCjwopFOA50ysadiWwznjy8iaV3I75XVDN6pu6N5O996bHgoZQxrJnD5tBvb8cE 58FYxw3932D+7LX9v6nLTO3B/lQWV9BxTDPnRJvW0j87gFwzBLrDOl4uggE5F2zMwoiW wyjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782875089; x=1783479889; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=453lJLYfSza/GUfaKZX+AmJfUJI+W0lWC7DD9POCfCA=; b=laKAKQJ7KAm4/psvKAhKN/OHlhO8VLoHnbZxiUCJjKSzk3SfjN5QD1gwDQh+HZyNGE T9+GkcQhkd0V+UianmdJE4V6gF5vUNdMm0cxdjv9Iueem1M1A936/7R87A8fckfUcP8M 6xLGlnF42UcSopTegSLBHOvKqOEu1tfqJ4Rxz2gnshX570bdkpctofihX04NzLEG0W+A 9gUbdt+JOVcjoSmb24FC1fVa5uSfiaN/BWxxArpOFtZZmAqrmb2duAsAOD5p9IVCy2H/ OPgbOQJq0w+eLBquTS1nNW5i24t1UWnOZDy1YBRUDqLjNPxeifrWLN2lsn0jxQ2I9OuF 0/NQ== X-Gm-Message-State: AOJu0Yz6NkGvOHOAZg5xJAAzbENVvH3SfTEWPIko5Fk3PksPHu0dSlFV CqwmXeVypR/moFvMpowgikfkArtQG+F32nQLo1rSZLNdV+CRoBHFuQNDyF+JkTUnAkrBj7MjO9V hJAUm X-Gm-Gg: AfdE7clq9uwmIi1z+08BoElu7OVDvZyRJuP496nNP7KZqkCCL18I88celJYftClg1JB r6Yx+QsRlmco1jk8M9bsebSLKZdXXXLtjZqf7gXKUDkg4LshgOsv8OcYXLVlzl07qnoZiBQH+n2 yUzxOA2s3Qr1TSGgmAF0LbXoJXT/QhElBkOvvCTSNwj6VHOYs4/SyhYlRJ2SANiKExryAzlfrww 9iRhucS4iwScyJKKQzX95y39mMQp7ZkK4rz8nu8kpH5Lm2YLTziAwuQDByXCr2zB3/9eVyCFOIO ZtPsK9y9rwZ5pszQyXhQOa+YWnbfwaFAUQbKyA5kS0adEWNR+16b9pFGVqdGRXKOLXjKZaVu5ee SL95meOPElzBq0QaeY8i9t8g/0tRcwBbt7wVta+Z4ZE6mfeFIyEEpl9aCx3AYZn2jQMK9bQr3i0 Wbi3uGlYcllnttwHwSPCLEy/mRn9WFDhqkeeB3ae8iKrFf/DpVZQ== X-Received: by 2002:a17:902:d549:b0:2c9:e5e6:8621 with SMTP id d9443c01a7336-2ca2e718688mr54455215ad.25.1782875089104; Tue, 30 Jun 2026 20:04:49 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: shivangu@linux.ibm.com, qemu-arm@nongnu.org, qemu-riscv@nongnu.org Subject: [PATCH 05/17] qemu/typedefs: Declare CPUBreakpoint and CPUWatchpoint globally Date: Tue, 30 Jun 2026 20:04:31 -0700 Message-ID: <20260701030443.1382447-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260701030443.1382447-1-richard.henderson@linaro.org> References: <20260701030443.1382447-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x633.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1782875357813158500 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson --- include/exec/breakpoint.h | 8 ++++---- include/qemu/typedefs.h | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/exec/breakpoint.h b/include/exec/breakpoint.h index 4013d9a07c..fc91343875 100644 --- a/include/exec/breakpoint.h +++ b/include/exec/breakpoint.h @@ -26,20 +26,20 @@ #define BP_WATCHPOINT_HIT_WRITE (BP_MEM_WRITE << BP_HIT_SHIFT) #define BP_WATCHPOINT_HIT (BP_MEM_ACCESS << BP_HIT_SHIFT) =20 -typedef struct CPUBreakpoint { +struct CPUBreakpoint { vaddr pc; int flags; /* BP_* */ QTAILQ_ENTRY(CPUBreakpoint) entry; -} CPUBreakpoint; +}; =20 -typedef struct CPUWatchpoint { +struct CPUWatchpoint { vaddr vaddr; vaddr len; vaddr hitaddr; MemTxAttrs hitattrs; int flags; /* BP_* */ QTAILQ_ENTRY(CPUWatchpoint) entry; -} CPUWatchpoint; +}; =20 int cpu_breakpoint_insert(CPUState *cpu, vaddr pc, int flags, CPUBreakpoint **breakpoint); diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index 2344c92182..919fe8ebff 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -39,9 +39,11 @@ typedef struct Chardev Chardev; typedef struct Clock Clock; typedef struct ConfidentialGuestSupport ConfidentialGuestSupport; typedef struct CPUArchState CPUArchState; +typedef struct CPUBreakpoint CPUBreakpoint; typedef struct CPUPluginState CPUPluginState; typedef struct CPUState CPUState; typedef struct CPUTLBEntryFull CPUTLBEntryFull; +typedef struct CPUWatchpoint CPUWatchpoint; typedef struct DeviceState DeviceState; typedef struct DirtyBitmapSnapshot DirtyBitmapSnapshot; typedef struct DisasContextBase DisasContextBase; --=20 2.43.0 From nobody Sun Jul 26 11:07:31 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1782875299; cv=none; d=zohomail.com; s=zohoarc; b=jgQ4DXPfve5LshEHdANe1wRNmbWD9NQBGUlezKniK6gCs8522diGokCZjCCnJ9kEIhwQqehMDYhErsVMNHP2CLHbHex+GXJ4+NIye5HV118oj7IiU46+wIwZtfpttDbu4Fi73Uyty7pZvLbU/cMhFCdObC+47ppSwLsFvRkSbVA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782875299; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fYkR10xGijSj9NHAYmbf6T4A8YrwDfmmBe0qsSqt02A=; b=Zb7u4JtOS4Xtnys1386fG6099c5SRpiVhj/aRZ+O9Fzl959PcviCVtlPHn8cva7E6j/dsTrKksHPXyQgPMuS+aMDO/79tK1ca1vxElSCbqvSQWcB1PXcTgy8RHaXz1YFuGCKC1VzodVvkvkq0nc7W8HLAkkQiT1CtCpsue2cY0o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1782875299656669.2990555834506; Tue, 30 Jun 2026 20:08:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1welG4-0005pi-1q; Tue, 30 Jun 2026 23:05:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1welFv-0005gz-Ar for qemu-devel@nongnu.org; Tue, 30 Jun 2026 23:04:56 -0400 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1welFr-0002oS-IU for qemu-devel@nongnu.org; Tue, 30 Jun 2026 23:04:55 -0400 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-2c9f10fa7a3so1525605ad.0 for ; Tue, 30 Jun 2026 20:04:50 -0700 (PDT) Received: from stoup.. (174-21-129-215.tukw.qwest.net. [174.21.129.215]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ca37c74261sm23758085ad.22.2026.06.30.20.04.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2026 20:04:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1782875090; x=1783479890; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fYkR10xGijSj9NHAYmbf6T4A8YrwDfmmBe0qsSqt02A=; b=PlJh29MZG+wnIK3EdQOaafl/sF1UKw7yA0RgbRw/knE+ZRI4U6MBNDMyYeMPsElD5R CankjxBYkYOBtF2g/jKbdBsve97YVd214sEqHfjAfsJ2PTEpOoqK/tZCzL9luePyz6YC yjEAr//nAIYnnj26I+ef9qhBDOVNyRWgdyCjnTF9dv6eyWvd6WlllQiExy8d3pPDrH5S 0UlnQFt+hybYGklPWfiXl/DPj4LNdG+JbGlm06j1uBwrE+YvLp+OXmlRfHsZAA6tKt2s 0OINouPKuiFH33QvC0TdbdBgY+1TuUXwWCIXUsDpn2s1scpgObEVgK492Etw2k0+3tzp 5rWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782875090; x=1783479890; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=fYkR10xGijSj9NHAYmbf6T4A8YrwDfmmBe0qsSqt02A=; b=h3ONIzrS56HSEAhCdehoBvybSmfdH8aR7lwgkjEJ7yTPFYCAANDBrllagOODDqjna2 hwZB+fgU4sUsqtVHiu0FPviw7LeBLsvJH0YomSCBpHfwQBPqLNEtv5rl9vjEFEeoCBj2 Q28/ibSM40IPuq1lWZITemO8JBuksxkyyaxPVEhMZnJeXSB25LRUUVtrfiFB81LfshFP UZkHbpssddLy6fD0LaIhLO6nq+RYLsC+2DCOFUuCIGZneoLzDbHRK8TI2ls4Kh3lE5eN 996LV95hEc8A5lg1l0ULcBhAz4euOq17YMe5Zi7SAO5uO2bgnm5EQRm39KTjKSHIqyhJ USgQ== X-Gm-Message-State: AOJu0YyVvUfPz1r0CTCOuIv02I6JJNOw43pJF+xjQzJPeF6etRJaEr9g f2F59yOQpr8f74oYxnuHrnFsRvuuqiMemfQdrFsPfSB6iuv6IO+Rlc4z0dBV5LQeJ8SRtfNiN8o KhMwN X-Gm-Gg: AfdE7ckPFyULnfBbzBx4n9RkonxrAxq6idoN3u1paP6DlneJdQm/GySmrsxIjZ2Twkn ydMrVt3a4Y7h7atG67KxJ765/lg3P3IS2mMDC2rDMOfwetx7zql1RKwNd8rGsuh2qeYV3YXPZ8Y fAsrFlK60BmHjAJu2rmhnjJc+FpiCkTSADkM8JdkWo6stCGRlLoUhbuPEEtHiUihrsb3Pn00Gzv w6SQ3kOjQKXwiRvNyOMSRFx25by52+u4c+dStIqMqRA4ojuhn2GfjDD0gOuFOhcqU21OR2evdkH 6kME1JXxoWH4GMyrXRZWKpr0XXz8aTGCCaGXntBor3EVQSsPsYtIokXY35S93hNqxfHTOal7Mw6 TvLe5xG6KQWvrsRYnepftS4pUdnoz1vYVfYBy6ow3mhe7aSs6SIJKQLXEHOivw76U70x3iC0H3V XFCMtlA2PlmsI3/kcODa9Q5nYi9UKs2mEbwngNlnuy77rE9w/EGA== X-Received: by 2002:a17:903:291:b0:2c9:bd64:8c81 with SMTP id d9443c01a7336-2ca5a58544dmr25847205ad.18.1782875089934; Tue, 30 Jun 2026 20:04:49 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: shivangu@linux.ibm.com, qemu-arm@nongnu.org, qemu-riscv@nongnu.org Subject: [PATCH 06/17] *: Add missing include of exec/breakpoint.h Date: Tue, 30 Jun 2026 20:04:32 -0700 Message-ID: <20260701030443.1382447-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260701030443.1382447-1-richard.henderson@linaro.org> References: <20260701030443.1382447-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x633.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1782875301545158500 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson --- accel/tcg/tcg-accel-ops.c | 1 + cpu-common.c | 1 + gdbstub/system.c | 1 + gdbstub/user.c | 1 + system/watchpoint.c | 1 + target/i386/cpu.c | 1 + target/i386/kvm/kvm.c | 1 + target/i386/machine.c | 1 + target/i386/tcg/system/bpt_helper.c | 1 + target/ppc/cpu.c | 1 + target/xtensa/dbg_helper.c | 1 + target/xtensa/helper.c | 1 + 12 files changed, 12 insertions(+) diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index c179cd4ade..c153bb3355 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -31,6 +31,7 @@ #include "accel/tcg/cpu-loop.h" #include "system/tcg.h" #include "system/replay.h" +#include "exec/breakpoint.h" #include "exec/icount.h" #include "qemu/main-loop.h" #include "qemu/guest-random.h" diff --git a/cpu-common.c b/cpu-common.c index adb76b3a78..11ab32d64d 100644 --- a/cpu-common.c +++ b/cpu-common.c @@ -20,6 +20,7 @@ #include "qemu/osdep.h" #include "qemu/main-loop.h" #include "exec/cpu-common.h" +#include "exec/breakpoint.h" #include "hw/core/cpu.h" #include "qemu/lockable.h" #include "trace/trace-root.h" diff --git a/gdbstub/system.c b/gdbstub/system.c index 2063b63b2f..6ff24312bf 100644 --- a/gdbstub/system.c +++ b/gdbstub/system.c @@ -18,6 +18,7 @@ #include "gdbstub/syscalls.h" #include "gdbstub/commands.h" #include "exec/hwaddr.h" +#include "exec/breakpoint.h" #include "accel/accel-ops.h" #include "accel/accel-cpu-ops.h" #include "system/address-spaces.h" diff --git a/gdbstub/user.c b/gdbstub/user.c index 97eb13e796..05fe18f906 100644 --- a/gdbstub/user.c +++ b/gdbstub/user.c @@ -14,6 +14,7 @@ #include "qemu/cutils.h" #include "qemu/sockets.h" #include "qapi/error.h" +#include "exec/breakpoint.h" #include "exec/hwaddr.h" #include "exec/gdbstub.h" #include "gdbstub/commands.h" diff --git a/system/watchpoint.c b/system/watchpoint.c index 21d0bb36ca..4c2543a7c9 100644 --- a/system/watchpoint.c +++ b/system/watchpoint.c @@ -21,6 +21,7 @@ #include "qemu/error-report.h" #include "exec/cputlb.h" #include "exec/target_page.h" +#include "exec/breakpoint.h" #include "exec/watchpoint.h" #include "hw/core/cpu.h" =20 diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 5805d33ab9..422ca139af 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -39,6 +39,7 @@ #include "standard-headers/asm-x86/kvm_para.h" #include "hw/core/qdev-properties.h" #include "hw/i386/topology.h" +#include "exec/breakpoint.h" #include "exec/watchpoint.h" #ifndef CONFIG_USER_ONLY #include "confidential-guest.h" diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 64cc421abe..739e21793d 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -70,6 +70,7 @@ #include "migration/blocker.h" #include "exec/memattrs.h" #include "exec/target_page.h" +#include "exec/breakpoint.h" #include "trace.h" =20 #include CONFIG_DEVICES diff --git a/target/i386/machine.c b/target/i386/machine.c index 1f5c517e56..2b9cf3878d 100644 --- a/target/i386/machine.c +++ b/target/i386/machine.c @@ -7,6 +7,7 @@ #include "hw/i386/x86.h" #include "kvm/kvm_i386.h" #include "hw/xen/xen.h" +#include "exec/breakpoint.h" #include "exec/watchpoint.h" #include "system/kvm.h" #include "system/kvm_xen.h" diff --git a/target/i386/tcg/system/bpt_helper.c b/target/i386/tcg/system/b= pt_helper.c index 2feea69c8a..3b1ecd8735 100644 --- a/target/i386/tcg/system/bpt_helper.c +++ b/target/i386/tcg/system/bpt_helper.c @@ -21,6 +21,7 @@ #include "accel/tcg/cpu-loop.h" #include "cpu.h" #include "exec/helper-proto.h" +#include "exec/breakpoint.h" #include "exec/watchpoint.h" #include "tcg/helper-tcg.h" =20 diff --git a/target/ppc/cpu.c b/target/ppc/cpu.c index 41edb18643..0bd6ebe39b 100644 --- a/target/ppc/cpu.c +++ b/target/ppc/cpu.c @@ -22,6 +22,7 @@ #include "cpu-models.h" #include "cpu-qom.h" #include "exec/log.h" +#include "exec/breakpoint.h" #include "exec/watchpoint.h" #include "fpu/softfloat-helpers.h" #include "mmu-hash64.h" diff --git a/target/xtensa/dbg_helper.c b/target/xtensa/dbg_helper.c index 3d1143ad5e..160cdd798c 100644 --- a/target/xtensa/dbg_helper.c +++ b/target/xtensa/dbg_helper.c @@ -30,6 +30,7 @@ #include "cpu.h" #include "exec/helper-proto.h" #include "qemu/host-utils.h" +#include "exec/breakpoint.h" #include "exec/watchpoint.h" #include "system/address-spaces.h" =20 diff --git a/target/xtensa/helper.c b/target/xtensa/helper.c index 5a0e865514..0db5502287 100644 --- a/target/xtensa/helper.c +++ b/target/xtensa/helper.c @@ -30,6 +30,7 @@ #include "cpu.h" #include "exec/cputlb.h" #include "exec/target_page.h" +#include "exec/breakpoint.h" #include "gdbstub/helpers.h" #include "exec/helper-proto.h" #include "accel/tcg/cpu-loop.h" --=20 2.43.0 From nobody Sun Jul 26 11:07:31 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1782875173; cv=none; d=zohomail.com; s=zohoarc; b=kS4pogOmpoZ1rJRGOrF4bqpQDFoAcnJX03WgKdojJO52cBBdealISXTPDNSXFc0/0GVpmWmhvxo/GJKHTLRXT25DGmQKCRXZ011xaXiT3l3KB5HZr2lg0pzzzIflxTivJuDWFW8BCsa17PTEMIsx40/B2bl1ck9j3BIbjkZGJwU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782875173; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5iDK5Y5tKY1GYf0B8NSrA3z/u0Rrzqvpx7FoJxemUn0=; b=YztQi9FRCMn+UFxX/xdCL4HX1rnT7/i3KP62s/BzAlAcneScPEnQ+gty6hvbckIZxCyYGj3s4SrjCihr2vC+8WI8TC7fj3lermWbOYoaKgca5lj7CVdUzSsL5bRrOdewgFNEkuum7RyuGQEoQ000SF6GQt0nA5xlkC03OCu7Br4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178287517365449.69558812872924; Tue, 30 Jun 2026 20:06:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1welG9-0005wP-0D; Tue, 30 Jun 2026 23:05:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1welFw-0005iX-Jl for qemu-devel@nongnu.org; Tue, 30 Jun 2026 23:04:58 -0400 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1welFs-0002p1-IP for qemu-devel@nongnu.org; Tue, 30 Jun 2026 23:04:56 -0400 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-2c82538b6b0so983685ad.1 for ; Tue, 30 Jun 2026 20:04:51 -0700 (PDT) Received: from stoup.. (174-21-129-215.tukw.qwest.net. [174.21.129.215]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ca37c74261sm23758085ad.22.2026.06.30.20.04.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2026 20:04:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1782875091; x=1783479891; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5iDK5Y5tKY1GYf0B8NSrA3z/u0Rrzqvpx7FoJxemUn0=; b=QH2K5EC6fZGDBuX0KzzCD9IHdFIELb3gu96gDdlS/Ldq72hOndf5oC4YkJQSFSOXrY +oNRPnjkPeZngPIP+OlizmQcT9uLlRI1KomZdMNZP9AxLgPgzAX+gEk5f1mCHXrZ6try 1e6c4hObDNjJ7fN/hTR9qVjnxiHmOy59iulxlrKCxPitoTZmD+r30xGsn3MQDH0hwdXS SaD6kFRNL/zlpSf1fgc/82yUNbgcRNfJmMq4kdY31vrwvJWNYRG2Sjz2Om/FEf8riZQh qtIg0jiGo4xc5icdtnJb8wKZUtjaGqKUF0ygyoubhPH2q8Ycvtr4TZaKtioQVcqvPpaR xf+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782875091; x=1783479891; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=5iDK5Y5tKY1GYf0B8NSrA3z/u0Rrzqvpx7FoJxemUn0=; b=b+Lw9t9iM0ZFy3z3SgtV/kYUyYPYtmgHFtNZ6qK/Q/sHkDTbhFXZgDYQKDNGfFFJqf 0BykEAx05VssNx/4cJlqhdQAPC3rxC3Eehzq3/vF0uFJ7MZNJmW/8teiLOdAFfBs6i5l Xe7TUd3f3zkL17LcfMwZ6UiPMiVvm2kmTxyXhf/No9IFpgEPEvCwDa64p81TiwGZRNjz hAbotY6hCAxphQTUa9eTD0aDfFQBde3kHEEAov9UlArc/x9dfrM7Dn51+uXbz7+MmR2q fgKGs+iv6jMEaOxJIbH7Lj+BQkWpj6885XFlAgv2czEkNmd5T9iVte64500Ls6D6XzrL JoLQ== X-Gm-Message-State: AOJu0YySW1FbKhY7LKCEUapMTFz8PcxlC069CYE8BPgxiBvqWM3foePj yf6JuAjTna8htJIJHihkM/HZZLFqjs/lmPvsw27i+6O6v4EasA+W0rN/sY1er5eymeeF9K1pV4c mpagx X-Gm-Gg: AfdE7cnm59ksfYp1xnyHo3g/BkP231jWE+Ca3/ZT+wnmoJfGJG3Vx1I5PcSwNWWZNVP MVnmlkTUQEaWlbQEM5npykt9CO2+0zJBPWgPA1la/hpL5a0plT2FAu6QWHMGwcl9DttQuNXdSlG codZz4Ix+sEM3zq3ifWs6319PZm5B3/dTD+qTvGqgwMGzyNNoqQW5/6pxS9fKwcMKOZp+sPVVnL CXyEm9NXcZahFLmeDyNfb+VfRieGQ4GFyt9h2R/nW/3PMUr/ssgY/HoEWE90EA7wjT347IlZsUL 3kA7e5DSU10fL1Um5pJ7J2poeahdKovNmKYpjxCwKeRMVobnxuxanzqCPRY+am0PnpQctaw4j3w T7a7Q0Fx/GzSicQhMS0UxLCO/alXkszzBc5qftEGiLTHhpvvY1adY7J05CmSoui7uzmyGvzed2f lQV24li+6TpmrVAmgXLQn+hiS9PNVJ+CdEsN+9fe5QQlSZVp7F1g== X-Received: by 2002:a17:902:f143:b0:2ca:de3:15e3 with SMTP id d9443c01a7336-2ca5a537e6fmr16157985ad.4.1782875090794; Tue, 30 Jun 2026 20:04:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: shivangu@linux.ibm.com, qemu-arm@nongnu.org, qemu-riscv@nongnu.org Subject: [PATCH 07/17] hw/core/cpu: Remove exec/breakpoint.h include Date: Tue, 30 Jun 2026 20:04:33 -0700 Message-ID: <20260701030443.1382447-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260701030443.1382447-1-richard.henderson@linaro.org> References: <20260701030443.1382447-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::629; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x629.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1782875175150158500 Content-Type: text/plain; charset="utf-8" This is no longer required in the generic header. Signed-off-by: Richard Henderson --- include/hw/core/cpu.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index e05e261883..ae8daa1159 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -22,7 +22,6 @@ =20 #include "hw/core/qdev.h" #include "disas/dis-asm.h" -#include "exec/breakpoint.h" #include "exec/hwaddr.h" #include "exec/vaddr.h" #include "exec/memattrs.h" --=20 2.43.0 From nobody Sun Jul 26 11:07:31 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1782875275; cv=none; d=zohomail.com; s=zohoarc; b=W/gDUsKpkj5CP7NDVOP4i+UwnFKSTiMAUdj2vdfTjjxa0e+3STjnpMzjCq3ikEGXeqW8DR+LHQlCQ1dw8+SRc6/qnY/09Kx7+zhCjQqSmxjVeDDSrEtHdYe6IKNKHtvfvq+e29M/JvAUDx/bITzV/m1t7748+/QwXNlpTiI9eC8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782875275; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=m2tedjt9ue/IHEM2C2VR1yTQ8onosX/0AIW1UgXuO/Y=; b=Kx0a9hCxV5WyBuQOUXZzUdr47uhmZpYupXrHA21SR+flAbUDwUUUb7CRLjQS9qsPM1U/n+ZlocvXH2lE8ibqTWOVzF7KX0yD3kYcUFubAiPBxRJ3bFUvsqe9g+6dSFHhgdhBybIBibDGcu2Jd71V0J1tMx7ZNrIBIRcElX+wMns= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1782875275161254.44969010682462; Tue, 30 Jun 2026 20:07:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1welG4-0005pq-BV; Tue, 30 Jun 2026 23:05:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1welFx-0005if-29 for qemu-devel@nongnu.org; Tue, 30 Jun 2026 23:04:58 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1welFt-0002pd-2c for qemu-devel@nongnu.org; Tue, 30 Jun 2026 23:04:56 -0400 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-2c979d03538so1018525ad.1 for ; Tue, 30 Jun 2026 20:04:52 -0700 (PDT) Received: from stoup.. (174-21-129-215.tukw.qwest.net. [174.21.129.215]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ca37c74261sm23758085ad.22.2026.06.30.20.04.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2026 20:04:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1782875092; x=1783479892; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=m2tedjt9ue/IHEM2C2VR1yTQ8onosX/0AIW1UgXuO/Y=; b=DCfaK1Xa20knHf2JbdvNrKe0CynwbDll02Cf6ldBnZSAMWzvxptHTnDTP30OLJIVek nGmDeLFCtq0xPaDTJFr+n08kSqjP0trlY98dNTD2EK3wiMikJW6oI2EIFuDzuYFq/mB4 uS3PT+7S1LtYkZWENfp7Yw7vZWpnmO3xPZu04Ml/FRRaV5P7AvfALguuEpZVh/oG7klS AgpYRO2s1uX59kqDwWip0hcjWsS797f+GwLDncRrVBI5ISxXu8lrTQpPTNCe1ZtiD2Xk vzZTxkmraofWFTE4NmlOO6en47FFVX3F49P1S0tStW1QuQTzOrb/HY1gjSd6wOWaa1iE M1EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782875092; x=1783479892; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=m2tedjt9ue/IHEM2C2VR1yTQ8onosX/0AIW1UgXuO/Y=; b=mmclhuKklwdZMIi/7M305bxGEmqsFZ9FbNoTuAeMlFjhsFpGJsUnPcHvQB7I36TGY5 /JgrTqhcPUgnn1KmDHLubsFwj1+x2a4W2awKmQWLn7HgPNwPBh8mWXgckv1ku7+gV1gK 3JSsnR+E39uf0/f3HYffZIq6UnCgZgGEpYzDJzt0znXfxHPtUDBrbRV8BfQW1pW7WiCl DBCWw41ol5OQ2gfnegkjUXfZiPdIdp9B3wkM1zFuO0KvicJfQ85If2Sgq3DKQVemqU1Q /ELialxQN0EAhenqHC/uZBlHo/mwyCbZgYIKrxPu49xpAICScwJJNj5cz2fk0LG4bK9P 7pgQ== X-Gm-Message-State: AOJu0YyqNr819IXW8lI6Ev5KPzlibc+wTttKd4bg/sdRg5xrpK6Vjc0L BtxYAC5nvi+O3JKLo5ztYx6kndCLfdCaaT+t77Ce+3X/cqFvDqdhzJ6Owl+v2IlbMruVJ3EE6oE N6hk5 X-Gm-Gg: AfdE7cl90tQsSdUBJjAi8wmGmAN5/jaHvdpSXuwD8SsCxLU1KwOOjzVbH6Ir5xwXRzt wmLWvQdAAiSpP9kzJ3NNTaBaGBb72Q4+BmL633iEP95lp6vZKTE7SWfXaE68rYNHbHOGHEAeQo3 iSmvKgysQjHv6dlqrib/319BnZM6mrT/P1dPZuTZnNXF9Rvi3soW0vw/I21n34qaGGGB6H3Us6R 4OFcTLhiGglMoKdHd0FHbdrOh2xOgl6vqHVFx6qP4cXw7na5k3DC4uW+d1vZF/D1TWXmmVsiPMG thrfrY3tZwV+YsvM/y1/GKESJMn4Vi9QuncNpA8YKJHqHf4/Tmw0s1DPsJ32PNN9pXBbsP3vWLs Uwsh0v1Ypr1/ymQzTZUbUe+2v3OmwsQmAdLDukR++Uh3iWwRPC1yv6kRKDo+kmEWafba3Azs3Ou hzr5r9MCTIe80pi/UyqUOLXKYBIK1Va9ai8JzZJl3aj+40RjXoJA== X-Received: by 2002:a17:902:fdaf:b0:2c2:50c7:58a4 with SMTP id d9443c01a7336-2ca2e718309mr54601625ad.22.1782875091568; Tue, 30 Jun 2026 20:04:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: shivangu@linux.ibm.com, qemu-arm@nongnu.org, qemu-riscv@nongnu.org Subject: [PATCH 08/17] exec/breakpoint: Introduce BP_CPU_ID_SHIFT Date: Tue, 30 Jun 2026 20:04:34 -0700 Message-ID: <20260701030443.1382447-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260701030443.1382447-1-richard.henderson@linaro.org> References: <20260701030443.1382447-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1782875277417158500 Content-Type: text/plain; charset="utf-8" Allow the target to store an identifier with breakpoints and watchpoints. Change "flags" to use uint32_t instead of "int". Signed-off-by: Richard Henderson --- include/exec/breakpoint.h | 10 ++++++---- cpu-common.c | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/include/exec/breakpoint.h b/include/exec/breakpoint.h index fc91343875..93876f3304 100644 --- a/include/exec/breakpoint.h +++ b/include/exec/breakpoint.h @@ -25,10 +25,12 @@ #define BP_WATCHPOINT_HIT_READ (BP_MEM_READ << BP_HIT_SHIFT) #define BP_WATCHPOINT_HIT_WRITE (BP_MEM_WRITE << BP_HIT_SHIFT) #define BP_WATCHPOINT_HIT (BP_MEM_ACCESS << BP_HIT_SHIFT) +/* Bits [31:16] are reserved as an identifier for BP_CPU. */ +#define BP_CPU_ID_SHIFT 16 =20 struct CPUBreakpoint { vaddr pc; - int flags; /* BP_* */ + uint32_t flags; /* BP_* */ QTAILQ_ENTRY(CPUBreakpoint) entry; }; =20 @@ -37,13 +39,13 @@ struct CPUWatchpoint { vaddr len; vaddr hitaddr; MemTxAttrs hitattrs; - int flags; /* BP_* */ + uint32_t flags; /* BP_* */ QTAILQ_ENTRY(CPUWatchpoint) entry; }; =20 -int cpu_breakpoint_insert(CPUState *cpu, vaddr pc, int flags, +int cpu_breakpoint_insert(CPUState *cpu, vaddr pc, uint32_t flags, CPUBreakpoint **breakpoint); -int cpu_breakpoint_remove(CPUState *cpu, vaddr pc, int flags); +int cpu_breakpoint_remove(CPUState *cpu, vaddr pc, uint32_t flags); void cpu_breakpoint_remove_by_ref(CPUState *cpu, CPUBreakpoint *breakpoint= ); void cpu_breakpoint_remove_all(CPUState *cpu, int mask); bool cpu_breakpoint_test(CPUState *cpu, vaddr pc, int mask); diff --git a/cpu-common.c b/cpu-common.c index 11ab32d64d..0b54e8a497 100644 --- a/cpu-common.c +++ b/cpu-common.c @@ -405,7 +405,7 @@ bool cpu_breakpoint_test(CPUState *cpu, vaddr pc, int m= ask) } =20 /* Add a breakpoint. */ -int cpu_breakpoint_insert(CPUState *cpu, vaddr pc, int flags, +int cpu_breakpoint_insert(CPUState *cpu, vaddr pc, uint32_t flags, CPUBreakpoint **breakpoint) { CPUBreakpoint *bp; @@ -435,7 +435,7 @@ int cpu_breakpoint_insert(CPUState *cpu, vaddr pc, int = flags, } =20 /* Remove a specific breakpoint. */ -int cpu_breakpoint_remove(CPUState *cpu, vaddr pc, int flags) +int cpu_breakpoint_remove(CPUState *cpu, vaddr pc, uint32_t flags) { CPUBreakpoint *bp; =20 --=20 2.43.0 From nobody Sun Jul 26 11:07:31 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1782875379; cv=none; d=zohomail.com; s=zohoarc; b=TiLt44/9d7Z0JrDzLWx+MHyYK03lr8RCjUAAL8WK9X35XKgBe/zhboki+5+b2luV+YKis1/VYWrewnNnz95UcqppjougqaKhdwOV9fxsGFgK/T0WKbOG6xou2YBFS1y+La0cWyK3GqEQzQz5tXYldR/ki9j6De7lpCP8raTDmXE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782875379; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=vRXrShiuVMuf4OcMbWA5wcZpSLQDxfyJIHc+c1cth2E=; b=DzB9CuxpV4tUspch8CLwZ1a9QqtRzDu4NQEUM8SPOTs3bATxJnJhKpyksoe4MCt6rAdRSe8s/ifs1sSEo3yiEPysEPurKSjWsGUQoR5P7yKOdifpQ5i/xIDFsHBQAjB2uIZwDJmzx8hVnYjM3u87075cRp5x0mkitqw8LQxM01U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1782875379423606.207307517655; Tue, 30 Jun 2026 20:09:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1welG6-0005ql-33; Tue, 30 Jun 2026 23:05:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1welFx-0005in-5V for qemu-devel@nongnu.org; Tue, 30 Jun 2026 23:04:58 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1welFt-0002qC-Oe for qemu-devel@nongnu.org; Tue, 30 Jun 2026 23:04:56 -0400 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-2c9b1edf2bdso1020785ad.1 for ; Tue, 30 Jun 2026 20:04:53 -0700 (PDT) Received: from stoup.. (174-21-129-215.tukw.qwest.net. [174.21.129.215]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ca37c74261sm23758085ad.22.2026.06.30.20.04.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2026 20:04:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1782875092; x=1783479892; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vRXrShiuVMuf4OcMbWA5wcZpSLQDxfyJIHc+c1cth2E=; b=No+/5seMIIWdSFiOMs+kpjVC2OObo8TTg/meIOZ2D8dNKrNXaJSUu+4cHBbiO3W/dQ NuyLjleBtlUqRBwKcanV5zhZGrRUW3XI7hDVbN9NEYDPsMoB+J+pi5Oyb9tNs/OIhC2Q bnCRgEBgNS5hIbvFp0Fqs6cvg0oOfllETD7E0FPd4+dPPfND5gxcf224c1sDr3+H9Q9v mOy4i17edNP84UmfSccrcz3g2LhewupHkzu7ui/+yz14fjHLmpIu6JFoCcOWnR+1ZKBY ziicXElGQWpR2P31e0q5jJ/sfvXwZqeXkGCK0L49a3xVbEbiRYbp0hPBJOiGDuooYezI NiEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782875092; x=1783479892; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=vRXrShiuVMuf4OcMbWA5wcZpSLQDxfyJIHc+c1cth2E=; b=PvukXg8jM/XdwB/OgXEYmPUzWwVZ6AkDSt/uVjkJF9IqrL3H4v2gl4M3jYOCZ1xCJD zLvaY0e5E1jNJYZnNm6BJVgQ5533ZUltiT1aj8B1tHU8bzxzh3RsHPb5BGxDhsN/PGlY Z2NFkJj3HK6vdw+E8f6fprZa+BAr4dBLX8G2iKIKiKg3w4nzJP/r+C8jsZz4D5lAcJyO M6hwu5OpDGy64xJn6vcDnIOv+wc2rt9PmDJb3FeUbXclygveVNXHJh5/wBYnPI162YXu qScyDqLyBp+pcUcp2ulwMnuQnOZS1Svr31b1yvZ+OXAiF3D7pfir/kIINQgcVvH1XYlT TpYw== X-Gm-Message-State: AOJu0YxU3lwyByX+FLnwXDh69hWl8oXfCJ5jAzxt9iDW2kYP0KU4t1CQ AnEszb6RT/FUIj28FaPZQH0qkGTfQFOPb0gdb/0zfkdClHVNBHnSMGehIshamH1EaDuhIMJeqGC ZQqA+ X-Gm-Gg: AfdE7cnVoz71YrZaFJImnnStM8Mb/N1CVxu+Joe42o5WLPdKqO8LCiMiP8EsPSBnvu9 qa4rPBLSBl9UsMgvpGy8WOpTNHwM1z93oknJOn1MOB3Ph0/sF58YJVFL868i4TeJojCIoqlzKuj 08vBLuGq0ABR/qZv7ZY1SG2hG/TtemzBolSww69+18d0rO0jE13fR7b0FNGGA5toSYXIwgE+w8p Vvq/SidOtrhtkzs1x1zfhL+2HidKvwRlU/pAKC2Et/vXpei0AcX+EdEaGRu3RGltQol+hUMlZzL 3CPJXV2bjsYzhbH73CX5ZITdN7XL8tjS8OKmEGNQ+GCx8MPKBACknhI+xuG6oz1cA5T2tu/W6pX R1/xVSW4a3fdN4vfUR6gV2YqWtaqnU11RmOglEcWf5uFgBeVF7mjynmu9BLIYD74SsMD/YvuKoO rrABP6DU/8sB45VqbyuGxX27d8RbBwyqo4l3ZEhGcUMp9p+FHo+w== X-Received: by 2002:a17:903:41d1:b0:2c9:9927:a060 with SMTP id d9443c01a7336-2ca2ed3191emr53264715ad.24.1782875092225; Tue, 30 Jun 2026 20:04:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: shivangu@linux.ibm.com, qemu-arm@nongnu.org, qemu-riscv@nongnu.org Subject: [PATCH 09/17] target/arm: Split is_wp out of bp_wp_matches Date: Tue, 30 Jun 2026 20:04:35 -0700 Message-ID: <20260701030443.1382447-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260701030443.1382447-1-richard.henderson@linaro.org> References: <20260701030443.1382447-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1782875379833158500 Content-Type: text/plain; charset="utf-8" This function is only called twice, once for each of breakpoint and watchpoint. Hoist the separate bp/wp code into the respective callers. Signed-off-by: Richard Henderson --- target/arm/tcg/debug.c | 46 ++++++++++++++++-------------------------- 1 file changed, 17 insertions(+), 29 deletions(-) diff --git a/target/arm/tcg/debug.c b/target/arm/tcg/debug.c index ed94b20739..51d6748427 100644 --- a/target/arm/tcg/debug.c +++ b/target/arm/tcg/debug.c @@ -252,41 +252,16 @@ static bool linked_bp_matches(ARMCPU *cpu, int lbn) return contextidr =3D=3D (uint32_t)env->cp15.dbgbvr[lbn]; } =20 -static bool bp_wp_matches(ARMCPU *cpu, int n, bool is_wp) +static bool bp_wp_matches(ARMCPU *cpu, uint64_t cr, int access_el) { CPUARMState *env =3D &cpu->env; - uint64_t cr; int pac, hmc, ssc, wt, lbn; /* * Note that for watchpoints the check is against the CPU security * state, not the S/NS attribute on the offending data access. */ bool is_secure =3D arm_is_secure(env); - int access_el =3D arm_current_el(env); =20 - if (is_wp) { - CPUWatchpoint *wp =3D env->cpu_watchpoint[n]; - - if (!wp || !(wp->flags & BP_WATCHPOINT_HIT)) { - return false; - } - cr =3D env->cp15.dbgwcr[n]; - if (wp->hitattrs.user) { - /* - * The LDRT/STRT/LDT/STT "unprivileged access" instructions sh= ould - * match watchpoints as if they were accesses done at EL0, eve= n if - * the CPU is at EL1 or higher. - */ - access_el =3D 0; - } - } else { - uint64_t pc =3D is_a64(env) ? env->pc : env->regs[15]; - - if (!env->cpu_breakpoint[n] || env->cpu_breakpoint[n]->pc !=3D pc)= { - return false; - } - cr =3D env->cp15.dbgbcr[n]; - } /* * The WATCHPOINT_HIT flag guarantees us that the watchpoint is * enabled and that the address and access type match; for breakpoints @@ -366,8 +341,19 @@ static bool check_watchpoints(ARMCPU *cpu) } =20 for (n =3D 0; n < ARRAY_SIZE(env->cpu_watchpoint); n++) { - if (bp_wp_matches(cpu, n, true)) { - return true; + CPUWatchpoint *wp =3D env->cpu_watchpoint[n]; + + if (wp && (wp->flags & BP_WATCHPOINT_HIT)) { + /* + * The LDRT/STRT/LDT/STT "unprivileged access" instructions sh= ould + * match watchpoints as if they were accesses done at EL0, eve= n if + * the CPU is at EL1 or higher. + */ + int access_el =3D wp->hitattrs.user ? 0 : arm_current_el(env); + + if (bp_wp_matches(cpu, env->cp15.dbgwcr[n], access_el)) { + return true; + } } } return false; @@ -412,7 +398,9 @@ bool arm_debug_check_breakpoint(CPUState *cs, const CPU= Breakpoint *bp) */ =20 for (n =3D 0; n < ARRAY_SIZE(env->cpu_breakpoint); n++) { - if (bp_wp_matches(cpu, n, false)) { + if (env->cpu_breakpoint[n] && + env->cpu_breakpoint[n]->pc !=3D pc && + bp_wp_matches(cpu, env->cp15.dbgbcr[n], arm_current_el(env))) { return true; } } --=20 2.43.0 From nobody Sun Jul 26 11:07:31 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1782875378; cv=none; d=zohomail.com; s=zohoarc; b=Q2OX3DUQg4RrL3zq3p+tSLY818++4JyJeivUfC4GiC6AKVm/5tFw1Cxq/Mvgl8/9XlFJjGHmHaRYAu0ZHN205kahYMW5F1tt39SwBZ3s6vlLL2UQ973UE8Iug2yZwArsjHctwn0omzdzc4RaixRnJxS7H6WALXwki0sNiiTWpLU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782875378; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=yrBKBJVchBCsnuGqTnML8QX4SdgBpucyvwuWE2i/qQ0=; b=PhqcTiDA+dVIR3jVxhV95MqyB9CDrie1VwXi6u04YHfy7Z5x4dmHPKM9WNTUG2wb4/K42G3543G6qGOZlhhgRc2gjPnPWVLPa1efzA5G3P0lPGJ4XHcZjbQQjhYA4XiZ6w54yqQOtlougqhWCTUYQ0GnRbRWWLJwKLYcuZtgz+k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1782875378111411.11217039770565; Tue, 30 Jun 2026 20:09:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1welG7-0005tV-GA; Tue, 30 Jun 2026 23:05:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1welFz-0005k6-2J for qemu-devel@nongnu.org; Tue, 30 Jun 2026 23:05:00 -0400 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1welFu-0002qk-Pt for qemu-devel@nongnu.org; Tue, 30 Jun 2026 23:04:58 -0400 Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-38060005f1cso693833a91.0 for ; Tue, 30 Jun 2026 20:04:54 -0700 (PDT) Received: from stoup.. (174-21-129-215.tukw.qwest.net. [174.21.129.215]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ca37c74261sm23758085ad.22.2026.06.30.20.04.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2026 20:04:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1782875093; x=1783479893; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yrBKBJVchBCsnuGqTnML8QX4SdgBpucyvwuWE2i/qQ0=; b=cyaJ/+Iv2N/zzmGwL5ThDoNg97mEktKcrnG80lU+hMuMbMo+5rP4eOG707s1kAIpUx TpXVYfnZINCok9kiNJ6C+QPPg70qFz81+bWseR9GkckqFWYqD1Aqi8cMiKUO0oeAB7Qw juES6IVDi7kdbKB0/X/NyMl4u/ngK742VZOkfylZGiNm5IwiYV8jRHHtr0Wc32kwOINf JVPa/AA4gZxo6bl/i08v1qiugixT9RFJRlpLekMZjPwaj20V+GroAIbNoiUb/WAXMDUf ths8JYYGvTy5hCjcJmd6D4Qil+9+bE0DOcPDHEI6F0MMFDlaLX/bWGZKJRrJu56WWtmd lK+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782875093; x=1783479893; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=yrBKBJVchBCsnuGqTnML8QX4SdgBpucyvwuWE2i/qQ0=; b=lCTG1ULf/787j97cS2kxu638Y5+FKZCe2vX7ejAoyp9f8cXfZvKIes8SyNe15ODS2E RN07B3CR6IxOa1cTfBhqQZCyWqL2azKvB/ib6hpU3oWv3DCjw7arAxIPrYRVBA15fjnQ OMxjof/dbB0aGveAM4y/SrqSXdbQHRP8UOGdr7JwmYfoQoW5vmSh8GjeJEkzQmTi5Xz+ KStbm8+lzHyMojTJpBLVFy8n3tSn9UtovmD7hPgpY6XaWJ7ObmEzkH/GAmwgLx524Y8u YhNMsmeVQBsKTDMUP7LL2x7Pjf7D9+27p9lT7IpTg7qhou22XiD2D5TIDBlLFycIl6wL 8W3A== X-Gm-Message-State: AOJu0YxxYfDmeir1b6gy+WherszEkaNcm/N7x366Zjc6hA2EbKG6KKto 38Y17v5aTtyqaqfKa7bEUHezglNoZMbwraFAA7uAmp8Bq99sIFiB1DzNXIJ/3VcBElTiejiWWRe Bqjj7 X-Gm-Gg: AfdE7cnmY3wamsEID7pHE0h8izaq0Xy8+wtEg0Fp5XOs9AJtus8pFMLvjrumaCE0ee3 iLxkCCn+F6bRHx+v0C574ZzNMNuDxIGB+OVcqW804Nk4WRLz/ogBYvtNaZ9Oik4CPWWEcozCMiV ickcYp5SaAyFxz5tSEwyYboqz5vAlwc8wwlbASDH2xRHOg2XoW7oSTz18p7wHUgVYv64daq7Ace s8jN7MQmjF1kQiHankEneAwnIpFeggtVmEtGZqo1npY6zdxWFuA1f2FSBEXlGgSVEpT01bBmxk3 M6g896jUT35k+0Mha2fXX3SyP95+xi/Kr42Z+kr3p7ebXvIE5cVDGPt6zJyEL0tuX1OEufUD6/f nur+2tgJrEWHlSUUm4abu796R9q0yFsn3G9TcOeCpBXNagWEuReT8UOZX0GPDgxPJoh/MdZ/6bz 8NaLDg/HL1rfnCLjRw5Rxd7xRJlZSRbDvJ2XmnnsFceYH8WegJUcualSQGToBH X-Received: by 2002:a17:902:d2c9:b0:2c9:b017:8bf5 with SMTP id d9443c01a7336-2ca44a05333mr34401565ad.21.1782875093157; Tue, 30 Jun 2026 20:04:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: shivangu@linux.ibm.com, qemu-arm@nongnu.org, qemu-riscv@nongnu.org Subject: [PATCH 10/17] target/arm: Set ID for watchpoints and breakpoints Date: Tue, 30 Jun 2026 20:04:36 -0700 Message-ID: <20260701030443.1382447-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260701030443.1382447-1-richard.henderson@linaro.org> References: <20260701030443.1382447-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102f.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1782875379805158500 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson --- target/arm/tcg/debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/arm/tcg/debug.c b/target/arm/tcg/debug.c index 51d6748427..8bcce4a1b0 100644 --- a/target/arm/tcg/debug.c +++ b/target/arm/tcg/debug.c @@ -538,7 +538,7 @@ void hw_watchpoint_update(ARMCPU *cpu, int n) vaddr wvr =3D env->cp15.dbgwvr[n]; uint64_t wcr =3D env->cp15.dbgwcr[n]; int mask; - int flags =3D BP_CPU | BP_STOP_BEFORE_ACCESS; + int flags =3D BP_CPU | BP_STOP_BEFORE_ACCESS | (n << BP_CPU_ID_SHIFT); =20 if (env->cpu_watchpoint[n]) { cpu_watchpoint_remove_by_ref(CPU(cpu), env->cpu_watchpoint[n]); @@ -644,7 +644,7 @@ void hw_breakpoint_update(ARMCPU *cpu, int n) uint64_t bcr =3D env->cp15.dbgbcr[n]; vaddr addr; int bt; - int flags =3D BP_CPU; + int flags =3D BP_CPU | (n << BP_CPU_ID_SHIFT); =20 if (env->cpu_breakpoint[n]) { cpu_breakpoint_remove_by_ref(CPU(cpu), env->cpu_breakpoint[n]); --=20 2.43.0 From nobody Sun Jul 26 11:07:31 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1782875208; cv=none; d=zohomail.com; s=zohoarc; b=hkOSqRGWcwfJ4qJP8N1TDAJ2jbhNGxmk4x0j0ILV7WeMZYRfd/KC/XH6tboQTSzCY9TRnMRg10i5IsA8TMYJC3l7WBVfmNIC0DOZFnmu5DEfI6KmdXtBZ8NwZPyURpHJXc6h4OvudDWg3x1J5itb7fSc6jyq631w6oc9DzrnTng= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782875208; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=m9lGyyAHN8LnCXhy7QmMc4S+kFAgGybyfRaIJ4iRcl0=; b=KcGMcbF+hGpGx9AsehiCfsTXBSkPeqY7TeOpiXmFN85mA76q9Z9kTBomvD0V+s6SamGI9/hu1tPw/jc3ot3SjeBeHkW7LEx4Q2SopJP3PhLxN0uOxovRKHqHs1g1g/nC+tvf1IsHONoQpUyS+JwAIbRWQkSk9o6vDalzYyzmNAQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178287520870655.03632927867454; Tue, 30 Jun 2026 20:06:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1welG8-0005wI-Vh; Tue, 30 Jun 2026 23:05:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1welFz-0005kZ-IP for qemu-devel@nongnu.org; Tue, 30 Jun 2026 23:05:00 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1welFv-0002r5-AJ for qemu-devel@nongnu.org; Tue, 30 Jun 2026 23:04:59 -0400 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-2c9ed0c7fc7so1216795ad.1 for ; Tue, 30 Jun 2026 20:04:54 -0700 (PDT) Received: from stoup.. (174-21-129-215.tukw.qwest.net. [174.21.129.215]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ca37c74261sm23758085ad.22.2026.06.30.20.04.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2026 20:04:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1782875094; x=1783479894; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=m9lGyyAHN8LnCXhy7QmMc4S+kFAgGybyfRaIJ4iRcl0=; b=zdjq0bt2ZmV3HQrP3VgH6slMX9pLKqlDZ6i+eCxsAINylWvMsPU3+wmdphmQfXez3U MB0hFzz7ZCwCnXccUOXv6r93Pi8W8rxsAgYnHxh4e0XP7iu82bobZF2UsWuDuvzFa37G bu0JQ6auHu0tO356xsho5POCwccIkPVwXASxggLZMZsnh4Qi/0/QOISK1ykSKs5oxlyf T1S9scoUR/UtXYoZqCkhNi0SU87a0HNcz1B5GP5k0c/nvNWLZey4mpw5QvSYvBv+lkos 2rPSc6homa/bkXvnBjPf82Z+kF/DMDKlwcyVjU15oNT7BMv5kDhzjKVaQ2WD0YKAhnMl 3leA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782875094; x=1783479894; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=m9lGyyAHN8LnCXhy7QmMc4S+kFAgGybyfRaIJ4iRcl0=; b=JVPcZ+b9G+lf+O8UuY/jlFxZ3GQerCqSbfSaY/0Wkg4OfYVI3lnmnYZsSXep67lsNH 72GATiPKkkcT1wQ4T8B3VFNDZCvlvbLgg/+UHyLAipwWmJ2ElKb1BH6R6S2/pEPswj/w fyByfsvjRiG3N45PJwU4/JT7YFlAzxZbWm3ZcPWz5QSAEBTatWGT79eHoXU+TEjdeVa+ LEuqD6xuAk049q5MygPzimbkNmWyuKxNF4TrARezU271wgmTG7ABDIN/3ihPE/8PUUZx /qS/EP0HPKTj0Krkh+lf1xml7n4SbF4vj1MfLjTHLiC1xKfvZb32qfM/2Ro3H4rEzMSf p7hA== X-Gm-Message-State: AOJu0YzdwqAWI0yN6uWftrtQU9f/RFrBZdAX8gJAWitVtbKdYH471GaQ +xWiNwevjK/O9Vv4w3iDSDAgzFl9+7SlH/R2YTBX3OhEWuuXyEupprf1STQE3P6f1XKW5gOAHD4 Aebu3 X-Gm-Gg: AfdE7clIVWYnYTyjZOcdwgiwCRHDi01kABvvOydDF28ybTCmetfID3ytjJpC/NtTaRe kGBc6R7HxpWn/3bAFxeKJnF14pKCq/8txl0RUiStaWh4vLFcRfD6o3aWij9nxbTgPnzLIccEL1f PC2uFD7nIDgat7b0lA3E55R8l8xiyUjp5vVLPNhcoZHGnUITQSFuRpYekruvZ5MnXNOQ1N2iiY3 AF7fFjJem7a9Wma87CqbLvc86+23qVp85Al70D//d4ziTxzG8fv70agrvMHxSFidUHmBJBkDTeH b2kAi4uPAMmdcaOXNgMLflQOpq2udMPrn3qNgm+hQ/SybeBFkl75hXYP7jvjXiTBOePRqQTgesg 6abO36Z+vs0HMOo46gcDa94wSFdgEHeK9i4gXemGkRmQL6iXfKI08PIQjRIAhV0kErOOymFftie Am1doah66sLrOCwRNvlzk8VqzCHsffFyqJ5W3AB7OeBK+M90eClYKnrAW/ryBF X-Received: by 2002:a17:902:f712:b0:2c9:aae1:a61a with SMTP id d9443c01a7336-2ca5a552530mr31604635ad.14.1782875093810; Tue, 30 Jun 2026 20:04:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: shivangu@linux.ibm.com, qemu-arm@nongnu.org, qemu-riscv@nongnu.org Subject: [PATCH 11/17] target/arm: Use bp argument in arm_debug_check_breakpoint Date: Tue, 30 Jun 2026 20:04:37 -0700 Message-ID: <20260701030443.1382447-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260701030443.1382447-1-richard.henderson@linaro.org> References: <20260701030443.1382447-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1782875209263158501 Content-Type: text/plain; charset="utf-8" Use the matched breakpoint instead of looping over all. Signed-off-by: Richard Henderson --- target/arm/tcg/debug.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/target/arm/tcg/debug.c b/target/arm/tcg/debug.c index 8bcce4a1b0..fc63d35d98 100644 --- a/target/arm/tcg/debug.c +++ b/target/arm/tcg/debug.c @@ -396,15 +396,8 @@ bool arm_debug_check_breakpoint(CPUState *cs, const CP= UBreakpoint *bp) * TODO: We would need to look up the page for PC and verify that * it is present and executable. */ - - for (n =3D 0; n < ARRAY_SIZE(env->cpu_breakpoint); n++) { - if (env->cpu_breakpoint[n] && - env->cpu_breakpoint[n]->pc !=3D pc && - bp_wp_matches(cpu, env->cp15.dbgbcr[n], arm_current_el(env))) { - return true; - } - } - return false; + n =3D bp->flags >> BP_CPU_ID_SHIFT; + return bp_wp_matches(cpu, env->cp15.dbgbcr[n], arm_current_el(env)); } =20 bool arm_debug_check_watchpoint(CPUState *cs, const CPUWatchpoint *wp) --=20 2.43.0 From nobody Sun Jul 26 11:07:31 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1782875370; cv=none; d=zohomail.com; s=zohoarc; b=EJN9xMKvjt1T6aHCoPvGdlR9fzkrlISmtM/9coj8lOJ26vWJ9FOtQo/3twmel5IUV3ahj0cMiwypEBP5TJzveCOcX3yuoMIcLFmkoFwMPm5zEU5XHCbH8B7j3wMgjXXN0QnMDJekqu7POp4yVLNRG+Q0R7ayDw4xtsWzDQZs2M8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782875370; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+veytKPeE5iu1XxgyNuqXet47JTcpmbvbPWcEYyJFIs=; b=IEb05f+B2GC53jT2hyDzH7DNt9nFUhaxM6SBzwSKM0NpGZFFlfsnKyEQ34q54sG5/XAPp8IGWEO+2p9V4zPFmGDIkZ8l9tAxny9BKOCyfXdE4NUy9iDDKZEmBBcDbBM77RsUxNq3dfSf1r/zUdpfUMBVYHLAC8tF5MtLWZe2aGM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1782875370943419.42295580550376; Tue, 30 Jun 2026 20:09:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1welGA-00060H-QK; Tue, 30 Jun 2026 23:05:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1welG1-0005kn-Sx for qemu-devel@nongnu.org; Tue, 30 Jun 2026 23:05:02 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1welFw-0002ro-Ad for qemu-devel@nongnu.org; Tue, 30 Jun 2026 23:05:00 -0400 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-2ca1479dfe0so1161185ad.1 for ; Tue, 30 Jun 2026 20:04:55 -0700 (PDT) Received: from stoup.. (174-21-129-215.tukw.qwest.net. [174.21.129.215]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ca37c74261sm23758085ad.22.2026.06.30.20.04.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2026 20:04:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1782875095; x=1783479895; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+veytKPeE5iu1XxgyNuqXet47JTcpmbvbPWcEYyJFIs=; b=j1VUpn4J+uZrOzKrbQ5ghYAwiF5dJqnE4XljJoLFJ8b+liuCbrGtRntnXNBYwjHT/K BpZYvkhQOpYvtOjwwF7lQDMOVn2DgxQNryq3oa1esUt0usiszd+cfYnAqsTVHOMnsCBp a5INQgI29za+75r5M5p9YnUX8T/S8kziDF3oosUJ1Aspt11P5dNBnGXMrQztKVPKp0dY RWOEgIeEetJepOiurSL9iPGAJcxrHi8k/j/qvgLhPypI27zg7vttdYQa5xyLdDUfsO+7 GRY3MIiqrUlYXD8UgJmSVcJDayNg3YZoy/rhVUXdrLYn2VDW4oZ2Uo1N6+1aZ+LyWgxW ZxSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782875095; x=1783479895; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=+veytKPeE5iu1XxgyNuqXet47JTcpmbvbPWcEYyJFIs=; b=K8KJ4zHpMmC1NxMjYIY0MhwaGBNzU0ShDx/DC076LIjuamnpwlaa6aqiFaOLCTjc3U ULLqDa0Qy6VRe+4uvNLsZ4u3q5AiA4dMz8mHyfqmidaC8dVc4HEFXNl4L7SYXfsIR1pN E2PPEAfPiGNPe3fXU/71qUNNbkEyNrRomX9JuZJZi0t1jFE2r9b4QbiBIGsSVZ/Z34ZX AunfX/aqsz5n25chLYTkXmgJL0anlo7Z08T7NmMrgFHdYM1cCdrqCDE/OQ85s8d0t0x5 Ixbb3pGcjnJhnHa0A3TC2IyBDRJZTKkFhMk7sQM/MaWqHSz5ZhAfgMCc41BJhJtIHqk6 B8hw== X-Gm-Message-State: AOJu0Yxylb8+DXAsnfW7ZMQqn++9TauzboECIju2/VmOByEHY55hXE9L 2GDDyOwmroh97WJcfj823/8ORyEj36RhH88rhuSzXw4TgRLiyVuLR5qDLQgwqHNe0FIcKoqEQ5O itjpz X-Gm-Gg: AfdE7cmk1T/pNiUmFkTwrrVnqKVJ06qNUE0kvs42GTZ1YiBoILMhWOZMzm7GoxNuVU3 TK9eGzXI5eEHegz1S+kLQoVmuEI00DkvyxCt3NJUpVZr4Ib3/fi99nK/HkCs6SXjNk2qBxi+0E6 yNbUFgQB7GLNzrOs1UFRwgD5pnENNjXfGUvMKgFuSE7C9qFiVxXhOLNsqYa8P7zR74KJ53Km/43 UP2WP+c0fvQyxHXTeZoynWRUdFDgWJypRVVD35PldNMQfoyKxW6UNcP/hP0XVLZa3X0o9UTGkaA 15tSVDq5MO/3ygMqmb6e1LH3L9ZjJHNiqzjEysA/FxNn99hNiwmWHBFVHI21D7T3IfVUQzIFo5M oiNgO+sjto0UFQJ2+3oz6jWW9G8vIpkq9sZIlyVE+kqTQX4mZqNi8Y5f8AN1GHTvxr7gM/X6ZiA X5MtQfbpNccjRFVg4pxoNyYKiaSGOTbORr8iKnSdUaFqsJqX8lMqc/xNm1p3jh X-Received: by 2002:a17:903:b07:b0:2c9:97a7:71b0 with SMTP id d9443c01a7336-2ca2ec2ad02mr49090785ad.43.1782875094644; Tue, 30 Jun 2026 20:04:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: shivangu@linux.ibm.com, qemu-arm@nongnu.org, qemu-riscv@nongnu.org Subject: [PATCH 12/17] target/arm: Use wp argument in arm_debug_check_watchpoint Date: Tue, 30 Jun 2026 20:04:38 -0700 Message-ID: <20260701030443.1382447-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260701030443.1382447-1-richard.henderson@linaro.org> References: <20260701030443.1382447-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1782875371789158500 Content-Type: text/plain; charset="utf-8" Merge check_watchpoints and drop the loop over all watchpoints. Signed-off-by: Richard Henderson --- target/arm/tcg/debug.c | 43 +++++++++--------------------------------- 1 file changed, 9 insertions(+), 34 deletions(-) diff --git a/target/arm/tcg/debug.c b/target/arm/tcg/debug.c index fc63d35d98..e87020de90 100644 --- a/target/arm/tcg/debug.c +++ b/target/arm/tcg/debug.c @@ -326,39 +326,6 @@ static bool bp_wp_matches(ARMCPU *cpu, uint64_t cr, in= t access_el) return true; } =20 -static bool check_watchpoints(ARMCPU *cpu) -{ - CPUARMState *env =3D &cpu->env; - int n; - - /* - * If watchpoints are disabled globally or we can't take debug - * exceptions here then watchpoint firings are ignored. - */ - if (extract32(env->cp15.mdscr_el1, 15, 1) =3D=3D 0 - || !arm_generate_debug_exceptions(env)) { - return false; - } - - for (n =3D 0; n < ARRAY_SIZE(env->cpu_watchpoint); n++) { - CPUWatchpoint *wp =3D env->cpu_watchpoint[n]; - - if (wp && (wp->flags & BP_WATCHPOINT_HIT)) { - /* - * The LDRT/STRT/LDT/STT "unprivileged access" instructions sh= ould - * match watchpoints as if they were accesses done at EL0, eve= n if - * the CPU is at EL1 or higher. - */ - int access_el =3D wp->hitattrs.user ? 0 : arm_current_el(env); - - if (bp_wp_matches(cpu, env->cp15.dbgwcr[n], access_el)) { - return true; - } - } - } - return false; -} - bool arm_debug_check_breakpoint(CPUState *cs, const CPUBreakpoint *bp) { ARMCPU *cpu =3D ARM_CPU(cs); @@ -407,8 +374,16 @@ bool arm_debug_check_watchpoint(CPUState *cs, const CP= UWatchpoint *wp) * is also an architectural watchpoint match. */ ARMCPU *cpu =3D ARM_CPU(cs); + CPUARMState *env =3D &cpu->env; + int n =3D wp->flags >> BP_CPU_ID_SHIFT; + /* + * The LDRT/STRT/LDT/STT "unprivileged access" instructions should + * match watchpoints as if they were accesses done at EL0, even if + * the CPU is at EL1 or higher. + */ + int access_el =3D wp->hitattrs.user ? 0 : arm_current_el(env); =20 - return check_watchpoints(cpu); + return bp_wp_matches(cpu, env->cp15.dbgwcr[n], access_el); } =20 /* --=20 2.43.0 From nobody Sun Jul 26 11:07:31 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1782875266; cv=none; d=zohomail.com; s=zohoarc; b=S9tpC37aoPgcMOJtHdvKw1qr6n4N2pLPnvI7mtpm1A7E8nOMGVbXeC+iaLtGiKT8LMEq0YFCAGC66ekY8c9oklLN5lcLnLHcS0m9RnYCmkV539YUsOga5Nwm70d3tVfpiDrOWgpu3bHH7kYbAtZ9Z5dvf4HC5dSEavuwUz1kZsk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782875266; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Bn7nR5aCNzjwIjjAfoSQIcT16OvTScPNGETb7yLySDw=; b=J2hctbNmE0xkOCWRt4PM9p3VA0i92TEsfIbtY0XZ89KaEnVdnbAwPfI/3lC/1IfkblQIjTIO0VX4G3hsgxZNxoX5fiHia2SBePHYSKkLjeO//ytyxGGgRSQqQvcpWjxUnoYsaNQEcWv02nfatcrdqMIE9tNo+4DnrycFCilvVDY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1782875265875992.5484080508879; Tue, 30 Jun 2026 20:07:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1welGD-00067w-EY; Tue, 30 Jun 2026 23:05:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1welG1-0005km-T1 for qemu-devel@nongnu.org; Tue, 30 Jun 2026 23:05:02 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1welFw-0002sG-Vp for qemu-devel@nongnu.org; Tue, 30 Jun 2026 23:05:00 -0400 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-2ca06ad2d11so1499225ad.0 for ; Tue, 30 Jun 2026 20:04:56 -0700 (PDT) Received: from stoup.. (174-21-129-215.tukw.qwest.net. [174.21.129.215]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ca37c74261sm23758085ad.22.2026.06.30.20.04.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2026 20:04:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1782875096; x=1783479896; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Bn7nR5aCNzjwIjjAfoSQIcT16OvTScPNGETb7yLySDw=; b=cLX6OQSJrcyDlg/eHUOcX3E0MfG2lE6rW+7AFwPGXS3LUNfhGXvhKYe2KNluj58/KQ 4+E4VdeR8J5RAsCNtoYs37apCuHSrdGO/Sg2FJVETa+0d39hzAClo1nXuW1RJyCtcSXA t6NCG/ZK5T1hilDYnrn7TADn+fJsexNJx5GCtIuGKqJz3ZQqfAXDDejeLaNXIvjDXDBo /mbtz7OB95dJ5tc/ApBoyrkLKHQA8QS6Zt4n1lWpV5EyuB/vCW7Tys/Ibrrj2vrZqeqs OcYlX3UiQUCYFDayYqzN+zkdHnRHFhGJLbBEEAq50y041OQCNCSj70JmU06NlpBK2e1I VoYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782875096; x=1783479896; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Bn7nR5aCNzjwIjjAfoSQIcT16OvTScPNGETb7yLySDw=; b=iL0YWAHNWhZ/O2/xCGdzUykpdVYaW58lrgavfig93dSyTn7ssspKQhBhVrYZW2VI33 pSBi9iSisBMspQKVWBOlhSpwEUE+u1+7MfbEIR9d/3Osgi6B8d3WpTgkaYheNpF8ESlk Uk6ELFwzAzP+FSyoqsVVmLxFkHfFD7DxH+uR70Zfkg/aSczRwDvxAooyIuQ9A3zvSN7w ynZoo9sSsYgOfUUN/hpVcpMwbj6voEry8sF2Df670cln6DrVkA1r6NmqsUkPH0w//+bq /1FgVOU3sS/r1hk/n3ZNBTSO0m5LgKY+XBA8AzqwlPVFxq4O4f/sfTFYGiDIR7z4Bz7u pg0Q== X-Gm-Message-State: AOJu0YwvvzdV8SQVPQN4Xh6ESinKaYReb+cG8LxwkLgueVlwgA6zmY52 aWqUlLM0PznqMgIx1MBSRFbrJmxB3HdyyOA/+w+MvBHymA0QXYU0FwJ07y9VQ0SGTES2rOBkwAT n1A32 X-Gm-Gg: AfdE7cmq9PUJoh222puUXJj1rxs8QCJTTsppjGNMFWAR1Q5ILHG9YHhvU6komcg1vlu 8n1URb9/avbuVxa+siJD5lipLhjyWjwU9kyq99I8+Plr7fxwQcdFBEZu/V7Jtp+ejJ+icA9I2UF Ia4b6kcfUrJecL2/cOIExOpa5iT/OWKUFAQCUezExZbDx11b/L9/0wnGPitIl7gRxqstrZm1jQv hfOS9r0jJ2SPS4xA0JOCqiVDpWBduO6Om5dXiokN99xKJSKz94+kz4G12IBt7F8c13TV1+0X1Ur wWzC8LnVfSEQUhTZryR6Hg9P7fRaInN9y+VOXTfVxs7FeUE1lIg7YpHzZXmPQ1U37UHZJ8dO06x BhbrtmOHRDE36RkVRU4cVaySD4P+yOo3Uxgqgh6ZFAqo0ISAoLH3v1io/jqaS0eCs/XHTWH6dnJ +C5ZF9xz8+Wl+AHpo7y+PgNbjLA2+CN5hx/Jp+PaQGJFNkf99J/Q== X-Received: by 2002:a17:903:f8d:b0:2ca:75af:1a92 with SMTP id d9443c01a7336-2ca75af1c05mr6048165ad.33.1782875095494; Tue, 30 Jun 2026 20:04:55 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: shivangu@linux.ibm.com, qemu-arm@nongnu.org, qemu-riscv@nongnu.org Subject: [PATCH 13/17] target/riscv: Set ID for watchpoints and breakpoints Date: Tue, 30 Jun 2026 20:04:39 -0700 Message-ID: <20260701030443.1382447-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260701030443.1382447-1-richard.henderson@linaro.org> References: <20260701030443.1382447-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1782875267397158500 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson --- target/riscv/debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/riscv/debug.c b/target/riscv/debug.c index ad9df09cf7..5f76dd4b7a 100644 --- a/target/riscv/debug.c +++ b/target/riscv/debug.c @@ -479,7 +479,7 @@ static void type2_breakpoint_insert(CPURISCVState *env,= target_ulong index) target_ulong addr =3D env->tdata2[index]; bool enabled =3D type2_breakpoint_enabled(ctrl); CPUState *cs =3D env_cpu(env); - int flags =3D BP_CPU | BP_STOP_BEFORE_ACCESS; + int flags =3D BP_CPU | BP_STOP_BEFORE_ACCESS | (index << BP_CPU_ID_SHI= FT); uint32_t size, def_size; =20 if (!enabled) { @@ -604,7 +604,7 @@ static void type6_breakpoint_insert(CPURISCVState *env,= target_ulong index) target_ulong addr =3D env->tdata2[index]; bool enabled =3D type6_breakpoint_enabled(ctrl); CPUState *cs =3D env_cpu(env); - int flags =3D BP_CPU | BP_STOP_BEFORE_ACCESS; + int flags =3D BP_CPU | BP_STOP_BEFORE_ACCESS | (index << BP_CPU_ID_SHI= FT); uint32_t size; =20 if (!enabled) { --=20 2.43.0 From nobody Sun Jul 26 11:07:31 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1782875366; cv=none; d=zohomail.com; s=zohoarc; b=nIH8IXfrA87S6ihR0IFDFNTHct8GlEVOMSodKc+VcHFyvB9wTlxPIqM6xW1PtGAkcOrMHaLwmUKgEUl25B32lfB93Ay//QUXneoIWH1IRi0D5lP/hLd65pKxzAjEpTKOKJWymaxIVTjk0lFMJm1fA6oo2XeQfOpBrt0kL8dBQeE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782875366; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=GpBHHB2qT6NwCe+qvDWA02RscHS+6npmH3JynUqQKmc=; b=eKcgVnMfpnodsnmObTESeNvb0DLm9mtfcqmgucZwWGATMce1A2ZG5Ca8Sg73ueR3sbktesz/C6NkF529XKF1DwMqN3m9wZcoY7DVh5Uz17mTRWrki5XK6rw3Iq5dseRZTSy9ff6OqJ/DkRLIdWupZzNl3LFZKKpa6zuZtUHCiZQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1782875366606125.00723253543458; Tue, 30 Jun 2026 20:09:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1welGA-0005zx-JV; Tue, 30 Jun 2026 23:05:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1welG2-0005kx-41 for qemu-devel@nongnu.org; Tue, 30 Jun 2026 23:05:02 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1welFy-0002su-9U for qemu-devel@nongnu.org; Tue, 30 Jun 2026 23:05:01 -0400 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-2c9dbd00f1dso940805ad.3 for ; Tue, 30 Jun 2026 20:04:57 -0700 (PDT) Received: from stoup.. (174-21-129-215.tukw.qwest.net. [174.21.129.215]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ca37c74261sm23758085ad.22.2026.06.30.20.04.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2026 20:04:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1782875096; x=1783479896; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GpBHHB2qT6NwCe+qvDWA02RscHS+6npmH3JynUqQKmc=; b=pVr27IqIX7K9tkV9V4vQAxRprMOK9HRFSf5IUeVlw6NrumilGlNE+K00VhrVxL0Ksz U/f+8vek9VhvQVWHSAKE+l0wLKPwnjEB+1v2+hrA7outWDF774B5Y12Qlrw5V0fbS7zv uYQnjbh5qOkiR6N1VjTzFT3tA+CHGDalGokXQ+3icEqU3+LnIh54ombxURanxlrNzRFA EJg1LEWH+IHIQ2khOvnds6WCBNclncA2CnpKo3B8y8Qb/m2eUgNog6YjhUa8bBGES5fY GB1Fu+yNh9GnaGlZchkHIEdBHBdWeIWbNSmspGI21PM0ehjbhhTLCcamQV1MP++zplbE DUBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782875096; x=1783479896; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=GpBHHB2qT6NwCe+qvDWA02RscHS+6npmH3JynUqQKmc=; b=ght8Wc4EjXtjfp8EpZfC3u2BpOotqX+SOw3DJaxbNH+vhGwc/XROh+82m3MbYL0oyA uVAnFgskDDs210tn4NpslvoKBun+c66zsDbnGcM1j2IjjylCM+LVqOOr2OUUWlPN7wbY oKBb0FeRM62u0Bm5OgWfu/0uls5lzV9kKNh7N5kYHPktDBMi+mxvUB0lWSdgjfddlQyE ue+DyADuFa/5S56dQj0d9MrSF9Jbp7QRVRQoHXLubo9AoxVIq3j3MxMVKCrYwcm6oYAF qcup8hQFMlBlZyYn/lK+6z4+Ej17CQUoGK4RSsvz5uIN7hx36kIWoh3KfzBOx9bx73Pk Fwmw== X-Gm-Message-State: AOJu0Yy8Evby6RgXr/vDkw5m8gV0dVFEy83cxZvMMni84JBTpPdY4EZd R03cPGjWLddc3NUIr3s8V/E4BiE57tTF/01bGS/FvqsWFGCmHO8EQQ8s2I8+HWLGXbobm1GLG57 2uXzm X-Gm-Gg: AfdE7clVJAnAZeqVofCIHBO6LIWVhzmJjjU5dkRRHtReABD/emEl4oRLqA4NVZRVR3Y xvWXR/02devPUXRq53uBFZahvD/aACeBZBraZkWqpGum8Tsgzj1Swh6wD6bLOwUJ5fwHoOKUiCD VmeZpVrJuOi8O2z6T5IloIystCqCxKu0F05h3ae4h8Ti7e5zxiLD0Ra2IfVkpENFzzo8rTHLfS3 5KYzUUhw2QSdmcjV2vAQwhADpE/vxofEUbwqqKcyfM1FnPM08V0DlRsznGd0xY+8Azr/onmiCGZ r1b5dcLQ4cz+OkI6cLKPfy2sY66YxBnKmj5p0yorWD60klvkA3Gh6WUaed/NnsZDadbwNwh+E2+ CeKhx3aSUv2Sxww9xPHlC0ypcIFlO3Meu3jPX1hDeHInStqfn793SdXDR9UGFDmdI1Ca9WzH8ZZ NgPFi1OALE24xjwY45m9HL3jfuycA7mPrvdqUuobU4mEzVuU9X9w== X-Received: by 2002:a17:903:32ca:b0:2ca:eeb:cf64 with SMTP id d9443c01a7336-2ca5a55bb23mr28523375ad.9.1782875096270; Tue, 30 Jun 2026 20:04:56 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: shivangu@linux.ibm.com, qemu-arm@nongnu.org, qemu-riscv@nongnu.org Subject: [PATCH 14/17] target/riscv: Use bp argument in riscv_cpu_debug_check_breakpoint Date: Tue, 30 Jun 2026 20:04:40 -0700 Message-ID: <20260701030443.1382447-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260701030443.1382447-1-richard.henderson@linaro.org> References: <20260701030443.1382447-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1782875367740158501 Content-Type: text/plain; charset="utf-8" Use the ID of the breakpoint instead of a loop over all. Signed-off-by: Richard Henderson --- target/riscv/debug.c | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/target/riscv/debug.c b/target/riscv/debug.c index 5f76dd4b7a..f6ffc62f1a 100644 --- a/target/riscv/debug.c +++ b/target/riscv/debug.c @@ -943,41 +943,27 @@ bool riscv_cpu_debug_check_breakpoint(CPUState *cs, c= onst CPUBreakpoint *bp) { RISCVCPU *cpu =3D RISCV_CPU(cs); CPURISCVState *env =3D &cpu->env; - target_ulong ctrl; - target_ulong pc; - int trigger_type; - int i; + int i =3D bp->flags >> BP_CPU_ID_SHIFT; + trigger_type_t trigger_type =3D get_trigger_type(env, i); =20 - for (i =3D 0; i < RV_MAX_TRIGGERS; i++) { - trigger_type =3D get_trigger_type(env, i); - - if (!trigger_common_match(env, trigger_type, i)) { - continue; - } + if (trigger_common_match(env, trigger_type, i)) { + target_ulong ctrl =3D 0; =20 switch (trigger_type) { case TRIGGER_TYPE_AD_MATCH: - ctrl =3D env->tdata1[i]; - pc =3D env->tdata2[i]; - - if ((ctrl & TYPE2_EXEC) && (bp->pc =3D=3D pc)) { - env->badaddr =3D pc; - return true; - } + ctrl =3D env->tdata1[i] & TYPE2_EXEC; break; case TRIGGER_TYPE_AD_MATCH6: - ctrl =3D env->tdata1[i]; - pc =3D env->tdata2[i]; - - if ((ctrl & TYPE6_EXEC) && (bp->pc =3D=3D pc)) { - env->badaddr =3D pc; - return true; - } + ctrl =3D env->tdata1[i] & TYPE6_EXEC; break; default: /* other trigger types are not supported or irrelevant */ break; } + if (ctrl) { + env->badaddr =3D env->tdata2[i]; + return true; + } } =20 return false; --=20 2.43.0 From nobody Sun Jul 26 11:07:31 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1782875208; cv=none; d=zohomail.com; s=zohoarc; b=T94lT8PknVVP3JDfehO9QiLpHWK147y/kdfft87WZdHL8QJQi/+mS9rMWvI9CXuz0qmcq0lVq9wvIKVF+U9RcA3ZKN29pMfhjrQgjIDFVD/UYzEPg6rlMU1HxYI2HpH6O/nKPGwwoDwAg24Hv3Wnjge5kj7GmSsiHWhZejMf928= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782875208; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1zAEykkLSsC6j7cjQi/1RKg/0+TkxhmA7YPc2ShnuVM=; b=Rx+dVrZrBAlIv57dBPmaDPbEpIXGYQUo+6YMQI6UgvsAVLO1QuCDmUJs+yEPTOgwwgEJWw+vDPlv484TESMmYxe3tzQEVCrySMV28fCZxX9IPGG9CAMI9nK7+DvY8z0hSqCgH9V/FQY+d0JuwVQAIhmN4mtTnETg9CDheXL/QYY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1782875208927696.6087871103232; Tue, 30 Jun 2026 20:06:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1welGB-00061t-A8; Tue, 30 Jun 2026 23:05:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1welG3-0005oU-B9 for qemu-devel@nongnu.org; Tue, 30 Jun 2026 23:05:03 -0400 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1welFy-0002tL-Fz for qemu-devel@nongnu.org; Tue, 30 Jun 2026 23:05:03 -0400 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-2ca70925c25so1699435ad.1 for ; Tue, 30 Jun 2026 20:04:58 -0700 (PDT) Received: from stoup.. (174-21-129-215.tukw.qwest.net. [174.21.129.215]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ca37c74261sm23758085ad.22.2026.06.30.20.04.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2026 20:04:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1782875097; x=1783479897; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1zAEykkLSsC6j7cjQi/1RKg/0+TkxhmA7YPc2ShnuVM=; b=CG2VhnFmNR4lMkL0aIDo4kriL3iIsH47yEfv26np4XIpu86U7MTbEa4QcmLdQPjJhC iuSgNrcX4qi5QnFJMXZl9wlVxeI+XLC1Ffzx0BlCEAQpK8WSSP8Q8a9iZljAOHhYpMz1 sXahTcZ26iLLmrzSykDV7V0jweUZH0I2D+b2493Vg5umoMeoV8CVHW8AhupErEu28gpO OumEYkYcL/XitXZLDyEaSPdR8at1x0Dxvjont1scTWojFag8Zb/K5QvDdkWrd+YUXwqo LtOTiE66DB+760mKvIPdoS8aUwxZjyduwHJP8E870PxETgEXtJXvjBSw+0bM5W0FbjGV JxFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782875097; x=1783479897; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=1zAEykkLSsC6j7cjQi/1RKg/0+TkxhmA7YPc2ShnuVM=; b=jwSxga+/f6nz3Zb5v+KaARKBd49/KjYH5ExSAcj6c6auvtLHRaoHDtedRVWy3EvYpN sxzhfrlV6s22K8JqA+2J2Pve1TZtz3aVyct3+66tY8E9myqCND14CzEohdkBNNfoLJGK 7b3lGnJYot7A0X2uyS+TcAfavRK66iGOjHErQrr9+uOO5X3KihuJPGXnXQKV1EPz8eOr /vjLWGPmgRv6mt25e3zxlYAJ5PIRavmNT5AvzPlEPw3aTt3+1wyCTiwUP2kEWff6V/NT ZocOzxppP3P51RNySW3aoAkpXmkNpj63sA/TCoDK24Pb3Op8Iw29UzYOT6kQdnLwFzKk I3xw== X-Gm-Message-State: AOJu0Ywb2s7QnI1lCsnxg3L9HnH+/6MkOJMWz3uAEr+DlmBCLnXB43Lw E7ne5AiQ3cDSASvsabLJ2tiGdOKEAGanOyQdSxDgDlqH2GwsLT1yWMPF9HUG2Tuvmb97e6PJXUH eiuwW X-Gm-Gg: AfdE7cnNKsp+Dri7RoNKLlqrVPvwacc3FteNb89Zjy4v3+8r82XQGCRhCypwKpaZMEA lacXPiOtJnTi+CYorD8WQ43M61tut2kPQiHCkAzha1gYeHVUwkSMWXp2sQVsCQiWyWLooF/ND0y UB/3rp0K+rFzzaNvI9ltKbxZ2XAH24KZV7zb/wz+aXQJc1o5k6xuY6LXN3OGbuf5tX6h5F1Hgod PNCgKFLy5oSJHL2/13lx0QXgZQQrF2vx+D8XQ8oQ/4k+3dVcbj+C7g3pbcrOQGLAob7Cl2XTlf7 sNrpmfXfXHcVIQXQYoAZmGqNe61eYnMV9iLLozlQC89haws/1HcgXeGlvGOCBt/Xj6jJ3iXBGOL l0SCu48ySkr2pP+opMeoL6AQavJAAIZOhZdNYxLq1/qarU27IQOUcPWAaAH20Rn1h2tQ5XRRcWM YaVOtcBT7Qlu1drGKDPq3FyNLezNZNRZNsyCApMaqqGGJEyVxw6A== X-Received: by 2002:a17:903:3b83:b0:2bd:c925:3a16 with SMTP id d9443c01a7336-2ca2d52b188mr56311105ad.2.1782875096903; Tue, 30 Jun 2026 20:04:56 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: shivangu@linux.ibm.com, qemu-arm@nongnu.org, qemu-riscv@nongnu.org Subject: [PATCH 15/17] target/riscv: Use bp argument in riscv_cpu_debug_check_watchpoint Date: Tue, 30 Jun 2026 20:04:41 -0700 Message-ID: <20260701030443.1382447-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260701030443.1382447-1-richard.henderson@linaro.org> References: <20260701030443.1382447-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62c.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1782875211039158500 Content-Type: text/plain; charset="utf-8" Use the ID of the watchpoint instead of a loop over all. This fixes a bug in which addr was compared against wp->vaddr, so that we never recognized watchpoints that didn't trigger at the start of the region. Signed-off-by: Richard Henderson --- target/riscv/debug.c | 55 +++----------------------------------------- 1 file changed, 3 insertions(+), 52 deletions(-) diff --git a/target/riscv/debug.c b/target/riscv/debug.c index f6ffc62f1a..433050bd94 100644 --- a/target/riscv/debug.c +++ b/target/riscv/debug.c @@ -973,59 +973,10 @@ bool riscv_cpu_debug_check_watchpoint(CPUState *cs, c= onst CPUWatchpoint *wp) { RISCVCPU *cpu =3D RISCV_CPU(cs); CPURISCVState *env =3D &cpu->env; - target_ulong ctrl; - target_ulong addr; - int trigger_type; - int flags; - int i; + int i =3D wp->flags >> BP_CPU_ID_SHIFT; + trigger_type_t trigger_type =3D get_trigger_type(env, i); =20 - for (i =3D 0; i < RV_MAX_TRIGGERS; i++) { - trigger_type =3D get_trigger_type(env, i); - - if (!trigger_common_match(env, trigger_type, i)) { - continue; - } - - switch (trigger_type) { - case TRIGGER_TYPE_AD_MATCH: - ctrl =3D env->tdata1[i]; - addr =3D env->tdata2[i]; - flags =3D 0; - - if (ctrl & TYPE2_LOAD) { - flags |=3D BP_MEM_READ; - } - if (ctrl & TYPE2_STORE) { - flags |=3D BP_MEM_WRITE; - } - - if ((wp->flags & flags) && (wp->vaddr =3D=3D addr)) { - return true; - } - break; - case TRIGGER_TYPE_AD_MATCH6: - ctrl =3D env->tdata1[i]; - addr =3D env->tdata2[i]; - flags =3D 0; - - if (ctrl & TYPE6_LOAD) { - flags |=3D BP_MEM_READ; - } - if (ctrl & TYPE6_STORE) { - flags |=3D BP_MEM_WRITE; - } - - if ((wp->flags & flags) && (wp->vaddr =3D=3D addr)) { - return true; - } - break; - default: - /* other trigger types are not supported */ - break; - } - } - - return false; + return trigger_common_match(env, trigger_type, i); } =20 void riscv_trigger_realize(CPURISCVState *env) --=20 2.43.0 From nobody Sun Jul 26 11:07:31 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1782875235; cv=none; d=zohomail.com; s=zohoarc; b=Fghdlu2Apf+bXY9RziOWT/Ma1x/HDibk/4ytufRn32xt6s2br8XhnB3TL/sJIExaOpAwXt+pY8ZYNceUHXj3nR0xm6uX06pbZUHT4QLTgslE//TgSq2v8/EfC2vsGztaInwYyDdOcZR1tPxWmwrbDoPVFUqBCa/5Sj/kHvOYrYk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782875235; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=M8qTIMHwz1Nx+GGcIl7ueTFBZIpYrxFuhh8bdVUncVE=; b=a9W0hRgJpyoRjAHUQeaCVu3de1fFGQGbNVnvetXNqKJ3+Rb0EPJsjW5oke9N3eFaVuzFiPS23Jk66SZ2YmSamtT3K8+M2/TSRKYcH0lQcUK4l8dCTXQBzNV59JrVzpjIZt2LB6DFEPJEYtsezaxlVE/QmKtY84/Ljcc49NO0Q1c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1782875235896403.98443202963426; Tue, 30 Jun 2026 20:07:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1welGC-00067D-Qe; Tue, 30 Jun 2026 23:05:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1welG3-0005ot-I7 for qemu-devel@nongnu.org; Tue, 30 Jun 2026 23:05:03 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1welFz-0002tp-AM for qemu-devel@nongnu.org; Tue, 30 Jun 2026 23:05:03 -0400 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-2c82538b6c0so1418765ad.2 for ; Tue, 30 Jun 2026 20:04:58 -0700 (PDT) Received: from stoup.. (174-21-129-215.tukw.qwest.net. [174.21.129.215]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ca37c74261sm23758085ad.22.2026.06.30.20.04.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2026 20:04:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1782875098; x=1783479898; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=M8qTIMHwz1Nx+GGcIl7ueTFBZIpYrxFuhh8bdVUncVE=; b=zX1db1xGD4b4QfNogYb0R3bZwPbdejJAfjxJ/0tUvtDxzducJmp94nZRPQ9DcpPJuc 9MBnA2ZqtTB1BiR4XkLxifduVVYQUIj+svk/VbtuKbDpP1PKXxm9QCgcH9pQ0hMOuQYR MnokEbglEwEhQMuVMMlvvTHo1N9Qm2EmZTK2zl0LMsACm65ErYx1fKv1BG2wGgI8rgKG r4HbhuxVZMUqhBnjR20g7RVnY5ZXb3RHOgmAPtoKnQAtPMdhJhBu5T64cEqG4G0CXzAS tz5BUEQDDuKBzvsJD6n3CCNLPUO2gsmvW3YB2qm0aRPg0e6kGNCJLDPPYtiTwgtDINuN DHBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782875098; x=1783479898; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=M8qTIMHwz1Nx+GGcIl7ueTFBZIpYrxFuhh8bdVUncVE=; b=UvNPtBRRg1T0ImuktJBiUfQqoJRGAz4T7+q7gJSEdsuoB4qk7r3W5JMlZ+9FEAPPUS gmQZyPmd6NCttRYaPw62MjvTIEAFaZoFXzDq01uRSrttuh8BHyKj2PfjPyiTEkbeHHQq b3nXhItTOlGYFr7IJ2boyZ+2d8BvxnAV0cttcHuYbR64ajf5+rByZEEGadYyzu+Ddu5V YWVFOGL5ErKgxyuHOKbtbryxczFOoWOH029MpbXjNOUpIIR1E3+rdmomeUnp1rEryiKo B//l+mXA0UQ0x6EgJZIr/a2vt73bw70M22tHPunkCAXDv2oiSHT5kgbUy7q79ONGWERx ArVw== X-Gm-Message-State: AOJu0Yyw+4CeKyGj5z+33GpgduQ7aQDiYaL2zjq1QBkX7Cze6EbKucB8 NeKngH2kMFirbgtz6apiITcVgHsIwxMgUPkU+tDcs1Z+dWO2IYuuKU/UYFlHuJGui2aXn5B0pFT cNtpX X-Gm-Gg: AfdE7ckQetmN3astc3DaKNVclp9CyjPMYPEfIPz269I8ssQaztGKd7XB/n6ntS7G1/A Eh3a6avFGr51+7eUeog3BBjACCjHA53C1tW7BJ93AZacntoJiLwKxOU/hj4gSrT4M/HNew5yR7l 1qE6Al4aK+/XKaFIrkBFchwOwEPxWOZ9u++mqlL61tbNC0hr06kkdPobh8HpAAMDOvgf11w/KrE 1+Wp06z3FA0aA7iE5myW2f8KTXMF03F+MoNHNu5N8osGxqP1md2WrLqUzMmwf1Xl+ZuR/VejhqO 534ceXRBRP7ugQXm15QfTij+eX24oskeW1l5ijJelXAhuw+InSRcaZPy7fnCF9UdlmclcT4ihLj Rlk5nZDXIcSHLN8CjmsQ3+QFawP8YEtzEfbwztDFjLAxTptdXb96/VkD6f9gqD91ytacsM7wC2J WmPb2WlTQPcCgfC+WJGIP+HIN9X2duVw0iplZwFPJTrXtK+yLaGQ== X-Received: by 2002:a17:902:e5ca:b0:2c9:bd3b:34f with SMTP id d9443c01a7336-2ca2ea1bb17mr48617975ad.35.1782875097700; Tue, 30 Jun 2026 20:04:57 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: shivangu@linux.ibm.com, qemu-arm@nongnu.org, qemu-riscv@nongnu.org Subject: [PATCH 16/17] target/xtensa: Use BP_CPU_ID_SHIFT Date: Tue, 30 Jun 2026 20:04:42 -0700 Message-ID: <20260701030443.1382447-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260701030443.1382447-1-richard.henderson@linaro.org> References: <20260701030443.1382447-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1782875237169158500 Content-Type: text/plain; charset="utf-8" Set the id when installing the breakpoint, and drop the loop when checking the breakpoint. Signed-off-by: Richard Henderson --- target/xtensa/dbg_helper.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/target/xtensa/dbg_helper.c b/target/xtensa/dbg_helper.c index 160cdd798c..5b957474ea 100644 --- a/target/xtensa/dbg_helper.c +++ b/target/xtensa/dbg_helper.c @@ -44,7 +44,8 @@ void HELPER(wsr_ibreakenable)(CPUXtensaState *env, uint32= _t v) if (change & (1 << i)) { if (v & (1 << i)) { cpu_breakpoint_insert(cs, env->sregs[IBREAKA + i], - BP_CPU, &env->cpu_breakpoint[i]); + BP_CPU | (i << BP_CPU_ID_SHIFT), + &env->cpu_breakpoint[i]); } else { cpu_breakpoint_remove_by_ref(cs, env->cpu_breakpoint[i]); env->cpu_breakpoint[i] =3D NULL; @@ -60,7 +61,8 @@ void HELPER(wsr_ibreaka)(CPUXtensaState *env, uint32_t i,= uint32_t v) CPUState *cs =3D env_cpu(env); =20 cpu_breakpoint_remove_by_ref(cs, env->cpu_breakpoint[i]); - cpu_breakpoint_insert(cs, v, BP_CPU, &env->cpu_breakpoint[i]); + cpu_breakpoint_insert(cs, v, BP_CPU | (i << BP_CPU_ID_SHIFT), + &env->cpu_breakpoint[i]); } env->sregs[IBREAKA + i] =3D v; } @@ -68,18 +70,12 @@ void HELPER(wsr_ibreaka)(CPUXtensaState *env, uint32_t = i, uint32_t v) bool xtensa_debug_check_breakpoint(CPUState *cs, const CPUBreakpoint *bp) { CPUXtensaState *env =3D cpu_env(cs); - unsigned int i; + unsigned int i =3D bp->flags >> BP_CPU_ID_SHIFT; =20 if (xtensa_get_cintlevel(env) >=3D env->config->debug_level) { return false; } - for (i =3D 0; i < env->config->nibreak; ++i) { - if (env->sregs[IBREAKENABLE] & (1 << i) && - env->sregs[IBREAKA + i] =3D=3D env->pc) { - return true; - } - } - return false; + return (env->sregs[IBREAKENABLE] >> i) & 1; } =20 static void set_dbreak(CPUXtensaState *env, unsigned i, uint32_t dbreaka, --=20 2.43.0 From nobody Sun Jul 26 11:07:31 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1782875131; cv=none; d=zohomail.com; s=zohoarc; b=N750q5NzcK7xlEiEME7lICrmIx85UsXKRnsn1QibnEQJHqaHpLyXjUtF0lMzIH4vedwdluSc1OX/HV/B/g0bIBO2BM/imN1DkVWNYf17reqp9ByqKXRpwmRWtnv0ilquX+oLk6K8/hAaDHQRZsbIBRXyD5hYGfPZ2HX1fUKRuHY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782875131; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=uAgzh+Ryx4YCBocOo9b+q+A4Q5K+v+5tUwjHqkSzxzY=; b=hcwa11VPHDhf1jJmhcZRXaKvIPbbq+x8QJs0WD+IVRS5X1oVlref4wOnsb8YrBm0zyFT6IXL94u5IXDVOgk7mSHS+4ibe/5jN6rMlvBrfO3woLd0XSp+7Xn6n+RsDkbOCSB/Z2oG+0Vw7JMRp7l2UdLTMLqE2u1xI+7e3CyzX6Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1782875131526760.2206233268058; Tue, 30 Jun 2026 20:05:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1welGB-00063J-QW; Tue, 30 Jun 2026 23:05:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1welG5-0005r4-2y for qemu-devel@nongnu.org; Tue, 30 Jun 2026 23:05:05 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1welG0-0002ui-7q for qemu-devel@nongnu.org; Tue, 30 Jun 2026 23:05:04 -0400 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-2c9f10fa7a3so1526295ad.0 for ; Tue, 30 Jun 2026 20:04:59 -0700 (PDT) Received: from stoup.. (174-21-129-215.tukw.qwest.net. [174.21.129.215]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ca37c74261sm23758085ad.22.2026.06.30.20.04.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2026 20:04:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1782875099; x=1783479899; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uAgzh+Ryx4YCBocOo9b+q+A4Q5K+v+5tUwjHqkSzxzY=; b=IgJUEPSkq/MmUQo3UF9NsHvMgYWGhy/UnQDfLW1fTpP2J1cIYmTeFNqfC4xaGRRxtj 9YcE4D1UU1IpBQvi5EQ2lk4Dr17P0m/unPvLZ9LnL5ToFgiddgJ6n/zEwPixwyB4E6YT BxjOpsClS/VFxyk2wCEV5V5AcKA2yxOY0rV8Wh97Pu3kJG5CaEzsnwFhiVI8qSzdHRoM EVp36YIDEkRp6mxZJZAclHtnPRsx4trK5QWVqxsXsAHQZO3qI0aBb18qJBFGPaMF2oab w5xW1PJeLdSx3iwESqRTP0wLOTeFXFlybx/Uoc9rUxiIKvrqljlS/UK/NlmreapDvNqt Vg0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782875099; x=1783479899; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=uAgzh+Ryx4YCBocOo9b+q+A4Q5K+v+5tUwjHqkSzxzY=; b=KpMrlZknVJj+aJ0v9d+Ll84a552bxs4SFOYNQMEC7+YrmiDrmvUpQrdxbOmM73zQPT ONy3lI2xFLZrN+wi3fAL7LvtBBB1ahJvSP4aaA5ADbKwR9e/w5xxW+4dS0k66irkMZ5m Ddb65arVmEwRVo9WIe4GYmJibUY5enb5SB28unWDcBA/FSnYJSxChgYgNOyozDfIpJhf W18bTkzdhNzwZrVa7lDDMrfm04C9gZKBDFPMcoDFMxdbGvCyKSXVBpy3YJysz2LQ0vR4 HUmjH3X679HgBo0NvPYN2nCwVXyJZY80Yk0veqKIT/RenVuPmYBp1/D1tuLoXn+bfZ5K /hng== X-Gm-Message-State: AOJu0YwDTeMTYdu/0tJ6RDLKv6Fk3JxRxYFA5qgjve0qhsElRmjkhaY7 ZFbiEjnlHDv24eaeu019KjcGL3Ynt5B5r8fslV1+LPMhHW13dWBBpPDOQNnbu2GRnABKXCKRqCX RqE4S X-Gm-Gg: AfdE7clR/zhwL+c5uYY+ABUPnqJyYE3YgPbULFRJcm3W3Q3Eqw7mhw5ua3mKrke1+q+ 3TNyTn9kLmxPpK/HHkzVd9s/lMwoZO7Y7kEAZ0/GJNaMhIPT7KwtztWqRjVmthUqEcqszpSHctD ZmzrcOqQieJIO1pWt7CnXwVd5qfnmjvWsSZZk6Jzg9rYNsHjYb18p6vD+zNGbX/e4kuY6VlH7o6 l+YG3+ylSazK6uqGSrrTttDMJ9AwBcouavU0jRpvz8HDSyYUsF+qZtjvZD9ZFYHrUk/o7Z3PaJ1 orcsf5MB22fTsrqsm5KdevzrBiw4Ii2MakPQWpFIfKlirkWUJB3FtF+XwEubqLELoAx8vlBdIFs EFPRs8SfqukJDx52/VTSEQ1XWVFFaMA+CnJ+Ws+7khTUwkwq5zpofzhzXwPIW43qjaCByVoAVvS nwWEOpxt71PXgWszYWGpr3ydkSUF62IcHU2WUbxjcWgbGA2oMdzg== X-Received: by 2002:a17:903:2f8b:b0:2c9:b1ed:eb5d with SMTP id d9443c01a7336-2ca5a657fa6mr26685565ad.47.1782875098559; Tue, 30 Jun 2026 20:04:58 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: shivangu@linux.ibm.com, qemu-arm@nongnu.org, qemu-riscv@nongnu.org Subject: [PATCH 17/17] cpu: Use interval-tree for CPUBreakpoint Date: Tue, 30 Jun 2026 20:04:43 -0700 Message-ID: <20260701030443.1382447-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260701030443.1382447-1-richard.henderson@linaro.org> References: <20260701030443.1382447-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1782875132864158500 Content-Type: text/plain; charset="utf-8" Use a balanced binary tree rather than a simple list for breakpoints. Using an interval tree makes it easy to probe for all breakpoints on a virtual page. Signed-off-by: Richard Henderson --- include/exec/breakpoint.h | 6 ++--- include/hw/core/cpu.h | 3 ++- accel/tcg/cpu-exec.c | 48 +++++++++++++++++++-------------------- cpu-common.c | 46 +++++++++++++++++++------------------ hw/core/cpu-common.c | 1 - linux-user/main.c | 13 +++++++---- 6 files changed, 61 insertions(+), 56 deletions(-) diff --git a/include/exec/breakpoint.h b/include/exec/breakpoint.h index 93876f3304..d0b5669fa1 100644 --- a/include/exec/breakpoint.h +++ b/include/exec/breakpoint.h @@ -8,6 +8,7 @@ #ifndef EXEC_BREAKPOINT_H #define EXEC_BREAKPOINT_H =20 +#include "qemu/interval-tree.h" #include "qemu/queue.h" #include "exec/vaddr.h" #include "exec/memattrs.h" @@ -29,9 +30,8 @@ #define BP_CPU_ID_SHIFT 16 =20 struct CPUBreakpoint { - vaddr pc; - uint32_t flags; /* BP_* */ - QTAILQ_ENTRY(CPUBreakpoint) entry; + IntervalTreeNode itree; /* start =3D=3D last =3D=3D pc */ + uint32_t flags; /* BP_* */ }; =20 struct CPUWatchpoint { diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index ae8daa1159..b0cc1b8fa7 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -30,6 +30,7 @@ #include "qapi/qapi-types-machine.h" #include "qapi/qapi-types-run-state.h" #include "qemu/bitmap.h" +#include "qemu/interval-tree.h" #include "qemu/rcu_queue.h" #include "qemu/queue.h" #include "qemu/lockcnt.h" @@ -525,7 +526,7 @@ struct CPUState { QTAILQ_ENTRY(CPUState) node; =20 /* ice debug support */ - QTAILQ_HEAD(, CPUBreakpoint) breakpoints; + IntervalTreeRoot breakpoints; =20 QTAILQ_HEAD(, CPUWatchpoint) watchpoints; CPUWatchpoint *watchpoint_hit; diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 66ec656861..2d94afb9cc 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -296,8 +296,7 @@ static void log_cpu_exec(vaddr pc, CPUState *cpu, static bool check_for_breakpoints_slow(CPUState *cpu, vaddr pc, uint32_t *cflags) { - CPUBreakpoint *bp; - bool match_page =3D false; + IntervalTreeNode *n; =20 /* * Singlestep overrides breakpoints. @@ -312,32 +311,28 @@ static bool check_for_breakpoints_slow(CPUState *cpu,= vaddr pc, return false; } =20 - QTAILQ_FOREACH(bp, &cpu->breakpoints, entry) { - /* - * If we have an exact pc match, trigger the breakpoint. - * Otherwise, note matches within the page. - */ - if (pc =3D=3D bp->pc) { - bool match_bp =3D false; + /* If we have an exact pc match, trigger the breakpoint. */ + for (n =3D interval_tree_iter_first(&cpu->breakpoints, pc, pc); + n; + n =3D interval_tree_iter_next(n, pc, pc)) { + CPUBreakpoint *bp =3D container_of(n, CPUBreakpoint, itree); + bool match_bp =3D false; =20 - if (bp->flags & BP_GDB) { - match_bp =3D true; - } else if (bp->flags & BP_CPU) { + if (bp->flags & BP_GDB) { + match_bp =3D true; + } else if (bp->flags & BP_CPU) { #ifdef CONFIG_USER_ONLY - g_assert_not_reached(); + g_assert_not_reached(); #else - const TCGCPUOps *tcg_ops =3D cpu->cc->tcg_ops; - assert(tcg_ops->debug_check_breakpoint); - match_bp =3D tcg_ops->debug_check_breakpoint(cpu, bp); + const TCGCPUOps *tcg_ops =3D cpu->cc->tcg_ops; + assert(tcg_ops->debug_check_breakpoint); + match_bp =3D tcg_ops->debug_check_breakpoint(cpu, bp); #endif - } + } =20 - if (match_bp) { - cpu->exception_index =3D EXCP_DEBUG; - return true; - } - } else if (((pc ^ bp->pc) & TARGET_PAGE_MASK) =3D=3D 0) { - match_page =3D true; + if (match_bp) { + cpu->exception_index =3D EXCP_DEBUG; + return true; } } =20 @@ -353,7 +348,10 @@ static bool check_for_breakpoints_slow(CPUState *cpu, = vaddr pc, * invalidated, nor would any TB need to be invalidated as * breakpoints are removed. */ - if (match_page) { + n =3D interval_tree_iter_first(&cpu->breakpoints, + pc & TARGET_PAGE_MASK, + pc | ~TARGET_PAGE_MASK); + if (n) { *cflags =3D (*cflags & ~CF_COUNT_MASK) | CF_NO_GOTO_TB | CF_BP_PAG= E | 1; } return false; @@ -362,7 +360,7 @@ static bool check_for_breakpoints_slow(CPUState *cpu, v= addr pc, static inline bool check_for_breakpoints(CPUState *cpu, vaddr pc, uint32_t *cflags) { - return unlikely(!QTAILQ_EMPTY(&cpu->breakpoints)) && + return unlikely(!interval_tree_is_empty(&cpu->breakpoints)) && check_for_breakpoints_slow(cpu, pc, cflags); } =20 diff --git a/cpu-common.c b/cpu-common.c index 0b54e8a497..7baea8bdd0 100644 --- a/cpu-common.c +++ b/cpu-common.c @@ -392,13 +392,13 @@ void process_queued_cpu_work(CPUState *cpu) /* Return true if PC matches an installed breakpoint. */ bool cpu_breakpoint_test(CPUState *cpu, vaddr pc, int mask) { - CPUBreakpoint *bp; + IntervalTreeNode *n; =20 - if (unlikely(!QTAILQ_EMPTY(&cpu->breakpoints))) { - QTAILQ_FOREACH(bp, &cpu->breakpoints, entry) { - if (bp->pc =3D=3D pc && (bp->flags & mask)) { - return true; - } + for (n =3D interval_tree_iter_first(&cpu->breakpoints, pc, pc); n; + n =3D interval_tree_iter_next(n, pc, pc)) { + CPUBreakpoint *bp =3D container_of(n, CPUBreakpoint, itree); + if (bp->flags & mask) { + return true; } } return false; @@ -414,17 +414,13 @@ int cpu_breakpoint_insert(CPUState *cpu, vaddr pc, ui= nt32_t flags, pc =3D cpu->cc->gdb_adjust_breakpoint(cpu, pc); } =20 - bp =3D g_malloc(sizeof(*bp)); + bp =3D g_new0(CPUBreakpoint, 1); =20 - bp->pc =3D pc; + bp->itree.start =3D pc; + bp->itree.last =3D pc; bp->flags =3D flags; =20 - /* keep all GDB-injected breakpoints in front */ - if (flags & BP_GDB) { - QTAILQ_INSERT_HEAD(&cpu->breakpoints, bp, entry); - } else { - QTAILQ_INSERT_TAIL(&cpu->breakpoints, bp, entry); - } + interval_tree_insert(&bp->itree, &cpu->breakpoints); =20 if (breakpoint) { *breakpoint =3D bp; @@ -437,36 +433,42 @@ int cpu_breakpoint_insert(CPUState *cpu, vaddr pc, ui= nt32_t flags, /* Remove a specific breakpoint. */ int cpu_breakpoint_remove(CPUState *cpu, vaddr pc, uint32_t flags) { - CPUBreakpoint *bp; + IntervalTreeNode *n; =20 if (cpu->cc->gdb_adjust_breakpoint) { pc =3D cpu->cc->gdb_adjust_breakpoint(cpu, pc); } =20 - QTAILQ_FOREACH(bp, &cpu->breakpoints, entry) { - if (bp->pc =3D=3D pc && bp->flags =3D=3D flags) { + for (n =3D interval_tree_iter_first(&cpu->breakpoints, pc, pc); n; + n =3D interval_tree_iter_next(n, pc, pc)) { + CPUBreakpoint *bp =3D container_of(n, CPUBreakpoint, itree); + if (bp->flags =3D=3D flags) { cpu_breakpoint_remove_by_ref(cpu, bp); return 0; } } + return -ENOENT; } =20 /* Remove a specific breakpoint by reference. */ void cpu_breakpoint_remove_by_ref(CPUState *cpu, CPUBreakpoint *bp) { - QTAILQ_REMOVE(&cpu->breakpoints, bp, entry); - - trace_breakpoint_remove(cpu->cpu_index, bp->pc, bp->flags); + interval_tree_remove(&bp->itree, &cpu->breakpoints); + trace_breakpoint_remove(cpu->cpu_index, bp->itree.start, bp->flags); g_free(bp); } =20 /* Remove all matching breakpoints. */ void cpu_breakpoint_remove_all(CPUState *cpu, int mask) { - CPUBreakpoint *bp, *next; + IntervalTreeNode *n; =20 - QTAILQ_FOREACH_SAFE(bp, &cpu->breakpoints, entry, next) { + n =3D interval_tree_iter_first(&cpu->breakpoints, 0, -1); + while (n) { + CPUBreakpoint *bp =3D container_of(n, CPUBreakpoint, itree); + + n =3D interval_tree_iter_next(n, 0, -1); if (bp->flags & mask) { cpu_breakpoint_remove_by_ref(cpu, bp); } diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index e314f916f8..5c2d7ed42c 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -322,7 +322,6 @@ static void cpu_common_initfn(Object *obj) qemu_mutex_init(&cpu->work_mutex); qemu_lockcnt_init(&cpu->in_ioctl_lock); QSIMPLEQ_INIT(&cpu->work_list); - QTAILQ_INIT(&cpu->breakpoints); QTAILQ_INIT(&cpu->watchpoints); =20 cpu_exec_initfn(cpu); diff --git a/linux-user/main.c b/linux-user/main.c index c08c73fd80..dd7f267d46 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -239,7 +239,6 @@ CPUArchState *cpu_copy(CPUArchState *env) CPUState *cpu =3D env_cpu(env); CPUState *new_cpu =3D cpu_create(cpu_type); CPUArchState *new_env =3D cpu_env(new_cpu); - CPUBreakpoint *bp; =20 /* Reset non arch specific state */ cpu_reset(new_cpu); @@ -258,9 +257,15 @@ CPUArchState *cpu_copy(CPUArchState *env) /* Clone all break/watchpoints. Note: Once we support ptrace with hw-debug register access, make su= re BP_CPU break/watchpoints are handled correctly on clone. */ - QTAILQ_INIT(&new_cpu->breakpoints); - QTAILQ_FOREACH(bp, &cpu->breakpoints, entry) { - cpu_breakpoint_insert(new_cpu, bp->pc, bp->flags, NULL); + if (!interval_tree_is_empty(&cpu->breakpoints)) { + IntervalTreeNode *n; + + memset(&new_cpu->breakpoints, 0, sizeof(new_cpu->breakpoints)); + for (n =3D interval_tree_iter_first(&cpu->breakpoints, 0, -1); n; + n =3D interval_tree_iter_next(n, 0, -1)) { + CPUBreakpoint *bp =3D container_of(n, CPUBreakpoint, itree); + cpu_breakpoint_insert(new_cpu, bp->itree.start, bp->flags, NUL= L); + } } =20 return new_env; --=20 2.43.0