fix(PTW): Fix exception handle logic when both pf and af occur#4422
Merged
good-circle merged 1 commit intomasterfrom Mar 23, 2025
Merged
fix(PTW): Fix exception handle logic when both pf and af occur#4422good-circle merged 1 commit intomasterfrom
good-circle merged 1 commit intomasterfrom
Conversation
Contributor
Author
|
Please do not merge now |
|
[Generated by IPC robot]
master branch:
|
…ult occur In the previous design, every time a page table entry was fetched from memory, a PMP check was performed on the physical address of the next-level page table. However, for cases requiring Stage-2 address translation or when a page fault occurs during the page table fetch, a PMP check is unnecessary. Performing a PMP check in these cases could lead to false access fault reports. This commit fixes the issue. Future work: The current exception handling logic is messy and unsustainable. A complete refactor of this code is needed in the future, rather than continuing to add patches.
Contributor
Author
|
Already tested kvm on simulator and can be merged now |
cebarobot
approved these changes
Mar 21, 2025
Member
cebarobot
left a comment
There was a problem hiding this comment.
Future work: The current exception handling logic is messy and unsustainable. A complete refactor of this code is needed in the future, rather than continuing to add patches.
I totally agree with this.
|
[Generated by IPC robot]
master branch:
|
good-circle
added a commit
that referenced
this pull request
Apr 8, 2025
In #4422, For the virtualized allStage scenario, we attempt to suppress PMP checks until the G-stage translation result is returned. However, the approach used in #4422 is to try ignoring the `accessFault` result when `io.hptw.req.valid` is asserted. In reality, the `accessFault` signal remains valid because it is implemented as a `RegEnable`. Therefore, we need to prevent `sent_to_pmp` from being asserted when sending the G-stage translation request to HPTW. To address this, we introduce the `vs_finish` signal. When `vs_finish` is `true.B`, `sent_to_pmp` will be false, thus avoiding false `accessFault` reports.
linjuanZ
pushed a commit
that referenced
this pull request
Apr 9, 2025
In #4422, For the virtualized allStage scenario, we attempt to suppress PMP checks until the G-stage translation result is returned. However, the approach used in #4422 is to try ignoring the `accessFault` result when `io.hptw.req.valid` is asserted. In reality, the `accessFault` signal remains valid because it is implemented as a `RegEnable`. Therefore, we need to prevent `sent_to_pmp` from being asserted when sending the G-stage translation request to HPTW. To address this, we introduce the `vs_finish` signal. When `vs_finish` is `true.B`, `sent_to_pmp` will be false, thus avoiding false `accessFault` reports.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the previous design, every time a page table entry was fetched from memory, a PMP check was performed on the physical address of the next-level page table. However, for cases requiring Stage-2 address translation or when a page fault occurs during the page table fetch, a PMP check is unnecessary. Performing a PMP check in these cases could lead to false access fault reports. This commit fixes the issue.
Future work: The current exception handling logic is messy and unsustainable. A complete refactor of this code is needed in the future, rather than continuing to add patches.