From: "Cédric Le Goater" <clg@redhat.com>
To: Avihai Horon <avihaih@nvidia.com>, qemu-devel@nongnu.org
Cc: Alex Williamson <alex.williamson@redhat.com>,
Juan Quintela <quintela@redhat.com>, Peter Xu <peterx@redhat.com>,
Leonardo Bras <leobras@redhat.com>,
Yanghang Liu <yanghliu@redhat.com>
Subject: Re: [PATCH v3 0/6] vfio/migration: Block VFIO migration with postcopy and background snapshot
Date: Thu, 7 Sep 2023 10:55:54 +0200 [thread overview]
Message-ID: <9a962af2-1748-017b-9ab3-fdf7d9f84b4b@redhat.com> (raw)
In-Reply-To: <20230906150853.22176-1-avihaih@nvidia.com>
On 9/6/23 17:08, Avihai Horon wrote:
> Hello,
>
> Recently added VFIO migration is not compatible with some of the
> pre-existing migration features. This was overlooked and today these
> combinations are not blocked by QEMU. This series fixes it.
>
> Postcopy migration:
> VFIO migration is not compatible with postcopy migration. A VFIO device
> in the destination can't handle page faults for pages that have not been
> sent yet. Doing such migration will cause the VM to crash in the
> destination.
>
> Background snapshot:
> Background snapshot allows creating a snapshot of the VM while it's
> running and keeping it small by not including dirty RAM pages.
>
> The way it works is by first stopping the VM, saving the non-iterable
> devices' state and then starting the VM and saving the RAM while write
> protecting it with UFFD. The resulting snapshot represents the VM state
> at snapshot start.
>
> VFIO migration is not compatible with background snapshot.
> First of all, VFIO device state is not even saved in background snapshot
> because only non-iterable device state is saved. But even if it was
> saved, after starting the VM, a VFIO device could dirty pages without it
> being detected by UFFD write protection. This would corrupt the
> snapshot, as the RAM in it would not represent the RAM at snapshot
> start.
>
> This series fixes it by blocking these combinations. This is done by
> adding a .save_prepare() handler to struct SaveVMHandler. The
> .save_prepare() handler is called early, even before migration starts,
> and allows VFIO migration to check the migration capabilities and fail
> migration if needed.
>
> Note that this series is based on the P2P series [1] sent a few weeks
> ago.
>
> Comments and suggestions will be greatly appreciated.
Applied to vfio-next.
Thanks,
C.
next prev parent reply other threads:[~2023-09-07 8:56 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-06 15:08 [PATCH v3 0/6] vfio/migration: Block VFIO migration with postcopy and background snapshot Avihai Horon
2023-09-06 15:08 ` [PATCH v3 1/6] migration: Add migration prefix to functions in target.c Avihai Horon
2023-09-06 15:08 ` [PATCH v3 2/6] vfio/migration: Fail adding device with enable-migration=on and existing blocker Avihai Horon
2023-09-06 15:08 ` [PATCH v3 3/6] migration: Move more initializations to migrate_init() Avihai Horon
2023-09-06 16:16 ` Cédric Le Goater
2023-09-06 15:08 ` [PATCH v3 4/6] migration: Add .save_prepare() handler to struct SaveVMHandlers Avihai Horon
2023-09-06 15:08 ` [PATCH v3 5/6] vfio/migration: Block VFIO migration with postcopy migration Avihai Horon
2023-09-06 15:18 ` Peter Xu
2023-09-06 15:08 ` [PATCH v3 6/6] vfio/migration: Block VFIO migration with background snapshot Avihai Horon
2023-09-07 8:55 ` Cédric Le Goater [this message]
2023-09-07 9:07 ` [PATCH v3 0/6] vfio/migration: Block VFIO migration with postcopy and " Cédric Le Goater
2023-09-08 21:47 ` Peter Xu
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=9a962af2-1748-017b-9ab3-fdf7d9f84b4b@redhat.com \
--to=clg@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=avihaih@nvidia.com \
--cc=leobras@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=yanghliu@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).