[libcpu][risc-v]处理mmu.c中_unmap_area函数的几处潜在风险或问题 #10107
Merged
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.
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
_unmap_area函数存在几处潜在风险或问题:
1._unmap_area 函数的size 参数未被使用。
经过分析代码,该函数每次解除映射的范围实际由页表层级自动决定(如 1GB/2MB/4KB),而非依赖 size 参数。该参数未被使用,容易造成对该函数使用方式的误解,建议删除该参数。
2._unmap_area函数中对无效页表项的情况未做处理,可能导致返回的unmapped值不正确。
你的解决方案是什么 (what is your solution)
请提供验证的bsp和config (provide the config and bsp)
BSP:
.config:
action:
]
当前拉取/合并请求的状态 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