[PATCH 0/4] hw/pci: Ensure capabilities are added before calling pci_qdev_realize()

Philippe Mathieu-Daudé posted 4 patches 1 year, 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230314111435.89796-1-philmd@linaro.org
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
hw/pci/msi.c | 4 +++-
hw/pci/pci.c | 5 ++++-
2 files changed, 7 insertions(+), 2 deletions(-)
[PATCH 0/4] hw/pci: Ensure capabilities are added before calling pci_qdev_realize()
Posted by Philippe Mathieu-Daudé 1 year, 1 month ago
Per MST in [*]: "Calling pci_add_capability when VM is running is
likely to confuse guests".
Ensure this can't happen by asserting pci_add_capability() is never
called after a PCI device is realized.

[*] https://lore.kernel.org/qemu-devel/20230308071628-mutt-send-email-mst@kernel.org/
Based-on: <20230313153031.86107-1-philmd@linaro.org>
          "hw/i386/amd_iommu: Orphanize & QDev cleanups"

Philippe Mathieu-Daudé (4):
  hw/pci/msi: Fix debug format string
  hw/pci/msi: Ensure msi_init() is called before device is realized
  hw/pci: Add sanity check in pci_find_space()
  hw/pci: Ensure pci_add_capability() is called before device is
    realized

 hw/pci/msi.c | 4 +++-
 hw/pci/pci.c | 5 ++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

-- 
2.38.1