Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allocate PCI BARs where needed #230

Merged

Conversation

rbradford
Copy link
Member

  • bootinfo: Support specifying a region to allocate PCI BARs from
  • pci: Allocate PCI BARs from advertised range
  • fdt: Support adjusting Info::pci_bar_memory()

In some situations it will be necessary to allocate PCI BARs from some
address space provided by the platform. This provides a memory range
that can be used.

Signed-off-by: Rob Bradford <[email protected]>
@rbradford rbradford requested a review from retrage March 13, 2023 17:23
@rbradford
Copy link
Member Author

I've tested this with my RV64 port and it works well.

@rbradford rbradford requested a review from sboeuf March 13, 2023 17:25
Copy link
Member

@sboeuf sboeuf left a comment

Choose a reason for hiding this comment

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

LGTM

src/pci.rs Outdated Show resolved Hide resolved
@rbradford rbradford force-pushed the 2023-03-13-pci-bar-allocation branch from 9b14cec to 6cd6dc7 Compare March 14, 2023 09:41
If memory is provided to program the PCI BARs from then use that memory
to simply allocate (in a contiguous, naturally aligned manner) memory to
use for the BARs.

This requires the explicity initialisation of the PCI device earlier in
order to provide the BAR sizes that are calculated as part of the
PciDevice::init() method.

Signed-off-by: Rob Bradford <[email protected]>
This allows systems using the FDT boot method to specify PCI BAR
memory space.

Signed-off-by: Rob Bradford <[email protected]>
@rbradford rbradford force-pushed the 2023-03-13-pci-bar-allocation branch from 6cd6dc7 to 026a50b Compare March 14, 2023 09:46
@rbradford rbradford merged commit 49f7c02 into cloud-hypervisor:main Mar 14, 2023
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