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
risc-v/mmu: Fix L3 mappings for kernel, and mpfs protected mode user space #7060
Conversation
@masayuki2009 I know you use the qemu-rv / rv-virt target, I cannot test / verify that because I don't have the environment set up. If it breaks can you please inform me and I'll fix it. |
7ff47d1
to
ca8c2fe
Compare
@pussuw |
Sounds good! |
@pussuw |
Excellent, thank you! |
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!
Just few minor comments
…pace The L3 mapping function was just way too simplistic. Depending on memory configuration it either works or not. Noticed that with icicle:pnsh the software crashes due to instruction page fault, reason is the map_region() implementation that does not work for regions that are not aligned to 2MB (the L2 page size). Implemented an extremely simplistic page table allocator for the L3 references, that should once and for all get rid of the L3 mapping issue. NOTE: gran_alloc() cannot be used at this point, it is too early for it.
ca8c2fe
to
3cc5a17
Compare
Summary
The L3 mapping function was just way too simplistic. Depending on memory configuration it either works or not.
Noticed that with icicle:pnsh the software crashes due to instruction page fault, reason is the map_region() implementation that does not work for regions that are not aligned to 2MB (the L2 page size).
Implemented an extremely simplistic page table allocator for the L3 references, that should once and for all get rid of the L3 mapping issue.
NOTE: gran_alloc() cannot be used at this point, it is too early for it.
Impact
Fixes full system crash if the kernel memory regions (or user memory regions in protected mode) are selected so that they
are not aligned to 2MB boundary.
Testing
icicle:pnsh / icicle:knsh