hw/vfio/pci: Re-order pre-reset
authorAlex Williamson <alex.williamson@redhat.com>
Tue, 25 Feb 2025 21:52:29 +0000 (14:52 -0700)
committerCédric Le Goater <clg@redhat.com>
Thu, 6 Mar 2025 05:47:33 +0000 (06:47 +0100)
commit518a69a598916749338de3852d41d961d4503115
tree75e39a8207f7d6f9b73e793e3072aa5610c0db07
parent8b8d08cf293b930d0f55b2d5385d8dd27e0c6b41
hw/vfio/pci: Re-order pre-reset

We want the device in the D0 power state going into reset, but the
config write can enable the BARs in the address space, which are
then removed from the address space once we clear the memory enable
bit in the command register.  Re-order to clear the command bit
first, so the power state change doesn't enable the BARs.

Cc: Cédric Le Goater <clg@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>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20250225215237.3314011-6-alex.williamson@redhat.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
hw/vfio/pci.c