From: "Cédric Le Goater" <clg@redhat.com>
To: Alex Williamson <alex.williamson@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>
Cc: Vinayak Kale <vkale@nvidia.com>,
qemu-devel@nongnu.org, marcel.apfelbaum@gmail.com,
avihaih@nvidia.com, acurrid@nvidia.com, cjia@nvidia.com,
zhiw@nvidia.com, targupta@nvidia.com, kvm@vger.kernel.org
Subject: Re: [PATCH v3] vfio/pci: migration: Skip config space check for Vendor Specific Information in VSC during restore/load
Date: Thu, 28 Mar 2024 10:30:37 +0100 [thread overview]
Message-ID: <10a42156-067e-4dc1-8467-b840595b38fa@redhat.com> (raw)
In-Reply-To: <20240327145235.47338c2b.alex.williamson@redhat.com>
On 3/27/24 21:52, Alex Williamson wrote:
> On Wed, 27 Mar 2024 16:11:37 -0400
> "Michael S. Tsirkin" <mst@redhat.com> wrote:
>
>> On Wed, Mar 27, 2024 at 11:39:15AM -0600, Alex Williamson wrote:
>>> On Fri, 22 Mar 2024 12:12:10 +0530
>>> Vinayak Kale <vkale@nvidia.com> wrote:
>>>
>>>> In case of migration, during restore operation, qemu checks config space of the
>>>> pci device with the config space in the migration stream captured during save
>>>> operation. In case of config space data mismatch, restore operation is failed.
>>>>
>>>> config space check is done in function get_pci_config_device(). By default VSC
>>>> (vendor-specific-capability) in config space is checked.
>>>>
>>>> Due to qemu's config space check for VSC, live migration is broken across NVIDIA
>>>> vGPU devices in situation where source and destination host driver is different.
>>>> In this situation, Vendor Specific Information in VSC varies on the destination
>>>> to ensure vGPU feature capabilities exposed to the guest driver are compatible
>>>> with destination host.
>>>>
>>>> If a vfio-pci device is migration capable and vfio-pci vendor driver is OK with
>>>> volatile Vendor Specific Info in VSC then qemu should exempt config space check
>>>> for Vendor Specific Info. It is vendor driver's responsibility to ensure that
>>>> VSC is consistent across migration. Here consistency could mean that VSC format
>>>> should be same on source and destination, however actual Vendor Specific Info
>>>> may not be byte-to-byte identical.
>>>>
>>>> This patch skips the check for Vendor Specific Information in VSC for VFIO-PCI
>>>> device by clearing pdev->cmask[] offsets. Config space check is still enforced
>>>> for 3 byte VSC header. If cmask[] is not set for an offset, then qemu skips
>>>> config space check for that offset.
>>>>
>>>> Signed-off-by: Vinayak Kale <vkale@nvidia.com>
>>>> ---
>>>> Version History
>>>> v2->v3:
>>>> - Config space check skipped only for Vendor Specific Info in VSC, check is
>>>> still enforced for 3 byte VSC header.
>>>> - Updated commit description with live migration failure scenario.
>>>> v1->v2:
>>>> - Limited scope of change to vfio-pci devices instead of all pci devices.
>>>>
>>>> hw/vfio/pci.c | 24 ++++++++++++++++++++++++
>>>> 1 file changed, 24 insertions(+)
>>>
>>>
>>> Acked-by: Alex Williamson <alex.williamson@redhat.com>
>>
>>
>> A very reasonable way to do it.
>>
>> Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
>>
>> Merge through the VFIO tree I presume?
>
> Yep, Cédric said he´d grab it for 9.1. Thanks,
Applied to vfio-next.
Thanks,
C.
next prev parent reply other threads:[~2024-03-28 9:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-22 6:42 [PATCH v3] vfio/pci: migration: Skip config space check for Vendor Specific Information in VSC during restore/load Vinayak Kale
2024-03-27 17:39 ` Alex Williamson
2024-03-27 20:11 ` Michael S. Tsirkin
2024-03-27 20:52 ` Alex Williamson
2024-03-28 9:30 ` Cédric Le Goater [this message]
2024-04-29 12:40 ` Cédric Le Goater
2024-04-30 10:10 ` Vinayak Kale
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=10a42156-067e-4dc1-8467-b840595b38fa@redhat.com \
--to=clg@redhat.com \
--cc=acurrid@nvidia.com \
--cc=alex.williamson@redhat.com \
--cc=avihaih@nvidia.com \
--cc=cjia@nvidia.com \
--cc=kvm@vger.kernel.org \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=targupta@nvidia.com \
--cc=vkale@nvidia.com \
--cc=zhiw@nvidia.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).