All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: Fabiano Rosas <farosas@suse.de>
Cc: qemu-devel@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>,
	"Stefano Garzarella" <sgarzare@redhat.com>,
	김승중 <seungjung0711@gmail.com>,
	"Alexandr Moshkov" <dtalexundeer@yandex-team.ru>
Subject: Re: [PATCH] vhost/migration: Fix incorrect size used in inflight->addr in VMSD
Date: Wed, 29 Jul 2026 13:40:06 -0400	[thread overview]
Message-ID: <amo69qbbLChFBaUY@x1.local> (raw)
In-Reply-To: <875x1xojtk.fsf@suse.de>

On Wed, Jul 29, 2026 at 01:13:27PM -0300, Fabiano Rosas wrote:
> Peter Xu <peterx@redhat.com> writes:
> 
> > On Wed, Jul 29, 2026 at 11:27:44AM -0300, Fabiano Rosas wrote:
> >> Hm, but isn't it better to have a global cap anyway? So we don't need
> >> every device code to change with similar checks.
> >> 
> >> > If we go this route, I'd rather merge Michael's version to support u64,
> >> > even if we don't need a u64 size.  But I really don't want to introduce yet
> >> > another VMS flag just for this... we'll have no real use if we have noticed
> >> > this problem when the vhost inflight patch was reviewed.  It will be a
> >> > uint32_t or int32_t already.  I just can't come up with some users need
> >> > size >2G.
> >> >
> >> 
> >> I agree with making all u64. I think we can actually remove all the
> >> extra VMS_VARRAY_* and VBUFFER_* flags and instead doa single type-check
> >> of "int <= 64bit". Give me a couple of hours and I will post an RFC.
> >
> > I confess I don't yet get what is the global cap you mentioned.. but sure,
> > I'll wait and read the RFC first.
> 
> I was thinking the vmstate code could define a limit to the size (of
> anything) and always enforce it. The device code can then use some
> custom macros (not yet existent) to limit even further.

Ah I see.

With 32bit limit (let's assume we don't have that further "it's int32_t"
problem..), it's already throttled to 32bit max.  I added it into vhost
code only because in reality it was a 64bit internally.  None of the rest
users should need it since they should be sticking with 32bit fields.

-- 
Peter Xu



  reply	other threads:[~2026-07-29 17:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-28 15:39 [PATCH] vhost/migration: Fix incorrect size used in inflight->addr in VMSD Peter Xu
2026-07-28 20:57 ` Fabiano Rosas
2026-07-29 14:00   ` Peter Xu
2026-07-29 14:25     ` Michael S. Tsirkin
2026-07-29 14:27     ` Fabiano Rosas
2026-07-29 15:44       ` Peter Xu
2026-07-29 16:13         ` Fabiano Rosas
2026-07-29 17:40           ` Peter Xu [this message]
2026-07-29 17:48           ` Peter Xu
2026-07-28 23:17 ` Michael S. Tsirkin
2026-07-29  7:25 ` Alexandr Moshkov
2026-07-29  8:49   ` Michael S. Tsirkin
2026-07-29 14:16     ` 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=amo69qbbLChFBaUY@x1.local \
    --to=peterx@redhat.com \
    --cc=dtalexundeer@yandex-team.ru \
    --cc=farosas@suse.de \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=seungjung0711@gmail.com \
    --cc=sgarzare@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 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.