jingfei195887 opened a new pull request, #22498:
URL: https://github.com/apache/nuttx/pull/22498

   ## Summary
   
   Use the existing RAM copy path for writable MAP_PRIVATE mappings when the 
backing file offers BIOC_XIPBASE. Shared and read-only mappings retain the 
direct XIP path. Driver-specific mmap callbacks are unchanged.
   
   ## Impact
   
   - Functionality: writable private fallback mappings have independent data 
and preserve the backing file contents.
   - Compatibility: descriptor permission checks, shared mappings, read-only 
private mappings, file references, and cleanup retain their existing handling. 
No public API, configuration, build integration, or hardware change.
   - Size: identical small sim configurations with rammap retained by a minimal 
mapping consumer have text/data/bss deltas of 16/0/0 bytes. The baseline size 
is reused from the earlier 0c45a2fc48b9 / apps c621be657e measurement, with 
unchanged consumer source.
   
   ## Testing
   
   I confirm that changes are verified on local setup and work as intended:
   
   - Linux x86_64, GCC 13.1.0; runtime sim:nsh with CONFIG_FS_RAMMAP and 
assertions. All runtime comparisons use nuttx-apps c621be657e.
   - A bounded local XIP driver covers public and internal mapping APIs, 
O_RDONLY/O_RDWR, MAP_SHARED/MAP_PRIVATE, and read-only/read-write mapping 
protections. Checks cover private data independence, shared data, 
direct/read-copy paths, permission rejection, file position, mapping counts, 
and close-before-unmap reference cleanup.
   
   Testing logs before change (0c45a2fc48b9):
   ```text
   XIPPRIVATE RESULT checks=216 failures=12
   ```
   
   Testing logs after change (043d057cb920):
   ```text
   default: XIPPRIVATE RESULT checks=216 failures=0
   large-file/512 KiB FS heap: XIPPRIVATE RESULT checks=216 failures=0
   ```
   
   Make/CMake, OSTest, full-file/commit checkpatch, and tested-HEAD gate pass. 
CONFIG_FS_RAMMAP-enabled protected qemu-armv7r:pnsh and kernel qemu-armv8a:knsh 
builds pass.
   
   No physical XIP hardware, protected/kernel runtime, SMP stress, or 
allocator-failure injection was tested.
   
   ## PR verification Self-Check
   
   - [x] This PR introduces only one functional change.
   - [x] I have updated all required description fields above.
   - [x] The commit has a component prefix, explanatory body, and my 
Signed-off-by; code style checks pass.
   - [ ] My PR is still work in progress (not ready for review).
   - [x] My PR is ready for review.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to