From: "Rui Qi" <qirui.001@bytedance.com>
To: "Himanshu Chauhan" <himanshu.chauhan@oss.qualcomm.com>
Cc: <linux-riscv@lists.infradead.org>, <linux-kernel@vger.kernel.org>,
<qingfang.deng@linux.dev>, <alex@ghiti.fr>,
<aou@eecs.berkeley.edu>, <palmer@dabbelt.com>, <pjw@kernel.org>,
<shuah@kernel.org>, <thecharlesjenkins@gmail.com>,
<jtaubepe@redhat.com>
Subject: Re: [PATCH v6 1/5] riscv: Introduce support for hardware break/watchpoints
Date: Fri, 11 Sep 2026 16:54:00 +0800 [thread overview]
Message-ID: <20260911085359.95227-2-qirui.001@bytedance.com> (raw)
In-Reply-To: <20260803134913.2013674-2-himanshu.chauhan@oss.qualcomm.com>
Hi Himanshu,
While testing this series on a platform exposing type-6 triggers, I hit a
failure that seems related to the mcontrol6 timing/hit semantics.
The current execute breakpoint path demuxes the event only by comparing
the programmed breakpoint address with regs->epc:
if (bp->address == args->regs->epc)
perf_bp_event(event, args->regs);
On our platform the execute trigger did fire, but the breakpoint
exception was reported with EPC pointing to the next instruction. For
example, the trigger was installed at 0x1062e, while the trap came in
with epc=0x10632. As a result the handler did not call perf_bp_event()
and the breakpoint selftest timed out.
This does not look like an instruction-size matching issue. The trigger
itself matched. The problem is that the kernel identifies the matching
execute trigger only by EPC equality.
For mcontrol6, I think the driver also needs to be careful about the
Sdtrig version exposed by tinfo. With tinfo.version > 0, bit 20 of
mcontrol6 is no longer the old timing bit, and hit1/hit0 encode the
fire timing. The series currently still defines/clears
RISCV_DBTR_MC6_TIMING_BIT and, for watchpoints, only checks
RISCV_DBTR_MC6_HIT_BIT. The execute path does not use hit information
at all.
Would it make sense to make the type-6 path version-aware, or otherwise
avoid relying solely on regs->epc == bp->address?
Thanks,
next prev parent reply other threads:[~2026-09-11 8:54 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-03 13:49 [PATCH v6 0/5] " Himanshu Chauhan
2026-08-03 13:49 ` [PATCH v6 1/5] " Himanshu Chauhan
2026-08-05 13:20 ` Chen Pei
2026-09-11 8:54 ` Rui Qi [this message]
2026-09-14 13:18 ` Himanshu Chauhan
2026-09-15 2:36 ` Rui Qi
2026-09-15 3:21 ` Qingfang Deng
2026-08-03 13:49 ` [PATCH v6 2/5] riscv: Add breakpoint and watchpoint test for riscv Himanshu Chauhan
2026-08-03 13:49 ` [PATCH v6 3/5] riscv: ptrace support for hardware break/watchpoints Himanshu Chauhan
2026-08-05 13:22 ` Chen Pei
2026-09-15 8:47 ` Rui Qi
2026-08-03 13:49 ` [PATCH v6 4/5] selftests/breakpoints: extend riscv test for ptrace hw break/watchpoints Himanshu Chauhan
2026-08-03 13:49 ` [PATCH v6 5/5] MAINTAINERS: Add entry for RISC-V Debugging Himanshu Chauhan
2026-08-04 17:10 ` [PATCH v6 0/5] riscv: Introduce support for hardware break/watchpoints Jesse Taube
2026-08-07 8:00 ` Himanshu Chauhan
2026-09-16 4:47 ` Charlie Jenkins
2026-09-16 8:15 ` Himanshu Chauhan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260911085359.95227-2-qirui.001@bytedance.com \
--to=qirui.001@bytedance.com \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=himanshu.chauhan@oss.qualcomm.com \
--cc=jtaubepe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
--cc=qingfang.deng@linux.dev \
--cc=shuah@kernel.org \
--cc=thecharlesjenkins@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®