arm64: add protected mode support and SMP improvements#18101
Merged
GUIDINGLI merged 4 commits intoapache:masterfrom Jan 26, 2026
Merged
arm64: add protected mode support and SMP improvements#18101GUIDINGLI merged 4 commits intoapache:masterfrom
GUIDINGLI merged 4 commits intoapache:masterfrom
Conversation
jerpelea
requested changes
Jan 22, 2026
Contributor
jerpelea
left a comment
There was a problem hiding this comment.
please split the PR in separate areas:
- MPU enhancements
- interface standardization
- Protected more support
2ec42a1 to
c69b747
Compare
Contributor
Author
done |
Contributor
sorry for the misunderstanding |
Contributor
Author
|
c599f47 to
e681a92
Compare
jerpelea
previously approved these changes
Jan 23, 2026
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>
f82c60e to
5d3dc7e
Compare
5d3dc7e to
4306a65
Compare
xiaoxiang781216
approved these changes
Jan 25, 2026
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>
4306a65 to
5b9dca4
Compare
xiaoxiang781216
approved these changes
Jan 26, 2026
GUIDINGLI
approved these changes
Jan 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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