-
Notifications
You must be signed in to change notification settings - Fork 457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set PMP to create invalid address #535
base: master
Are you sure you want to change the base?
Conversation
debug/testlib.py
Outdated
|
||
def reset_pmp_deny(self): | ||
try: | ||
import math |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you really need this import here?
debug/testlib.py
Outdated
self.gdb.p("$pmpcfg0=0x98") # L, NAPOT, !R, !W, !X | ||
self.gdb.p("$pmpaddr0=" | ||
f"0x{((address >> 2) | ((size - 1) >> 3)):x}") | ||
self.gdb.command("monitor riscv exec_progbuf 0x12000073") # 0x12000073 is sfence.vma |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would double-check if we need to flush register cache after modification of pmp* stuff
self.gdb.command("monitor riscv exec_progbuf 0x12000073") # 0x12000073 is sfence.vma | ||
except CouldNotFetch: | ||
# PMP registers are optional | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- can you add some indication in the log that an attempt resulted in a some kind of exception?
- do you really need this
try
block since you've introduced thissupport_set_pmp_deny
property for the target?
Signed-off-by: liangzhen <[email protected]> Change-Id: I707281626521d321aadb6cee5aea457fc5c0424d
Some hardware has full address coverage, so set PMP to create invalid address
Change-Id: I707281626521d321aadb6cee5aea457fc5c0424d