diff options
author | Vac Chen <vacantron@gmail.com> | 2025-07-06 14:55:54 +0800 |
---|---|---|
committer | Alistair Francis <alistair.francis@wdc.com> | 2025-07-30 10:59:26 +1000 |
commit | 77707bfdf871199bbee665e721ced961aaf3a798 (patch) | |
tree | c735c3eca5ba8a411d0d7d1bac153bebf2f934bb /scripts/qemu.py | |
parent | 9b80226ece693197af8a981b424391b68b5bc38e (diff) | |
download | qemu-77707bfdf871199bbee665e721ced961aaf3a798.zip qemu-77707bfdf871199bbee665e721ced961aaf3a798.tar.gz qemu-77707bfdf871199bbee665e721ced961aaf3a798.tar.bz2 |
target/riscv: Fix pmp range wraparound on zero
pmp_is_in_range() prefers to match addresses within the interval
[start, end]. To archieve this, pmpaddrX is decremented during the end
address update.
In TOR mode, a rule is ignored if its start address is greater than or
equal to its end address.
However, if pmpaddrX is set to 0, this decrement operation causes the
calulated end address to wrap around to UINT_MAX. In this scenario, the
address guard for this PMP entry would become ineffective.
This patch addresses the issue by moving the guard check earlier,
preventing the problematic wraparound when pmpaddrX is zero.
Signed-off-by: Vac Chen <vacantron@gmail.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20250706065554.42953-1-vacantron@gmail.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'scripts/qemu.py')
0 files changed, 0 insertions, 0 deletions