Introduce Kernel Partitioning#419
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a fundamental change to the kernel's memory and resource management by implementing kernel partitioning. This new capability allows for the creation of isolated execution environments, enhancing system robustness and security by strictly controlling memory access and scheduling for different applications. The changes include new commands for partition and scheduler window management, alongside significant updates to the underlying HAL and syspage structures to support this new architecture. Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces kernel partitioning, a significant architectural change, adding new commands part and sched and updating the app command. The MPU handling is refactored to be per-partition. A high-severity out-of-bounds write vulnerability was identified in the MPU HAL implementations for ARMv7-M and ARMv7-R, where hardware-reported region counts are trusted without validation against software buffer sizes. Furthermore, logic errors in the part command's argument parsing prevent it from functioning correctly when flags are used, and there are minor issues related to documentation and code clarity.
Unit Test Results10 860 tests 10 190 ✅ 55m 15s ⏱️ Results for commit 0d6f077. ♻️ This comment has been updated with latest results. |
95269e1 to
3fbe3eb
Compare
3fbe3eb to
6a769f0
Compare
d1e0621 to
f7f21ab
Compare
|
Please rebase this PR. |
|
Rebasing with feature/ branch (and all other breaking submodules) |
f7f21ab to
87c78f2
Compare
87c78f2 to
d7f23a9
Compare
|
Changed base branch to avoid problems with branch protection while rebasing and CI errors spam. At the same time, changed the implementation from by default creating partition-per-app to single default partition, as it seems like a cleaner for the future features. Introduced Per-CPU scheduler configuration for improved elasticity Removed NOMMU multimap allocation, as it was only partially implemented and broke with the new conception of default partition. Will be introduced in the future together with MMU NUMA support. |
d7f23a9 to
f9be6a4
Compare
f9be6a4 to
9e4bc7e
Compare
3c8139e to
9898ad4
Compare
a0ca972 to
f148345
Compare
This commit introduces loader support for full MPU regions reconfiguration on context switch, allowing for more flexibile configuration of memory maps on MPU targets. Changes include * MPU configuration during app command, based on hal_syspage_prog_t structure with program configuration of MPU regions in form of ready-to-copy register values * reimplementation of mpu command, showing generated mpu configuration on per-app basis * passing all maps at once to hal/mpu module, allowing future map merging to reduce count of used MPU regions JIRA: RTOS-1149
9898ad4 to
582b01f
Compare
f148345 to
d420520
Compare
Introduce configuration commands for spatial and temporal partitioning. JIRA: RTOS-1149
d420520 to
963e2d3
Compare
|
For some reason PLO grows >10kB on sparc target. Seems suspicious, as e.g. 7a9dc97 only introduces new functions while reducing this binary size back to reasonable values. EDIT: for now just increased kernel offset in sparc config |
JIRA: RTOS-1285
963e2d3 to
0d6f077
Compare
Description
Add loader-side support for kernel partitioning.
Key changes:
partcommand for creating partitions with configurable memory maps (allocable and accessible) and flags (e.g. IPC permission)schedcommand for scheduler temporal windows configurationmpucommand to show per-app MPU configurationsyspage_part_tappcommandbackward-compatible default partition is created by each app without partition specified.
Motivation and Context
This is the companion change to the kernel partitioning support. Currently system configuration mechanisms are based on plo-scripts, so partitioning configuration follows that convetion.
Types of changes
How Has This Been Tested?
Checklist:
Special treatment