Visitar URL original
vmm: Select a BAR's MMIO allocator by the device's PCI segment by yamahata · Pull Request #9026 · cloud-hypervisor/cloud-hypervisor · GitHub
Skip to content

vmm: Select a BAR's MMIO allocator by the device's PCI segment - #9026

Merged
rbradford merged 1 commit into
cloud-hypervisor:mainfrom
yamahata:iyamahata/202610/pci-segment-id
Oct 9, 2026
Merged

rbradford merged 1 commit into
cloud-hypervisor:mainfrom
yamahata:iyamahata/202610/pci-segment-id

Conversation

@yamahata

@yamahata yamahata commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

This is a clean up I've had locally for PCI BAR move issue. I think it is also good for #8931 . So I push this one first.

The allocators are indexed by PCI segment, and the device's PCI segment is recorded in its device-tree node, so look it up there and index the allocator directly. Finds the MMIO allocator by pci segment_id insteawd of BAR base address.

Comment thread vmm/src/device_manager.rs Outdated
@yamahata
yamahata force-pushed the iyamahata/202610/pci-segment-id branch from 48b4ae8 to 351d95c Compare October 7, 2026 17:48
Comment thread vmm/src/device_manager.rs Outdated
pci_dev: &mut dyn PciDevice,
region_type: PciBarRegionType,
) -> result::Result<(), io::Error> {
let segment = self.pci_segment_of(pci_dev)?;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we really need this method if it's called just once?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure, remove this and open code it.

Comment thread vmm/src/device_manager.rs Outdated
@yamahata
yamahata force-pushed the iyamahata/202610/pci-segment-id branch from 351d95c to 1d7925d Compare October 8, 2026 17:01

@likebreath likebreath left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Changes are good, but will need a rebase once #9033 is landed.

The MMIO allocators are indexed by PCI segment. Index them with the
segment of the PCI device's BDF instead of searching for the allocator
whose range contains the old BAR base address.

Signed-off-by: Isaku Yamahata <iyamahata@crusoe.ai>
Assisted-by: Claude:Opus-5.5
@yamahata
yamahata force-pushed the iyamahata/202610/pci-segment-id branch from 1d7925d to ba4fdad Compare October 9, 2026 15:30
@rbradford
rbradford enabled auto-merge October 9, 2026 15:55
@rbradford
rbradford added this pull request to the merge queue Oct 9, 2026
Merged via the queue into cloud-hypervisor:main with commit ba64d52 Oct 9, 2026
45 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.

3 participants