]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/riscv: Add textra matching condition for the triggers
authorAlvin Chang <alvinga@andestech.com>
Mon, 26 Aug 2024 02:46:57 +0000 (10:46 +0800)
committerAlistair Francis <alistair.francis@wdc.com>
Wed, 2 Oct 2024 05:11:51 +0000 (15:11 +1000)
commit6ffe9b6669757bc84bbb4c6218561823db431025
tree38c4fd98e91fe245e6c1a2ddb4181d244e13e4bc
parentc4db48cc24a5e254697a3d4d9201f0e5227fce02
target/riscv: Add textra matching condition for the triggers

According to RISC-V Debug specification, the optional textra32 and
textra64 trigger CSRs can be used to configure additional matching
conditions for the triggers. For example, if the textra.MHSELECT field
is set to 4 (mcontext), this trigger will only match or fire if the low
bits of mcontext/hcontext equal textra.MHVALUE field.

This commit adds the aforementioned matching condition as common trigger
matching conditions. Currently, the only legal values of textra.MHSELECT
are 0 (ignore) and 4 (mcontext). When textra.MHSELECT is 0, we pass the
checking. When textra.MHSELECT is 4, we compare textra.MHVALUE with
mcontext CSR. The remaining fields, such as textra.SBYTEMASK,
textra.SVALUE, and textra.SSELECT, are hardwired to zero for now. Thus,
we skip checking them here.

Signed-off-by: Alvin Chang <alvinga@andestech.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20240826024657.262553-3-alvinga@andestech.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
target/riscv/debug.c
target/riscv/debug.h