Skip to content

Conversation

@jserv
Copy link
Collaborator

@jserv jserv commented Oct 24, 2025

This fixes issue where DTB CPU count was inconsistent with runtime hart count, causing kernel to detect fewer CPUs than specified with '-c' parameter.

The build system now ensures DTB matches SMP parameter automatically, eliminating the need for manual "make SMP=X riscv-harts.dtsi minimal.dtb".


Summary by cubic

Automates DTB regeneration when SMP changes so the DTB CPU count matches the requested hart count. Prevents the kernel from seeing fewer CPUs than the -c parameter and removes the need for manual DTB rebuilds.

  • New Features
    • Added .smp_stamp to track SMP and force rebuild of riscv-harts.dtsi and minimal.dtb when SMP changes.
    • Added scripts/verify-dtb.sh to check DTB CPU count against an expected value (skips if dtc is not available).
    • Updated distclean to remove .smp_stamp.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 2 files

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="scripts/verify-dtb.sh">

<violation number="1" location="scripts/verify-dtb.sh:21">
The `verify-dtb.sh` script silently skips verification if the `dtc` tool is not found, exiting with code 0 (success). This would cause a build system to incorrectly report a successful verification, masking potential toolchain issues.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

This fixes issue where DTB CPU count was inconsistent with runtime hart
count, causing kernel to detect fewer CPUs than specified with '-c'
parameter.

The build system now ensures DTB matches SMP parameter automatically,
eliminating the need for manual "make SMP=X riscv-harts.dtsi minimal.dtb".
@jserv jserv merged commit 00cc4ed into master Oct 24, 2025
10 checks passed
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.

2 participants