-
Notifications
You must be signed in to change notification settings - Fork 1.5k
arm64: add protected mode support and SMP improvements #18101
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
base: master
Are you sure you want to change the base?
arm64: add protected mode support and SMP improvements #18101
Conversation
jerpelea
left a comment
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.
please split the PR in separate areas:
- MPU enhancements
- interface standardization
- Protected more support
2ec42a1 to
c69b747
Compare
done |
sorry for the misunderstanding |
|
c599f47 to
e681a92
Compare
Conditionally enable MMU-specific configuration checks (CONFIG_MM_PGALLOC, CONFIG_MM_PGSIZE, address base/size definitions) only when CONFIG_ARCH_USE_MMU is defined. This allows addrenv support in MPU-based systems that don't use MMU paging. Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
Add CONFIG_BUILD_PROTECTED support alongside CONFIG_BUILD_KERNEL for saved register pointers and task startup functions. Fix arm64_fork() to properly handle Thumb bit masking. Enable weak_function for up_allocate_kheap() to support board-specific heap allocation. Signed-off-by: hujun5 <hujun5@xiaomi.com>
e681a92 to
767fe90
Compare
a55ff3c to
f82c60e
Compare
Enable fvp_userspace.c compilation when CONFIG_BUILD_PROTECTED is enabled, providing user-space isolation support for FVP platform. Include board memory map definitions for protected build configuration and update MPU regions for kernel/user space separation. Signed-off-by: hujun5 <hujun5@xiaomi.com>
Replace CONFIG_ARM64_SMP_BUSY_WAIT_FLAG_ADDR with global variable g_smp_busy_wait_flag for SMP CPU synchronization. This improves flexibility over fixed memory addresses and aligns with standard kernel variable patterns for multi-core startup. Signed-off-by: hujun5 <hujun5@xiaomi.com>
f82c60e to
5d3dc7e
Compare
Summary
This PR series adds comprehensive protected mode (CONFIG_BUILD_PROTECTED) support to ARM64
architecture, particularly for FVP platform, along with significant improvements to SMP
initialization and address environment functionality. The changes enable full kernel/user-space
isolation, simplify multi-core CPU synchronization, and extend address environment support
to MPU-based systems.
Changes Made
1. SMP Initialization Improvements
Remove Fixed Memory Address Configuration:
CONFIG_ARM64_SMP_BUSY_WAIT_FLAG_ADDRwith global variableg_smp_busy_wait_flagBenefits:
2. FVP Protected Mode Build Support
Enable Protected Build Mode:
fvp_userspace.cwhenCONFIG_BUILD_PROTECTEDenabledfvp_v8r_allocateheap.c)Memory Map and Linker Scripts:
board_memorymap.hdefinitionsProtected Mode Configuration:
3. ARM64 Core Protected Mode Support
Extend Protected Build Infrastructure:
CONFIG_BUILD_PROTECTEDsupport alongsideCONFIG_BUILD_KERNELarm64_task_start.candarm64_pthread_start.cfor protected modeContext and Memory Management:
Build System Updates:
4. Address Environment Support for MPU-Based Systems
Enable Addrenv in MPU-Only Systems:
CONFIG_ARCH_USE_MMUguardCONFIG_MM_PGALLOCandCONFIG_MM_PGSIZEconditional on MMUBenefits:
Impact
SMP Improvements
Protected Mode Support
Address Environment
Code Quality
Testing
Test Environment
Test Procedure
SMP Initialization:
Protected Mode:
Address Environment:
Integration:
Test Results
✅ SMP synchronization operational without fixed addresses
✅ Protected mode isolation enforced
✅ Address environment supports MPU-based systems
✅ All configurations compile successfully
✅ No test suite regressions
✅ Backward compatibility maintained
Verification Checklist
Related Commits
ff4ac88811d- arm64: remove busy wait flag3905065eede- fvp-v8r: protect build supportd3c187322df- arm64: support protectbuild573bafbd880- addrenv: support addrenv when mpu is used