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.
Since sedna only supports Sv39 and Sv48 paging modes,
writeCSR
checks writes tosatp
to make sure one of those modes has been selected, else the write is ignored. However, we need to also allow returning to bare mode (i.e. no address translation). This patch adds SATP_MODE_NONE to the allowed modes.When the kernel added support for sv48 in 5.17, it added autodetection of which paging modes the CPU supports. This works by temporarily changing to sv48 mode, checking satp to see if it changed, and then setting satp back to 0 (bare). This last step breaks before this patch and crashes the kernel. After this patch, I can boot a 6.6 kernel successfully.
https://github.com/torvalds/linux/blob/f443e374ae131c168a065ea1748feac6b2e76613/arch/riscv/mm/init.c#L585
Fixes #18