This repository was archived by the owner on Apr 13, 2019. It is now read-only.
Commit f6cbc72
target/riscv/pmp: Fix address matching, granularity and debug
- Rename pmp_hart_has_priv to pmp_has_access as this is a more
appropriate name for tracing
- Add tracing for CSR reads and writes to pmpcfg and pmpaddr
using -d trace:pmpcfg_csr_read,trace:pmpcfg_csr_write,
trace:pmpaddr_csr_read,trace:pmpaddr_csr_write
- Add tracing for PMP access and rule matching using
-d trace:pmp_has_access,trace:pmp_rule_match
- Add early out if not all rules are present; short-circuit
optimization bug for discontiguous rules fixed (reported by
wxjstz <[email protected]>)
- Fix bug where TLB entries were created for rules smaller
than the page size (4096), which caused results of rules
with small spans to be erroneously used in subsequent accesses
- Fix integer promotion bug in pmpcfg_csr_read (also reported
by wxjstz <[email protected]>)
- Fix bug where PMP allowed non M-mode accesses when no rules
have been configured (default behaviour is to deny access
to other modes until PMP has been configured. (also reported
by wxjstz <[email protected]>)
- Fix illegal offsets for pmpcfg CSR accesses on rv64 (reported
by wxjstz <[email protected]>)
- Use size_t for PMP CSR address offsets (unsigned int can
result in sign extension on some 64-bit architectures)
- Add granularity parameter and mask addresss writes so that
granularity can be detected.
- Use NA4 bit to represent terminal granule size where G > 0
(this is implied by the specification)
- Remove redundant debugging statements (unnecessar with the
new tracing support).
- Simplify rule matching loop and use a ternary expression
that contains the entire rule match result in a similar
condensed style to spike (riscv-isa-sim).
Co-authored-by: wxjstz <[email protected]>
Signed-off-by: Michael Clark <[email protected]>1 parent 6b6f93c commit f6cbc72
5 files changed
+180
-258
lines changedBinary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
414 | 414 | | |
415 | 415 | | |
416 | 416 | | |
| 417 | + | |
417 | 418 | | |
418 | 419 | | |
419 | 420 | | |
| |||
423 | 424 | | |
424 | 425 | | |
425 | 426 | | |
| 427 | + | |
426 | 428 | | |
427 | 429 | | |
428 | 430 | | |
429 | | - | |
430 | | - | |
431 | | - | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
432 | 435 | | |
| 436 | + | |
433 | 437 | | |
434 | 438 | | |
435 | | - | |
436 | | - | |
| 439 | + | |
| 440 | + | |
437 | 441 | | |
438 | 442 | | |
439 | 443 | | |
| |||
0 commit comments