Repository navigation
[libcpu][riscv] fix MMU and user fault handling for Smart - #11892
BernardXiong wants to merge 2 commits into
Conversation
- add XuanTie architecture selection and the SVPBMT option - translate early page table pointers with the kernel physical offset - allow the MPR range to extend below the linked kernel base - clean early page tables and clear user entries for each hart - terminate only the current LWP on unhandled user faults - keep interrupts enabled while reporting user context
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
📌 Code Review Assignment🏷️ Tag: libcpu_riscvReviewers: @Yaochenger Changed Files (Click to expand)
📊 Current Review Status (Last Updated: 2026-10-18 21:59 CST)
📝 Review Instructions
|
- add a forward declaration for the user fault register dump - fix the implicit declaration error on RISC-V builds
| int start_idx = USER_VADDR_START >> VPN2_SHIFT; | ||
| int end_idx = USER_VADDR_TOP >> VPN2_SHIFT; | ||
| for (i = start_idx; i <= end_idx; i++) | ||
| { | ||
| mmu_table[i] = 0; |
There was a problem hiding this comment.
熊老师好呀!这段清零好像只在非 SMP 分支,SMP 下每个 hart 的 table 是不是也要清一下?另外 common 用的是 USER_VADDR_TOP - 1,这里是 TOP,不知道是不是有意的?如有误解请指正,谢谢!
| sys_exit_group(-1); | ||
| csr_write(CSR_STATUS, saved_stat); |
There was a problem hiding this comment.
熊老师好呀!sys_exit_group(-1) 后面的 csr_write 按理走不到,IE 会一直开着。是不是先恢复再调更稳?如有误解请指正,谢谢!
|
拉取/合并请求描述:(PR description)
为什么提交这份PR (why to submit this PR)
Several RISC-V Smart issues prevented reliable user space operation: early page table pointers were not translated with the kernel physical offset, per-hart page tables inherited user mappings, early page tables were not flushed, and unhandled user faults could terminate the kernel instead of the current process.
你的解决方案是什么 (what is your solution)
请提供验证的bsp和config (provide the config and bsp)
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up