diff options
author | Alex Williamson <alex.williamson@redhat.com> | 2025-02-25 14:52:28 -0700 |
---|---|---|
committer | Cédric Le Goater <clg@redhat.com> | 2025-03-06 06:47:33 +0100 |
commit | 8b8d08cf293b930d0f55b2d5385d8dd27e0c6b41 (patch) | |
tree | 1bb1fc4a037d4951f1b7c52c306fbc9e55c170e2 /hw/virtio | |
parent | 05c6a8eff6298675080aa2692ee05a310b3483b4 (diff) | |
download | qemu-8b8d08cf293b930d0f55b2d5385d8dd27e0c6b41.zip qemu-8b8d08cf293b930d0f55b2d5385d8dd27e0c6b41.tar.gz qemu-8b8d08cf293b930d0f55b2d5385d8dd27e0c6b41.tar.bz2 |
pcie, virtio: Remove redundant pm_cap
The pm_cap on the PCIExpressDevice object can be distilled down
to the new instance on the PCIDevice object.
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20250225215237.3314011-5-alex.williamson@redhat.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
Diffstat (limited to 'hw/virtio')
-rw-r--r-- | hw/virtio/virtio-pci.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index afe8b55..3ca3f84 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -2209,8 +2209,6 @@ static void virtio_pci_realize(PCIDevice *pci_dev, Error **errp) return; } - pci_dev->exp.pm_cap = pos; - /* * Indicates that this function complies with revision 1.2 of the * PCI Power Management Interface Specification. @@ -2309,11 +2307,11 @@ static bool virtio_pci_no_soft_reset(PCIDevice *dev) { uint16_t pmcsr; - if (!pci_is_express(dev) || !dev->exp.pm_cap) { + if (!pci_is_express(dev) || !(dev->cap_present & QEMU_PCI_CAP_PM)) { return false; } - pmcsr = pci_get_word(dev->config + dev->exp.pm_cap + PCI_PM_CTRL); + pmcsr = pci_get_word(dev->config + dev->pm_cap + PCI_PM_CTRL); /* * When No_Soft_Reset bit is set and the device @@ -2342,7 +2340,7 @@ static void virtio_pci_bus_reset_hold(Object *obj, ResetType type) if (proxy->flags & VIRTIO_PCI_FLAG_INIT_PM) { pci_word_test_and_clear_mask( - dev->config + dev->exp.pm_cap + PCI_PM_CTRL, + dev->config + dev->pm_cap + PCI_PM_CTRL, PCI_PM_CTRL_STATE_MASK); } } |