-
-
Notifications
You must be signed in to change notification settings - Fork 183
uefi: Refactor PciRootBridgeIo::enumerate() with tree-topology information #1830
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -506,6 +506,37 @@ pub fn run_qemu(arch: UefiArch, opt: &QemuOpt) -> Result<()> { | |
| None | ||
| }; | ||
|
|
||
| // Make PCI tree a little more complicated so the PCI enumeration integration | ||
seijikun marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // test is more interesting. This specific architecture was taken from: | ||
| // https://blogs.oracle.com/linux/a-study-of-the-linux-kernel-pci-subsystem-with-qemu | ||
| // It employs a complex PCIe switch (x3130) setup, which makes it interesting for testing. | ||
| // The bus architecture this generates is found below `0000:00:03.0` in below diagram. | ||
| // (actual bus numbers and surrounding devices don't match this diagram) | ||
| // -[0000:00]-+-00.0 | ||
| // +-01.0 | ||
| // +-02.0 | ||
| // +-03.0-[01-04]----00.0-[02-04]--+-00.0-[03]----00.0 | ||
| // | \-01.0-[04]----00.0 | ||
| // +-1f.0 | ||
| // +-1f.2 | ||
| // \-1f.3 | ||
| // In the diagram, `0000:03:00.0` and `0000:04:00.0` are just dummy SCSI devices | ||
| // connected below the PCIe switch, to correct recursion in the bus enumeration implementation. | ||
| cmd.args([ | ||
| "-device", | ||
| "ioh3420,id=root_port1,bus=pcie.0", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not that familiar with PCI. Could you please elaborate a little?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Much of this is qemu specific syntax: Difference PCIe switches and PCIe bridges:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| "-device", | ||
| "x3130-upstream,id=upstream1,bus=root_port1", | ||
| "-device", | ||
| "xio3130-downstream,id=downstream1,bus=upstream1,chassis=9", | ||
| "-device", | ||
| "virtio-scsi-pci,bus=downstream1", | ||
| "-device", | ||
| "xio3130-downstream,id=downstream2,bus=upstream1,chassis=10", | ||
| "-device", | ||
| "virtio-scsi-pci,bus=downstream2", | ||
| ]); | ||
|
|
||
| // Pass CA certificate database to the edk2 firmware, for TLS support. | ||
| cmd.args([ | ||
| "-fw_cfg", | ||
|
|
||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of just iterating, would it make sense to explictely check for the expected PCIe devices?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bus numbers are dynamically allocated and thus might vary.
But I've done something like you suggest in the follow-up MR here, based on device paths: 582714a