[1/3] aarch64: PCIe host-bridge (ECAM) transport - #92
Draft
maxandrews wants to merge 5 commits into
Draft
Conversation
…tures) CUDA_PASSTHROUGH Phase 1 step 0. QEMU-virt/Cloud-Hypervisor-compatible windows, clear of the GIC and virtio-MMIO bands, valid for both boot modes. ECAM 0x3000_0000 (1M), 32-bit MMIO 0x1000_0000 (512M), 64-bit MMIO 0x40_0000_0000 (256G). Foundation for the PCI transport + VFIO passthrough.
Phase 1 (steps 1-3 of CUDA_PASSTHROUGH_IMPL.md): a new src/devices/src/pci/ module ported from Cloud Hypervisor's pci crate, behind a new devices 'pci' feature (+ a 'vfio' feature that depends on it). Trimmed of CH's serde snapshot state, vm-migration hooks, live MsixConfig back-reference and vm-allocator BAR hooks; byteorder replaced with native from_le_bytes. aarch64 is ECAM-only so PciConfigIo is dropped, and PciConfigMmio is adapted to libkrun's BusDevice (no cross-vCPU Barrier return). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EqKBqYeUZbH9cmvs7G2qb7
…bus) - fdt/aarch64: emit a pci-host-ecam-generic node (ECAM reg + 32/64-bit ranges) under the 'pci' feature. - device_manager/mmio: register_pci() inserts PciConfigMmio at PCIE_ECAM_BASE. - builder: attach_pci_root() creates the PciBus (host bridge at 00:00.0) with a no-op DeviceRelocation and registers the ECAM window; called during aarch64 device setup. New StartMicrovmError::RegisterPciDevice. - Cargo: 'pci' and 'vfio' feature fan-out across libkrun/vmm/devices crates. Phase 1 (steps 1-3): guest should now enumerate an empty PCI bus. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EqKBqYeUZbH9cmvs7G2qb7
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EqKBqYeUZbH9cmvs7G2qb7
msb builds msb_krun (src/krun), not the libkrun cdylib crate, so the pci/vfio feature fan-out must exist here too. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EqKBqYeUZbH9cmvs7G2qb7
This was referenced Jul 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[1/3] aarch64: PCIe host-bridge (ECAM) transport
Introduces a feature-gated PCIe host bridge so an aarch64 libkrun guest can
enumerate a PCI Express bus. This is the foundation for VFIO device/GPU
passthrough, which lands in the two follow-up PRs of this stack.
What's in it
pcicrate — ECAM (memory-mapped config) only, sinceaarch64 has no port I/O — adapted to libkrun's
BusDevicemodel (which has nocross-vCPU
Barrierreturn):PciConfiguration,PciBus,PciConfigMmio(ECAM),
PciRoothost bridge, and thePciDevicetrait.fdt/aarch64.rs: emits apci-host-ecam-genericnode (ECAMreg+ 32/64-bitranges).00:00.0.pcicargo feature (fanned out tomsb_krun+vmm/devices), off bydefault — no change to existing builds.
Result: with
--features pci, the guest enumerates an initially-empty PCIe bus(host bridge at
0000:00:00.0, ECAM at the aperture defined inlayout.rs).Commits (5)
Testing
Builds green with the
pcifeature; guest boots and enumerates the empty bus.Stacked series (3 PRs, all against
krun, reviewed/merged in order)nvidia-smion a T4G)🤖 Generated with Claude Code