All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shenming Lu <lushenming@huawei.com>
To: Alex Williamson <alex.williamson@redhat.com>,
	Kirti Wankhede <kwankhede@nvidia.com>,
	Cornelia Huck <cohuck@redhat.com>,
	"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
	Eric Auger <eric.auger@redhat.com>, <mst@redhat.com>,
	Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Neo Jia <cjia@nvidia.com>, Marc Zyngier <maz@kernel.org>,
	qemu-devel@nongnu.org, lushenming@huawei.com,
	qemu-arm@nongnu.org, yuzenghui@huawei.com,
	wanghaibin.wang@huawei.com
Subject: [RFC PATCH v2 2/3] vfio: Set the priority of the VFIO VM state change handler explicitly
Date: Wed, 9 Dec 2020 16:09:18 +0800	[thread overview]
Message-ID: <20201209080919.156-3-lushenming@huawei.com> (raw)
In-Reply-To: <20201209080919.156-1-lushenming@huawei.com>

In the VFIO VM state change handler, VFIO devices are transitioned
in the _SAVING state, which should keep them from sending 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>
---
 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 3b9de1353a..97ea82b100 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);
-- 
2.19.1



  parent reply	other threads:[~2020-12-09  8:14 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-09  8:09 [RFC PATCH v2 0/3] vfio: Some fixes and optimizations for VFIO migration Shenming Lu
2020-12-09  8:09 ` [RFC PATCH v2 1/3] vfio: Move the saving of the config space to the right place in " Shenming Lu
2020-12-09 12:29   ` Cornelia Huck
2020-12-09 18:34     ` Alex Williamson
2020-12-10  2:21       ` Shenming Lu
2021-01-26 21:36         ` Alex Williamson
2021-01-27 21:52           ` Kirti Wankhede
2021-02-18 14:45           ` Kirti Wankhede
2021-02-18 14:42   ` Kirti Wankhede
2021-02-19 10:33     ` Shenming Lu
2020-12-09  8:09 ` Shenming Lu [this message]
2020-12-09 12:45   ` [RFC PATCH v2 2/3] vfio: Set the priority of the VFIO VM state change handler explicitly Cornelia Huck
2020-12-10  3:11     ` Shenming Lu
2020-12-10 18:39       ` Cornelia Huck
2021-01-26 21:36   ` Alex Williamson
2021-01-27 11:20     ` Shenming Lu
2021-01-27 14:20       ` Alex Williamson
2021-01-28  2:35         ` Shenming Lu
2020-12-09  8:09 ` [RFC PATCH v2 3/3] vfio: Avoid disabling and enabling vectors repeatedly in VFIO migration Shenming Lu
2021-01-26 21:36   ` Alex Williamson
2021-01-27 11:27     ` Shenming Lu
2021-01-27 14:21       ` Alex Williamson
2021-02-01  3:12         ` Shenming Lu
2021-01-26  6:03 ` [RFC PATCH v2 0/3] vfio: Some fixes and optimizations for " Shenming Lu

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=20201209080919.156-3-lushenming@huawei.com \
    --to=lushenming@huawei.com \
    --cc=alex.williamson@redhat.com \
    --cc=cjia@nvidia.com \
    --cc=cohuck@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=eric.auger@redhat.com \
    --cc=kwankhede@nvidia.com \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=maz@kernel.org \
    --cc=mst@redhat.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=wanghaibin.wang@huawei.com \
    --cc=yuzenghui@huawei.com \
    /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.