Skip to content

Introduce Kernel Partitioning#261

Open
etiaro wants to merge 1 commit into
etiaro/partitioning-featuresfrom
etiaro/partitioning
Open

Introduce Kernel Partitioning#261
etiaro wants to merge 1 commit into
etiaro/partitioning-featuresfrom
etiaro/partitioning

Conversation

@etiaro

@etiaro etiaro commented Mar 6, 2026

Copy link
Copy Markdown

Description

Add optional partition name argument to PloCmdApp in image builder script

Motivation and Context

Build system adjustments for partitioning support.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (refactoring, style fixes, git/CI config, submodule management, no code logic changes)

How Has This Been Tested?

  • Already covered by automatic testing.
  • New test added: (add PR link here).
  • Tested by hand on: (list targets here).

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing linter checks and tests passed.
  • My changes generate no new compilation warnings for any of the targets.

Special treatment

  • This PR needs additional PRs to work (list the PRs, preferably in merge-order).
  • I will merge this PR by myself when appropriate.

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello, 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 foundational changes to support kernel partitioning. It modifies the build system to allow specifying a target partition for applications and adjusts the kernel's memory layout by updating linker flags for the BSS and data segments. These changes are crucial for enabling more granular memory management and isolation within the kernel environment.

Highlights

  • Kernel Partitioning Support: The PloCmdApp class in scripts/image_builder.py has been extended to support an optional partition name argument, allowing applications to be associated with specific kernel partitions.
  • Kernel Memory Layout Adjustment: The linker flags (LDFLAGS) for kernel builds in target/armv8r.mk have been updated, specifically modifying the base addresses for the BSS and data segments, likely to accommodate new memory partitioning schemes.
Changelog
  • scripts/image_builder.py
    • Updated the docstring for PloCmdApp to reflect the new optional [partition name] argument.
    • Added a new partition field to the PloCmdApp dataclass to store the target partition name.
    • Modified the emit method to include the self.partition value when generating the command string for PloCmdApp.
  • target/armv8r.mk
    • Adjusted the LDFLAGS for kernel builds, specifically changing the -Tbss and -Tdata addresses from 10014000 to 10014900.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces changes to support kernel partitioning. However, a security audit identified two high-severity vulnerabilities in scripts/image_builder.py: a Server-Side Template Injection (SSTI) due to insecure Jinja2 usage and a Path Traversal vulnerability in the file resolution logic. These issues could allow an attacker to leak sensitive information or execute arbitrary code if the tool is used with untrusted configuration scripts. It is recommended to restrict environment variables exposed to templates and properly sanitize file paths. Additionally, I've suggested improvements to the command string construction in image_builder.py to prevent formatting issues and recommended adding comments to explain new hardcoded addresses in target/armv8r.mk for better maintainability.

Comment thread scripts/image_builder.py
Comment thread scripts/image_builder.py
Comment thread scripts/image_builder.py
Comment thread target/armv8r.mk Outdated
@github-actions

github-actions Bot commented Mar 6, 2026

Copy link
Copy Markdown

Unit Test Results

10 860 tests   10 190 ✅  54m 50s ⏱️
   670 suites     670 💤
     1 files         0 ❌

Results for commit 0ba4415.

♻️ This comment has been updated with latest results.

@etiaro
etiaro marked this pull request as ready for review March 9, 2026 11:19
@etiaro
etiaro requested review from Darchiv and adamgreloch March 9, 2026 11:20
@etiaro
etiaro force-pushed the etiaro/partitioning branch from 93e1dda to 16e6f28 Compare March 24, 2026 11:24
@etiaro

This comment was marked as outdated.

@etiaro
etiaro force-pushed the etiaro/partitioning branch from 16e6f28 to cce2a19 Compare April 1, 2026 14:33
@etiaro
etiaro force-pushed the etiaro/partitioning branch from cce2a19 to 55cd9a8 Compare April 23, 2026 14:09
@etiaro
etiaro changed the base branch from feature/partitioning to master April 23, 2026 14:22
@etiaro etiaro closed this Apr 24, 2026
@etiaro etiaro reopened this Apr 24, 2026
@etiaro
etiaro changed the base branch from master to etiaro/partitioning-features April 30, 2026 10:38
@etiaro
etiaro force-pushed the etiaro/partitioning branch from 55cd9a8 to 771e9eb Compare April 30, 2026 10:40
@etiaro
etiaro force-pushed the etiaro/partitioning-features branch from bc47b36 to eca6515 Compare May 26, 2026 15:45
@etiaro
etiaro force-pushed the etiaro/partitioning branch from 9e4528d to 625f140 Compare May 26, 2026 15:47
@etiaro
etiaro force-pushed the etiaro/partitioning-features branch from eca6515 to 21deb07 Compare June 11, 2026 09:43
@etiaro
etiaro force-pushed the etiaro/partitioning branch from 625f140 to 0ba4415 Compare June 11, 2026 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant