From: Alex Williamson <alex.williamson@redhat.com>
To: alex.williamson@redhat.com
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, clg@redhat.com
Subject: [PATCH v2 0/2] vfio/mtty: Add migration support
Date: Mon, 16 Oct 2023 16:47:34 -0600 [thread overview]
Message-ID: <20231016224736.2575718-1-alex.williamson@redhat.com> (raw)
We've seen a request for CI and development to have access to migratable
vfio devices without any specific hardware requirements. One way to do
that is to enable migration support on the mtty mdev sample driver, as
done here.
This device is particularly easy to migrate because it doesn't actually
do DMA, or in fact much of anything. Therefore we can claim P2P and
dirty logging as well. PRE_COPY support is also included in a similar
fashion to hisi_acc. This provides early compatibility testing, which
is probably over-done, but perhaps illustrates good practice with
matching data stream magic, versioning, and feature flags. These might
later be used for backwards compatibility, particularly since I'm not
positive that copying the struct serial_port between source and
destination is sufficient.
Along the way, testing migration where the source and target are
incompatible revealed an eventfd leak, where peeling back the onion
of mtty handling of SET_IRQS proved to require a substantial overhaul.
v2:
Incorporate comments from Cédric
- Fixing eventfd leak turned into SET_IRQS overhaul
- Factored out mtty_data_size()
- Factored mtty_save_state() and paired with mtty_load_state()
Alex Williamson (2):
vfio/mtty: Overhaul mtty interrupt handling
vfio/mtty: Enable migration support
samples/vfio-mdev/mtty.c | 829 +++++++++++++++++++++++++++++++++++----
1 file changed, 756 insertions(+), 73 deletions(-)
--
2.40.1
next reply other threads:[~2023-10-16 22:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-16 22:47 Alex Williamson [this message]
2023-10-16 22:47 ` [PATCH v2 1/2] vfio/mtty: Overhaul mtty interrupt handling Alex Williamson
2023-10-17 14:17 ` Cédric Le Goater
2023-10-16 22:47 ` [PATCH v2 2/2] vfio/mtty: Enable migration support Alex Williamson
2023-10-17 14:44 ` Cédric Le Goater
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=20231016224736.2575718-1-alex.williamson@redhat.com \
--to=alex.williamson@redhat.com \
--cc=clg@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®