@samitouri / QOSamiQemu / commits / 92b25a9ac2

hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_INIT_PM definition

VIRTIO_PCI_FLAG_INIT_PM was only used by the hw_compat_2_8[] array, via the 'x-pcie-pm-init=off' property. We removed all machines using that array, lets remove all the code around VIRTIO_PCI_FLAG_INIT_PM (see commit 9a4c0e220d8 for similar VIRTIO_PCI_FLAG_* enum removal). Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20250501210456.89071-11-philmd@linaro.org> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com> Message-ID: <20260225092024.794595-10-thuth@redhat.com>

Philippe Mathieu-Daudé committed Feb 25, 2026 at 10:20 UTC 92b25a9ac254c621222bf15d0146eb2a49b90f10
2 files changed +5 -18
hw/virtio/virtio-pci.c
+5 -14
@@ -2318,11 +2318,9 @@ static void virtio_pci_realize(PCIDevice *pci_dev, Error **errp)
2318 PCI_PM_CTRL_NO_SOFT_RESET);
2319 }
2320
2321 - if (proxy->flags & VIRTIO_PCI_FLAG_INIT_PM) {
2322 - /* Init Power Management Control Register */
2323 - pci_set_word(pci_dev->wmask + pos + PCI_PM_CTRL,
2324 - PCI_PM_CTRL_STATE_MASK);
2325 - }
2321 + /* Init Power Management Control Register */
2322 + pci_set_word(pci_dev->wmask + pos + PCI_PM_CTRL,
2323 + PCI_PM_CTRL_STATE_MASK);
2324
2325 if (proxy->flags & VIRTIO_PCI_FLAG_ATS) {
2326 pcie_ats_init(pci_dev, proxy->last_pcie_cap_offset,
@@ -2418,16 +2416,11 @@ static void virtio_pci_bus_reset_hold(Object *obj, ResetType type)
2416 virtio_pci_reset(qdev);
2417
2418 if (pci_is_express(dev)) {
2421 - VirtIOPCIProxy *proxy = VIRTIO_PCI(dev);
2422 -
2419 pcie_cap_deverr_reset(dev);
2420 pcie_cap_lnkctl_reset(dev);
2421
2426 - if (proxy->flags & VIRTIO_PCI_FLAG_INIT_PM) {
2427 - pci_word_test_and_clear_mask(
2428 - dev->config + dev->pm_cap + PCI_PM_CTRL,
2429 - PCI_PM_CTRL_STATE_MASK);
2430 - }
2422 + pci_word_test_and_clear_mask(dev->config + dev->pm_cap + PCI_PM_CTRL,
2423 + PCI_PM_CTRL_STATE_MASK);
2424 }
2425 }
2426
@@ -2442,8 +2435,6 @@ static const Property virtio_pci_properties[] = {
2435 VIRTIO_PCI_FLAG_ATS_BIT, false),
2436 DEFINE_PROP_BIT("x-ats-page-aligned", VirtIOPCIProxy, flags,
2437 VIRTIO_PCI_FLAG_ATS_PAGE_ALIGNED_BIT, true),
2445 - DEFINE_PROP_BIT("x-pcie-pm-init", VirtIOPCIProxy, flags,
2446 - VIRTIO_PCI_FLAG_INIT_PM_BIT, true),
2438 DEFINE_PROP_BIT("x-pcie-pm-no-soft-reset", VirtIOPCIProxy, flags,
2439 VIRTIO_PCI_FLAG_PM_NO_SOFT_RESET_BIT, false),
2440 DEFINE_PROP_BIT("x-pcie-flr-init", VirtIOPCIProxy, flags,
include/hw/virtio/virtio-pci.h
-4
@@ -35,7 +35,6 @@ enum {
35 VIRTIO_PCI_FLAG_MODERN_PIO_NOTIFY_BIT,
36 VIRTIO_PCI_FLAG_PAGE_PER_VQ_BIT,
37 VIRTIO_PCI_FLAG_ATS_BIT,
38 - VIRTIO_PCI_FLAG_INIT_PM_BIT,
38 VIRTIO_PCI_FLAG_INIT_FLR_BIT,
39 VIRTIO_PCI_FLAG_AER_BIT,
40 VIRTIO_PCI_FLAG_ATS_PAGE_ALIGNED_BIT,
@@ -61,9 +60,6 @@ enum {
60 /* address space translation service */
61 #define VIRTIO_PCI_FLAG_ATS (1 << VIRTIO_PCI_FLAG_ATS_BIT)
62
64 -/* Init Power Management */
65 -#define VIRTIO_PCI_FLAG_INIT_PM (1 << VIRTIO_PCI_FLAG_INIT_PM_BIT)
66 -
63 /* Init The No_Soft_Reset bit of Power Management */
64 #define VIRTIO_PCI_FLAG_PM_NO_SOFT_RESET \
65 (1 << VIRTIO_PCI_FLAG_PM_NO_SOFT_RESET_BIT)