Hi Lukas,
Sorry I am late to the party.
On Tue, Dec 2, 2025 at 6:59 PM Jason Gunthorpe jgg@nvidia.com wrote:
On Tue, Dec 02, 2025 at 07:20:23AM +0100, Lukas Wunner wrote:
But you do gain a bit of reliability if you don't assume bus numbers to stay the same and instead use the "path from root" approach to identify devices.
Again, that's not reliability it is subtle bugs. The device is active during KHO, you CAN NOT do any resource reassignment, not bus numbers, not mmio. It must be fully disabled.
I agree with Jason. The bus number is used in the low level hardware to do the DMA transfer. The bus number can not change for a device during livedupate with pending DMA transfer. The BDF MUST remain the same as the liveupdate with DMA transfer requirement. Given the BDF remains the same. Using the path from root doesn't buy you more protections. It just makes the patch more complicated but achieves the same thing. That is why I chose the BDF approach for the PCI liveupdate subsystem in the first place. To keep it simple.
Jason, please correct me if I am wrong. My understanding is that not only the device that is actively doing the DMA requires the bus number to stay the same, I think all the parent bridge, all the way to the root PCI host bridge, bus number must remain the same. After all, the DMA will need to route through the parent bridges.
Another point is that, on the same machine it can have multiple PCI host bridges. Each PCI host bridge bus number is acquired from the ACPI table walk. I am not aware of any way to get the slot number of the PCI host bridge. Lukas, do you know how to get the PCI host bridge slot number to form a path?
Chris