qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] hw/pci: Ensure capabilities are added before calling pci_qdev_realize()
@ 2023-03-14 11:14 Philippe Mathieu-Daudé
  2023-03-14 11:14 ` [PATCH 1/4] hw/pci/msi: Fix debug format string Philippe Mathieu-Daudé
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-03-14 11:14 UTC (permalink / raw)
  To: qemu-devel
  Cc: Marcel Apfelbaum, Michael S. Tsirkin, Jason Wang,
	Philippe Mathieu-Daudé

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



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-03-22 23:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-14 11:14 [PATCH 0/4] hw/pci: Ensure capabilities are added before calling pci_qdev_realize() Philippe Mathieu-Daudé
2023-03-14 11:14 ` [PATCH 1/4] hw/pci/msi: Fix debug format string Philippe Mathieu-Daudé
2023-03-14 11:14 ` [PATCH 2/4] hw/pci/msi: Ensure msi_init() is called before device is realized Philippe Mathieu-Daudé
2023-03-14 11:14 ` [PATCH 3/4] hw/pci: Add sanity check in pci_find_space() Philippe Mathieu-Daudé
2023-03-14 11:14 ` [PATCH 4/4] hw/pci: Ensure pci_add_capability() is called before device is realized Philippe Mathieu-Daudé
2023-03-22  2:18   ` Michael S. Tsirkin
2023-03-22  8:52     ` Philippe Mathieu-Daudé
2023-03-22 22:01       ` Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).