hal/pmap: unify pmap_isAllowed implementation#799
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the pmap_isAllowed function across ARMv7-M, ARMv7-R, and ARMv8-M architectures to handle potential arithmetic overflows when validating memory ranges. The review comments correctly identify a critical issue where if map->end is 0U (representing the top of memory), the check addr_end > map->end will incorrectly evaluate to true for any non-zero addr_end, leading to false negatives. The reviewer provides code suggestions to only perform this check when map->end is not 0U.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
TASK: RTOS-1365
3af28f5 to
9d173c0
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates the pmap_isAllowed function across the armv7m, armv7r, and armv8m architectures to improve arithmetic overflow checks and boundary handling when validating memory regions. Specifically, it ensures that addr_end is allowed to be 0 (representing the top of memory) and correctly checks if the address range exceeds the map's end. Additionally, the resolution of the memory map is now deferred until after checking if the MPU is enabled in the armv7r and armv8m implementations. There are no review comments, so no further feedback is provided.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Description
Following the function signature, ensure that whole region is allowed according to given pmap structure on all MPU-enabled targets.
Introduce edge-case check when region overflows to 0 but map is not aligned to the end of address space
Motivation and Context
Ongoing work on simple improvements to syscall safety.
Types of changes
How Has This Been Tested?
Checklist:
Special treatment