[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACePvbVDqc+DN+=9m1qScw6vYEMYbLvfBPwFVsZwMhd71Db2=A@mail.gmail.com>
Date: Tue, 2 Dec 2025 20:36:53 +0400
From: Chris Li <chrisl@...nel.org>
To: Jason Gunthorpe <jgg@...dia.com>
Cc: Lukas Wunner <lukas@...ner.de>, David Matlack <dmatlack@...gle.com>,
Pasha Tatashin <pasha.tatashin@...een.com>, Alex Williamson <alex@...zbot.org>,
Adithya Jayachandran <ajayachandra@...dia.com>, Alex Mastro <amastro@...com>,
Alistair Popple <apopple@...dia.com>, Andrew Morton <akpm@...ux-foundation.org>,
Bjorn Helgaas <bhelgaas@...gle.com>, David Rientjes <rientjes@...gle.com>,
Jacob Pan <jacob.pan@...ux.microsoft.com>, Josh Hilke <jrhilke@...gle.com>,
Kevin Tian <kevin.tian@...el.com>, kvm@...r.kernel.org,
Leon Romanovsky <leonro@...dia.com>, linux-kernel@...r.kernel.org,
linux-kselftest@...r.kernel.org, linux-pci@...r.kernel.org,
Mike Rapoport <rppt@...nel.org>, Parav Pandit <parav@...dia.com>,
Philipp Stanner <pstanner@...hat.com>, Pratyush Yadav <pratyush@...nel.org>,
Saeed Mahameed <saeedm@...dia.com>, Samiullah Khawaja <skhawaja@...gle.com>, Shuah Khan <shuah@...nel.org>,
Tomita Moeko <tomitamoeko@...il.com>, Vipin Sharma <vipinsh@...gle.com>, William Tu <witu@...dia.com>,
Yi Liu <yi.l.liu@...el.com>, Yunxiang Li <Yunxiang.Li@....com>,
Zhu Yanjun <yanjun.zhu@...ux.dev>, Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
Subject: Re: [PATCH 02/21] PCI: Add API to track PCI devices preserved across
Live Update
Hi Lukas,
Sorry I am late to the party.
On Tue, Dec 2, 2025 at 6:59 PM Jason Gunthorpe <jgg@...dia.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
Powered by blists - more mailing lists