-
Notifications
You must be signed in to change notification settings - Fork 479
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add sfence.vma in the disable_pmp function #537
Conversation
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.
SFENCE.VMA is illegal on implementations without S-mode. I think this should be conditionalized.
PMP changes require an SFENCE.VMA on any hart that implements page-based virtual memory, even if VM is not currently enabled. If the implementation without S-mode, does this mean that PMP registers are optional? |
As you said, "any hart that implements page-based virtual memory" needs to execute SFENCE.VMA. If S-mode is not implemented, then the hart doesn't implement page-based virtual memory. So there's no contradiction here. But I did misspeak earlier. It is true that SFENCE.VMA is illegal on implementations without S-mode. But it is also illegal on implementations with S-mode but without virtual memory. So, it needs to be conditionalized on "is S-mode implemented" and "is page-based virtual memory implemented". You can determine the latter property by checking whether But note that writing |
c105f73
to
4407a9c
Compare
Thank you for your explanation,I've introduced an implements_page_virtual_memory property for the target. But, There is a pipeline failure in Build Spike. |
I think we need to do something similar to the following. Can you give it a try and see if you can make it work? https://github.com/riscv-software-src/riscv-isa-sim/pull/1584/files |
Yes, It works now. |
4407a9c
to
31ba20b
Compare
@aswaterman Would you kindly review and merge it. |
Change-Id: Ief659c0e68618f5b08a1eee98bc7df92817b8b51