-
-
Notifications
You must be signed in to change notification settings - Fork 187
uefi: Add device path generation for discovered devices in a PciTree #1831
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?
Conversation
ab46f2d to
582714a
Compare
6f6f35b to
8a4ab00
Compare
8a4ab00 to
c31575d
Compare
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.
LGTM with two nits!
PS: You do not have to fix it here but do you have an opinion on #1817? I'd like to hear a direction that we should go for (Box<DevicePath> vs PoolDevicePath)
3e6b322 to
9770e69
Compare
To be completely honest with you, I don't really understand the difference. I was under the impression, that |
Nope, it is a wrapper for PoolAllocation. https://docs.rs/uefi/latest/src/uefi/proto/device_path/mod.rs.html#137 |
Yes. But isn't alloc in uefi also just using pool allocations under the hood, conceptually? |
9770e69 to
b643d1a
Compare
phip1611
left a comment
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.
LGTM, thanks for your contribution!
We are currently inconsistent with Box<[u8]> and PoolDevicePath - no need to clean that up.
One final question: When I execute the integration test, it prints
...
[ INFO]: uefi-test-runner/src/proto/pci/root_bridge.rs@069: \- Bus: 01
[ INFO]: uefi-test-runner/src/proto/pci/root_bridge.rs@064: PCI Device: [00, 1f, 00]: vendor=8086, device=2918, class=06, subclass=01 - PciRoot(0x0)/Pci(0x1F,0x0)
[ INFO]: uefi-test-runner/src/proto/pci/root_bridge.rs@064: PCI Device: [00, 1f, 02]: vendor=8086, device=2922, class=01, subclass=06 - PciRoot(0x0)/Pci(0x1F,0x2)
[ INFO]: uefi-test-runner/src/proto/pci/root_bridge.rs@064: PCI Device: [00, 1f, 03]: vendor=8086, device=2930, class=0C, subclass=05 - PciRoot(0x0)/Pci(0x1F,0x3)
[ INFO]: uefi-test-runner/src/proto/pci/root_bridge.rs@064: PCI Device: [01, 00, 00]: vendor=104C, device=8232, class=06, subclass=04 - PciRoot(0x0)/Pci(0x7,0x0)/Pci(0x0,0x0)
[ INFO]: uefi-test-runner/src/proto/pci/root_bridge.rs@069: \- Bus: 02
[ INFO]: uefi-test-runner/src/proto/pci/root_bridge.rs@064: PCI Device: [02, 00, 00]: vendor=104C, device=8233, class=06, subclass=04 - PciRoot(0x0)/Pci(0x7,0x0)/Pci(0x0,0x0)/Pci(0x0,0x0)
[ INFO]: uefi-test-runner/src/proto/pci/root_bridge.rs@069: \- Bus: 03
[ INFO]: uefi-test-runner/src/proto/pci/root_bridge.rs@064: PCI Device: [02, 01, 00]: vendor=104C, device=8233, class=06, subclass=04 - PciRoot(0x0)/Pci(0x7,0x0)/Pci(0x0,0x0)/Pci(0x1,0x0)
[ INFO]: uefi-test-runner/src/proto/pci/root_bridge.rs@069: \- Bus: 04
[ INFO]: uefi-test-runner/src/proto/pci/root_bridge.rs@064: PCI Device: [03, 00, 00]: vendor=1AF4, device=1048, class=01, subclass=00 - PciRoot(0x0)/Pci(0x7,0x0)/Pci(0x0,0x0)/Pci(0x0,0x0)/Pci(0x0,0x0)
[ INFO]: uefi-test-runner/src/proto/pci/root_bridge.rs@064: PCI Device: [04, 00, 00]: vendor=1AF4, device=1048, class=01, subclass=00 - PciRoot(0x0)/Pci(0x7,0x0)/Pci(0x0,0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)
[ INFO]: uefi-test-runner/src/proto/pi/mod.rs@004: Testing Platform Initialization protocols
I don't understand the output. When you are about to enumerate bus 3, the device says it is at bus 2? And if you enumerate Bus 4, the first device says it is as bus 3? Please explain - or is therea bug?
Not sure about the random Windows CI failure, tho.
|
Ah yes, the logging may be a bit confusing. let pci_tree = pci_proto.enumerate().unwrap();
for addr in pci_tree.iter().cloned() {
// ...
}basically performs a breadth-first-search. Meaning that you will first get all devices in bus for child_bus in pci_tree.child_bus_of_iter(addr) {
log::info!(" \\- Bus: {child_bus:02x}");
}So the log line |
b643d1a to
f8444fd
Compare
Initial implementation for device path generation of discovered pci devices in a
PciTreeinstance.Unfortunately, it's a bit clunky to use, since you have to query the
DevicePathcorresponding to yourPciRootBridgeIoinstance yourself and pass that in:I tried getting the
DevicePathof thePciRootBridgeIoinstance withinPciRootBridgeIo::enumerate()and pass that on to thePciTree, but I couldn't find a way to get theDevicePathinstance - other than ugly workarounds.Best consumed Commit-By-Commit. Contains #1830..
Steps to Undraft
Checklist