All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: qemu-devel@nongnu.org
Cc: Shenming Lu <lushenming@huawei.com>,
	Kirti Wankhede <kwankhede@nvidia.com>,
	Cornelia Huck <cohuck@redhat.com>
Subject: [PULL 07/10] vfio: Set the priority of the VFIO VM state change handler explicitly
Date: Tue, 16 Mar 2021 11:07:19 -0600	[thread overview]
Message-ID: <161591443963.135549.7021340331725127959.stgit@rhel8vm.home.shazbot.org> (raw)
In-Reply-To: <161591414009.135549.5804863877511053803.stgit@rhel8vm.home.shazbot.org>

From: Shenming Lu <lushenming@huawei.com>

In the VFIO VM state change handler when stopping the VM, the _RUNNING
bit in device_state is cleared which makes the VFIO device stop, including
no longer generating interrupts. Then we can save the pending states of
all interrupts in the GIC VM state change handler (on ARM).

So we have to set the priority of the VFIO VM state change handler
explicitly (like virtio devices) to ensure it is called before the
GIC's in saving.

Signed-off-by: Shenming Lu <lushenming@huawei.com>
Reviewed-by: Kirti Wankhede <kwankhede@nvidia.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Message-Id: <20210310030233.1133-3-lushenming@huawei.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
 hw/vfio/migration.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c
index 003786f3cd9a..eafb778947c3 100644
--- a/hw/vfio/migration.c
+++ b/hw/vfio/migration.c
@@ -862,7 +862,8 @@ static int vfio_migration_init(VFIODevice *vbasedev,
     register_savevm_live(id, VMSTATE_INSTANCE_ID_ANY, 1, &savevm_vfio_handlers,
                          vbasedev);
 
-    migration->vm_state = qemu_add_vm_change_state_handler(vfio_vmstate_change,
+    migration->vm_state = qdev_add_vm_change_state_handler(vbasedev->dev,
+                                                           vfio_vmstate_change,
                                                            vbasedev);
     migration->migration_state.notify = vfio_migration_state_notifier;
     add_migration_state_change_notifier(&migration->migration_state);




  parent reply	other threads:[~2021-03-16 17:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-16 17:06 [PULL 00/10] VFIO updates for QEMU 6.0 Alex Williamson
2021-03-16 17:06 ` [PULL 01/10] vfio: Fix vfio_listener_log_sync function name typo Alex Williamson
2021-03-16 17:06 ` [PULL 02/10] hw/vfio/pci-quirks: Replace the word 'blacklist' Alex Williamson
2021-03-16 17:06 ` [PULL 03/10] MAINTAINERS: Cover docs/igd-assign.txt in VFIO section Alex Williamson
2021-03-16 17:06 ` [PULL 04/10] vfio: Do not register any IOMMU_NOTIFIER_DEVIOTLB_UNMAP notifier Alex Williamson
2021-03-16 17:06 ` [PULL 05/10] spapr_iommu: Fix vhost integration regression Alex Williamson
2021-03-16 17:07 ` [PULL 06/10] vfio: Move the saving of the config space to the right place in VFIO migration Alex Williamson
2021-03-16 17:07 ` Alex Williamson [this message]
2021-03-16 17:07 ` [PULL 08/10] vfio: Avoid disabling and enabling vectors repeatedly " Alex Williamson
2021-03-16 17:07 ` [PULL 09/10] vfio: Support host translation granule size Alex Williamson
2021-03-16 17:07 ` [PULL 10/10] vfio/migrate: Move switch of dirty tracking into vfio_memory_listener Alex Williamson
2021-03-17 21:00 ` [PULL 00/10] VFIO updates for QEMU 6.0 Peter Maydell
     [not found] <161550593889.21070.5662039089881992714.stgit@gimli.home>
2021-03-11 23:44 ` [PULL 07/10] vfio: Set the priority of the VFIO VM state change handler explicitly Alex Williamson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=161591443963.135549.7021340331725127959.stgit@rhel8vm.home.shazbot.org \
    --to=alex.williamson@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=kwankhede@nvidia.com \
    --cc=lushenming@huawei.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.