-
Notifications
You must be signed in to change notification settings - Fork 235
Add callbacks and logging for page table walks #1370
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
base: master
Are you sure you want to change the base?
Conversation
af9de2e to
7350b4a
Compare
|
Looks pretty good. I think we probably don't want to convert things to strings though. Now that we use a generated header maybe we can use the actual generated types? |
arichardson
left a comment
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.
Adding these makes a lot of sense. A few comments
|
I think we need to take into meeting due to divergence from #1372 |
|
We will add an option |
It should be |
I really hate add a lot of options for trace. we should have some modern log system that support subscript. Go #1204 |
A little off topic - do we have a comparison table between C and sail and sail-riscv? like |
There are three options:
|
7350b4a to
cf57e24
Compare
f15e400 to
fec8817
Compare
Timmmm
left a comment
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.
Looks pretty good. It's a shame we don't get the full address in these callbacks, but maybe those should be separate callbacks (translation_start_callback etc.), in a future PR.
Fix riscv#1370 (comment) Signed-off-by: Ariel Xiong <[email protected]>
Fix riscv#1370 (comment) Signed-off-by: Ariel Xiong <[email protected]>
Fix riscv#1370 (comment) Signed-off-by: Ariel Xiong <[email protected]>
9d35949 to
c70fdd8
Compare
Fix riscv#1370 (comment) Signed-off-by: Ariel Xiong <[email protected]>
Fix riscv#1370 (comment) Signed-off-by: Ariel Xiong <[email protected]>
Fix riscv#1370 (comment) Fix riscv#1370 (comment) Fix riscv#1370 (comment) Co-authored-by: Nadime Barhoumi <[email protected]> Signed-off-by: Ariel Xiong <[email protected]>
1e79575 to
e2bafdd
Compare
fix riscv#1356 Signed-off-by: Ariel Xiong <[email protected]>
Signed-off-by: Ariel Xiong <[email protected]>
Signed-off-by: Ariel Xiong <[email protected]>
Fix riscv#1370 (comment) Signed-off-by: Ariel Xiong <[email protected]>
Signed-off-by: Ariel Xiong <[email protected]>
Signed-off-by: Ariel Xiong <[email protected]>
Fix riscv#1370 (comment) Fix riscv#1370 (comment) Fix riscv#1370 (comment) Co-authored-by: Nadime Barhoumi <[email protected]> Signed-off-by: Ariel Xiong <[email protected]>
e2bafdd to
860aa4c
Compare
Signed-off-by: Ariel Xiong <[email protected]>
Timmmm
left a comment
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.
LGTM, thanks for this!
arichardson
left a comment
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.
Should we print the level as well? Otherwise LGTM.
Co-authored-by: Jordan Carlin <[email protected]> Signed-off-by: Ariel Xiong <[email protected]>
Signed-off-by: Ariel Xiong <[email protected]>
| val ptw_start_callback = pure {c: "ptw_start_callback"} : (/* vpn */ bits(64), /* access type */ MemoryAccessType(ext_access_type), /* privilege */ Privilege) -> unit | ||
| function ptw_start_callback(_) = () | ||
|
|
||
| val ptw_step_callback = pure {c: "ptw_step_callback"} : (/* level */ int, /* pte_addr */ physaddrbits, /* pte */ bits(64)) -> unit | ||
| function ptw_step_callback(_) = () | ||
|
|
||
| val ptw_success_callback = pure {c: "ptw_success_callback"} : (/* final_ppn */ bits(64), /* level */ int) -> unit | ||
| function ptw_success_callback(_) = () | ||
|
|
||
| val ptw_fail_callback = pure {c: "ptw_fail_callback"} : (/* error_type */ PTW_Error, /* level */ int, /* pte_addr */ physaddrbits) -> unit | ||
| function ptw_fail_callback(_) = () |
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.
Instead of using int for level, couldnt this be a range(0, 4)? If so, would that be a different type than sail_int, allowing you to keep fprintf instead of switching to gmp_fprintf? Anyway, this is probably a minor detail and not really important.
| val ptw_start_callback = pure {c: "ptw_start_callback"} : (/* vpn */ bits(64), /* access type */ MemoryAccessType(ext_access_type), /* privilege */ Privilege) -> unit | |
| function ptw_start_callback(_) = () | |
| val ptw_step_callback = pure {c: "ptw_step_callback"} : (/* level */ int, /* pte_addr */ physaddrbits, /* pte */ bits(64)) -> unit | |
| function ptw_step_callback(_) = () | |
| val ptw_success_callback = pure {c: "ptw_success_callback"} : (/* final_ppn */ bits(64), /* level */ int) -> unit | |
| function ptw_success_callback(_) = () | |
| val ptw_fail_callback = pure {c: "ptw_fail_callback"} : (/* error_type */ PTW_Error, /* level */ int, /* pte_addr */ physaddrbits) -> unit | |
| function ptw_fail_callback(_) = () | |
| val ptw_start_callback = pure {c: "ptw_start_callback"} : (/* vpn */ bits(64), /* access type */ MemoryAccessType(ext_access_type), /* privilege */ Privilege) -> unit | |
| function ptw_start_callback(_) = () | |
| val ptw_step_callback = pure {c: "ptw_step_callback"} : (/* level */ int, /* pte_addr */ physaddrbits, /* pte */ bits(64)) -> unit | |
| function ptw_step_callback(_) = () | |
| val ptw_success_callback = pure {c: "ptw_success_callback"} : (/* final_ppn */ bits(64), /* level */ int) -> unit | |
| function ptw_success_callback(_) = () | |
| val ptw_fail_callback = pure {c: "ptw_fail_callback"} : (/* error_type */ PTW_Error, /* level */ range(0, 4), /* pte_addr */ physaddrbits) -> unit | |
| function ptw_fail_callback(_) = () |
|
Using |
Add callbacks for each step of the page table walk process, and an option to log them.
Fixes #1356