diff options
author | Charalampos Mitrodimas <charmitro@posteo.net> | 2025-07-03 18:21:44 +0000 |
---|---|---|
committer | Alistair Francis <alistair.francis@wdc.com> | 2025-07-04 21:09:49 +1000 |
commit | a1f44e0c59081afceb5e2b389b6de96602f73977 (patch) | |
tree | 57cdb4dc02e76a3ff2afe43e8e9de85f48a084c4 /rust/qemu-api-macros/src/utils.rs | |
parent | b3452452e64be647fef98d2dce16c3f5c149235a (diff) | |
download | qemu-a1f44e0c59081afceb5e2b389b6de96602f73977.zip qemu-a1f44e0c59081afceb5e2b389b6de96602f73977.tar.gz qemu-a1f44e0c59081afceb5e2b389b6de96602f73977.tar.bz2 |
tests/tcg/riscv64: Add test for MEPC bit masking
Add a regression test to verify that MEPC properly masks the lower
bits when an address with mode bits is written to it, as required by
the RISC-V Privileged Architecture specification.
The test sets STVEC to an address with bit 0 set (vectored mode),
triggers an illegal instruction exception, copies STVEC to MEPC in the
trap handler, and verifies that MEPC masks bits [1:0] correctly for
IALIGN=32.
Without the fix, MEPC retains the mode bits (returns non-zero/FAIL).
With the fix, MEPC clears bits [1:0] (returns 0/PASS).
Signed-off-by: Charalampos Mitrodimas <charmitro@posteo.net>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Message-ID: <20250703182157.281320-3-charmitro@posteo.net>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'rust/qemu-api-macros/src/utils.rs')
0 files changed, 0 insertions, 0 deletions