Skip to content

kerf: parse explicit-width CPU cells in DTS inputs - #11

Draft
nickolaev wants to merge 1 commit into
multikernel:mainfrom
nickolaev:sriov-vf-assignment
Draft

kerf: parse explicit-width CPU cells in DTS inputs#11
nickolaev wants to merge 1 commit into
multikernel:mainfrom
nickolaev:sriov-vf-assignment

Conversation

@nickolaev

@nickolaev nickolaev commented Jul 22, 2026

Copy link
Copy Markdown

Summary

  • Accept legacy, decimal, hexadecimal, /bits/ 32, and /bits/ 64 CPU-cell declarations in DTS inputs.
  • Apply the same parser to root resources, instance resources, NUMA-node membership, and core topology.
  • Parse nested topology sections with brace matching and ignore DTS comments inside cell lists.
  • Keep the change focused to one compatibility commit on current multikernel/kerf main.

Validation

  • 268 tests passed, 1 skipped.
  • Pylint 10.00/10.
  • The compatibility patch passed the full multikernel SR-IOV QEMU lifecycle on the ARM64 host; the final upstream rebase only removes hand-written example files.

@nickolaev
nickolaev force-pushed the sriov-vf-assignment branch 3 times, most recently from d98d1e8 to 5104ec1 Compare July 30, 2026 22:05
@nickolaev
nickolaev force-pushed the sriov-vf-assignment branch from 5104ec1 to 29e4f71 Compare August 11, 2026 17:49
@nickolaev nickolaev changed the title kerf: preserve PCI host bridge metadata kerf: preserve NUMA topology and explicit-width CPU cells Aug 11, 2026
@congwang-mk

congwang-mk commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Sorry for being late. This PR was for SR-IOV, hence I was waiting for the kernel part to settle down before reviewing this, as the interface could be changed during the review.

But now since you changed it to CPU topology, it is coincidentally same with #12 . Please let me know what's your preference to move forward, I am happy to drop mine since it is not complete either. @nickolaev If you prefer to move forward with this one, please at least do a rebase.

By the way: the memory allocation policy must be global, so can't be specified during every kerf create, it has to be in kerf init and saved in the root device_tree file (ignored by kernel). I made the same mistake during design.

@nickolaev
nickolaev force-pushed the sriov-vf-assignment branch 2 times, most recently from 04cdf78 to 6008a70 Compare August 23, 2026 18:41
@nickolaev nickolaev changed the title kerf: preserve NUMA topology and explicit-width CPU cells kerf: parse explicit-width CPU cells in DTS inputs Aug 23, 2026
The harness emits CPU lists in DTS source as explicit-width device-tree cells, for example cpus = /bits/ 64 <2 3 4>. The source parser only accepted the legacy unqualified <...> form, so valid harness baselines failed before reaching DTB parsing.

Accept 32-bit and 64-bit explicit-width forms for the top-level /resources cpus property, and parse decimal or hexadecimal cell values with base detection.

Signed-off-by: Nikolay Nikolaev <nicknickolaev@gmail.com>
@nickolaev
nickolaev force-pushed the sriov-vf-assignment branch from 6008a70 to e209112 Compare August 23, 2026 18:45
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