Skip to content

kerf: preserve PCI host bridge metadata - #11

Draft
nickolaev wants to merge 2 commits into
multikernel:mainfrom
nickolaev:sriov-vf-assignment
Draft

kerf: preserve PCI host bridge metadata#11
nickolaev wants to merge 2 commits into
multikernel:mainfrom
nickolaev:sriov-vf-assignment

Conversation

@nickolaev

@nickolaev nickolaev commented Jul 22, 2026

Copy link
Copy Markdown

Kerf must preserve PCI host-bridge information when parsing and generating Multikernel device trees. A spawned kernel
needs the PCI segment, bus range, and ECAM base to discover and access its assigned SR-IOV VF.

This change:

  • adds PCI host bridges to Kerf’s hardware model;
  • parses and emits the metadata in DTB and DTS formats;
  • validates segments, bus ranges, ECAM alignment, and overlaps;
  • supports explicit 64-bit physical CPU IDs in DTS input; and
  • remains compatible with device trees without PCI host-bridge metadata.

This complements the Linux SR-IOV assignment work in multikernel/linux#4.

@nickolaev
nickolaev force-pushed the sriov-vf-assignment branch 2 times, most recently from 2a44f01 to d98d1e8 Compare July 30, 2026 16:41
Kerf rebuilds an instance device tree from the parsed baseline.
Dropping pci-host-bridges during that round trip leaves the spawned
kernel without the immutable ECAM descriptors required to construct
its synthetic PCI roots.

Add a PCI host-bridge model, parse it from binary and source device
trees, validate segment and bus ranges, ECAM alignment, and overlap,
and emit the metadata into generated instance trees. Cover valid round
trips and malformed descriptors in the baseline tests.

Signed-off-by: Nikolay Nikolaev <nicknickolaev@gmail.com>
The device-tree compiler can render CPU lists with an explicit /bits/ width and hexadecimal cells. Treating that syntax as plain decimal values makes Kerf reject valid extracted instance trees.\n\nAccept the 32-bit and 64-bit forms, parse each cell with base detection, and limit the lookup to direct /resources properties so nested NUMA CPU lists cannot shadow the global inventory. Cover the legacy and explicit-width forms in the parser tests.\n\nSigned-off-by: Nikolay Nikolaev <nicknickolaev@gmail.com>
@nickolaev
nickolaev force-pushed the sriov-vf-assignment branch from d98d1e8 to 5104ec1 Compare July 30, 2026 22:05
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