Skip to content

Conversation

@mattkur
Copy link
Contributor

@mattkur mattkur commented Nov 22, 2025

DO NOT MERGE, TESTING IN PROGRESS

Experiment: ask the kernel to online any CPUs that will immediately get interrupts mapped, and ask sidecar
to online the rest.

…hcl_boot set that state for VPs that have mapped interrupts
@mattkur mattkur requested a review from a team as a code owner November 22, 2025 00:15
@mattkur mattkur requested review from a team, chris-oo, Copilot and jstarks and removed request for Copilot November 22, 2025 00:15
@github-actions github-actions bot added the unsafe Related to unsafe code label Nov 22, 2025
@github-actions
Copy link

⚠️ Unsafe Code Detected

This PR modifies files containing unsafe Rust code. Extra scrutiny is required during review.

For more on why we check whole files, instead of just diffs, check out the Rustonomicon

Copilot AI review requested due to automatic review settings November 22, 2025 00:22
Copilot finished reviewing on behalf of mattkur November 22, 2025 00:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a mechanism for openhcl_boot to specify per-CPU startup state, allowing it to control which CPUs are started by the sidecar kernel versus the main kernel. This optimization enables CPUs with mapped interrupts to be started immediately by the main kernel, avoiding unnecessary transitions.

Key changes:

  • Adds PerCpuState structure to track which CPUs should be started by sidecar
  • Updates sidecar initialization to respect per-CPU state overrides when specified
  • Modifies the boot process to identify CPUs with mapped interrupts and keep them in the main kernel

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
openhcl/sidecar_defs/src/lib.rs Defines PerCpuState structure and adds it to SidecarParams
openhcl/sidecar/src/arch/x86_64/init.rs Updates sidecar init to apply per-CPU state overrides to cpu_status array
openhcl/openhcl_boot/src/sidecar.rs Modifies sidecar startup and kernel command line generation to use per-CPU state
openhcl/openhcl_boot/src/main.rs Initializes sidecar_cpu_overrides in test code
openhcl/openhcl_boot/src/host_params/mod.rs Adds sidecar_cpu_overrides field to PartitionInfo
openhcl/openhcl_boot/src/host_params/dt/mod.rs Identifies CPUs with mapped interrupts and configures them to stay in main kernel

@github-actions
Copy link

@github-actions
Copy link

@github-actions
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

unsafe Related to unsafe code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant