The variable chain_ok is used to indicate if the current trigger
is suppressed by the trigger chain. A true value means the trigger
is either un-chained or matches all previous triggers in the chain,
and a false value means the trigger is chained and mismatches
previous triggers.
A false condition of variable chain_ok is missing. The false
condition should be mcontrol.chain=1 and not matching; otherwise,
the chain_ok=true (including initialization). The bug results in
issues #559 and #627.
Related issues:
- https://github.com/riscv-software-src/riscv-isa-sim/issues/599
- https://github.com/riscv-software-src/riscv-isa-sim/issues/627
This PR fixes the issues #559 and #627.
The data value of the function store_slow_path() is meaningful only when
the actually_store=true. Otherwise, the data value is a hollow value of
0, which may result in unintended trigger matching.
The spec defines that the mcontrol store address/data has a higher
priority over page fault and address misalignment (Debug spec, Table
5.2). Thus, the trigger checking should be before the translation and
alignment checking.
The previous implementation checks the trigger after the translation and
alignment, resulting in incorrect priority. For instance, when page fault
and trigger occur on the same instruction, the previous implementation
will choose to raise the page fault, which contradicts the priority
requirement.
This commit moves the trigger checking before the misaligned checking and
translation. The trigger will fire on the instruction instead of the page
fault in the above case.
The spec defines the mcontrol load address has a higher priority over
page fault and address misaligned (Debug spec, Table 5.2). Thus, the
trigger checking should be before the translation and alignment
checking.
The previous implementation checks the trigger after the translation
and alignment, resulting in incorrect priority. For instance, when page
fault and trigger occur on the same instruction, the previous
implementation will choose to raise the page fault, which contradicts
the priority requirement.
This commit adds an address-only trigger checking before the misaligned
checking and translation. The trigger will fire on the instruction
instead of the page fault in the above case.
The spec defines the mcontrol execute address has a higher priority over
page fault (Debug spec, Table 5.2). Thus, the trigger checking should be
before the translation.
The previous implementation checks the trigger after the translation,
resulting in incorrect priority. For instance, when page fault and
trigger occur on the same instruction, the previous implementation will
choose to raise the page fault, which contradicts the priority
requirement.
This commit adds an address-only trigger checking before the
translation. The trigger will fire on the instruction instead of the
page fault in the above case.
The mcontrol trigger can select either address or data for checking. The
The selection decides the priority of the trigger. For instance, the
address trigger has a higher priority over the page fault, and the page
fault has a higher priority over the data trigger.
The previous implementation only has the checking functions for data
trigger, which results in incorrect priority of address trigger.
This commit adds a has_data argument to indicate address trigger and the
priority of the trigger.
Don't include .a files in other .a files. Doing so trips a sanity
check in the Xcode 14 toolchain, because the included .a files are
not themselves mach-o format, even though their contents are.
To avoid long CI times, keep the program in binary form.
To avoid storing binary files in this repository, store the binaries as
an asset on a github release.