qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jean-Philippe Brucker <jean-philippe@linaro.org>
To: Eric Auger <eric.auger@redhat.com>
Cc: lvivier@redhat.com, Peter Maydell <peter.maydell@linaro.org>,
	thuth@redhat.com, mst@redhat.com, cohuck@redhat.com,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	qemu-devel@nongnu.org, pasic@linux.ibm.com,
	Juan Quintela <quintela@redhat.com>,
	pbonzini@redhat.com
Subject: Re: [PATCH v2 3/4] virtio-iommu: Support bypass domain
Date: Tue, 8 Feb 2022 17:02:37 +0000	[thread overview]
Message-ID: <YgKiLU3VIbTiOtZL@myrica> (raw)
In-Reply-To: <ecfc42a0-15bf-3cde-2711-434fdb40f28d@redhat.com>

On Tue, Feb 08, 2022 at 02:29:21PM +0100, Eric Auger wrote:
> Hi Jean,
> 
> On 2/8/22 2:09 PM, Dr. David Alan Gilbert wrote:
> > * Jean-Philippe Brucker (jean-philippe@linaro.org) wrote:
> >> On Wed, Feb 02, 2022 at 02:21:37PM +0100, Eric Auger wrote:
> >>>>>> diff --git a/hw/virtio/virtio-iommu.c b/hw/virtio/virtio-iommu.c
> >>>>>> index ec02029bb6..a112428c65 100644
> >>>>>> --- a/hw/virtio/virtio-iommu.c
> >>>>>> +++ b/hw/virtio/virtio-iommu.c
> >>>>>> @@ -43,6 +43,7 @@
> >>>>>>  
> >>>>>>  typedef struct VirtIOIOMMUDomain {
> >>>>>>      uint32_t id;
> >>>>>> +    bool bypass;
> >>>>> I am afraid this will break the migration if you don't change
> >>>>> vmstate_domain.
> >>>>>
> >>>>> See static const VMStateDescription vmstate_domain.
> >>>>> Also you need to migrate the new bypass field.
> >>>>>
> >>>>> Logically we should handle this with a vmstate subsection I think to
> >>>>> handle migration of older devices. However I doubt the device has been
> >>>>> used in production environment supporting migration so my guess is we
> >>>>> may skip that burden and just add the missing field. Adding Juan, Dave &
> >>>>> Peter for advices.
> >>>> I'm not sure about users of this; if no one has used it then yeh; you
> >>>> could bump up the version_id to make it a bit clearer.
> >>> Thank you for your input. Yes to me it sounds OK to only bump the
> >>> version_id while adding the new field.
> >> Ok. Just to make sure we're on the same page, this means we don't support
> >> migration from new->old or old->new instances, since the migration stream
> >> doesn't carry a version ID for the virtio-iommu-device and domain
> >> vmstates, as far as I understand. I also believe backward-incompatible
> >> changes are fine this time around, though I don't have much visibility in
> >> what's being used.
> > I think the stream only has it for top level devices; I've not dug into
> > this device.
> Not sure I get what you meant:
> 
> vmstate_virtio_iommu has a version_id. Also vmstate_domain has one.

These version numbers are not sent as part of the stream, unless I missed
it. On the incoming side, virtio_load() calls vmstate_load_state() for
vmstate_virtio_iommu_device and only looks at the internal version number
(dc->vmsd->version_id), it doesn't check version numbers from the stream.
So if the sender is old and the receiver is new, the stream doesn't have a
bypass field but the receiver will assume it does, and will consider the
stream corrupted.

Since we're not concerned about compatibility for the moment, I think we
could just add the bypass field without bumping the version number, the
behavior will be the same.

Thanks,
Jean


  reply	other threads:[~2022-02-08 18:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-27 14:29 [PATCH v2 0/4] virtio-iommu: Support VIRTIO_IOMMU_F_BYPASS_CONFIG Jean-Philippe Brucker
2022-01-27 14:29 ` [PATCH v2 1/4] linux-headers: update to v5.17-rc1 Jean-Philippe Brucker
2022-01-31  9:14   ` Eric Auger
2022-01-27 14:29 ` [PATCH v2 2/4] virtio-iommu: Default to bypass during boot Jean-Philippe Brucker
2022-01-31  9:14   ` Eric Auger
2022-02-08 17:42   ` Cornelia Huck
2022-02-08 21:07     ` Michael S. Tsirkin
2022-02-09 11:10       ` Cornelia Huck
2022-02-09 11:32         ` Eric Auger
2022-02-09 12:48           ` Cornelia Huck
2022-01-27 14:29 ` [PATCH v2 3/4] virtio-iommu: Support bypass domain Jean-Philippe Brucker
2022-01-31  9:22   ` Eric Auger
2022-01-31 13:07     ` Dr. David Alan Gilbert
2022-02-02 13:21       ` Eric Auger
2022-02-08 12:30         ` Jean-Philippe Brucker
2022-02-08 13:09           ` Dr. David Alan Gilbert
2022-02-08 13:29             ` Eric Auger
2022-02-08 17:02               ` Jean-Philippe Brucker [this message]
2022-01-27 14:29 ` [PATCH v2 4/4] tests/qtest/virtio-iommu-test: Check bypass config Jean-Philippe Brucker
2022-01-31  9:14   ` Eric Auger

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=YgKiLU3VIbTiOtZL@myrica \
    --to=jean-philippe@linaro.org \
    --cc=cohuck@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=eric.auger@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=mst@redhat.com \
    --cc=pasic@linux.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=thuth@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).