On Fri, Oct 10, 2025 at 06:34:38PM +0900, Akihiko Odaki wrote:
> Removing the PBA memory region from its container in
> vfio_user_msix_teardown() is semantically incorrect as the reference to
> the region is already deleted when the function is called.
Can you clue me in?
378 if (vdev->msix != NULL) {
379 vfio_user_msix_teardown(vdev);
380 }
381
382 vfio_pci_put_device(vdev);
vfio_pci_put_device() -> vfio_bars_finalize() -> vfio_region_finalize()
Where is the "reference to the region is already deleted" code that runs prior
to line :379 that you're referring to?
What about vfio_pci_teardown_msi() - isn't that the same?
> The operation is unnecessary in the first place since the PCI code
> removes all BARs during unrealization
Might be worth mentioning vfio_pci_bars_exit() (which is what I presume you're
referring to).
regards
john