[debug] enhance set_pmp_deny to support alignment checks#637
[debug] enhance set_pmp_deny to support alignment checks#637hirooih wants to merge 1 commit intoriscv-software-src:masterfrom
Conversation
|
Thank you for your suggestions. Let me ask you some about your concern. From #632 (comment):
I think this is not avoidable. The tests implemented now require at most 4 bytes. A test which requires a large size may be added in future. In this case the maintainer of targets may have to change the value of
What is the difference between the value of If we introduce the target property |
Imagine the read of
AFAIU, In any case -- If you don't feel like doing it, IMHO the patch can be accepted as-is. It is a great improvement. |
|
@en-sc, thank you for your feedback.
Both make sense to me. Now I understand. Give me some more days. |
9bf5a2f to
cba3b86
Compare
|
I have updated this PR. |
- set size considering the minimum PMP granularity supported by the hart. Signed-off-by: Hiroo HAYASHI <24754036+hirooih@users.noreply.github.com>
cba3b86 to
1860766
Compare
|
I've fixed a conflict. Thanks. |
This PR sets the NAPOT range size considering the minimum PMP granularity supported by the hart.
This PR is separate from #632 as suggested by @en-sc .
The issue this PR solves.
set_pmp_deny()is called by two tests,MemTestReadInvalid()andEtriggerTest(), with the argumentbad_address.sizeforset_pmp_deny()is 4 KB.MemTestReadInvalid()requires 4 bytes andEtriggerTest()requires 1 byte forsize, but they use the default value (4 KB).debug/targets/RISC-V/spike32.pyanddebug/targets/RISC-V/spike64.py:testlib.pyL1496pmpaddr0is set to0x100f_ffff >> 2(1MB NAPOT range starting 0x1000_0000).How this PR works
sizeofset_pmp_deny()now has no default value. The caller sets it to the value required by the test.sizeargument and the minimum supported PMP granularity.set_pmp_deny()raises aTestNotApplicableerror if the value of the argumentaddressis inconsistent with the calculated size. This error allows users to setbad_addressto a proper value.