All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Cc: virtio-comment@lists.linux.dev
Subject: Re: [PATCH v4 3/3] balloon: add VIRTIO_BALLOON_F_DEVICE_INIT_ON_INFLATE
Date: Fri, 15 May 2026 05:23:37 -0400	[thread overview]
Message-ID: <20260515052118-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <CAAjaMXZggBhThMSrR8-YWx=AZDi00hm9or6CSB+v3xgjvbaotg@mail.gmail.com>

On Fri, May 15, 2026 at 12:09:24PM +0300, Manos Pitsidianakis wrote:
> On Thu, May 7, 2026 at 10:52 AM Michael S. Tsirkin <mst@redhat.com> wrote:
> >
> > Add VIRTIO_BALLOON_F_DEVICE_INIT_ON_INFLATE (bit 7): the device
> > initializes inflated pages and returns a per-page bitmap indicating
> > which pages were successfully initialized.
> >
> > Update Security Considerations Data Integrity subsection to cover
> > both DEVICE_INIT_REPORTED and DEVICE_INIT_ON_INFLATE.
> >
> > Fixes: https://github.com/oasis-tcs/virtio-spec/issues/242
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > ---
> >  device-types/balloon/description.tex | 73 +++++++++++++++++++++++++++-
> >  1 file changed, 71 insertions(+), 2 deletions(-)
> >
> > diff --git a/device-types/balloon/description.tex b/device-types/balloon/description.tex
> > index fa33105..7afdb24 100644
> > --- a/device-types/balloon/description.tex
> > +++ b/device-types/balloon/description.tex
> > @@ -52,6 +52,9 @@ \subsection{Feature bits}\label{sec:Device Types / Memory Balloon Device / Featu
> >  \item[ VIRTIO_BALLOON_F_DEVICE_INIT_REPORTED(6) ] The device initializes
> >      reported pages.
> >
> > +\item[ VIRTIO_BALLOON_F_DEVICE_INIT_ON_INFLATE(7) ] The device initializes
> > +    inflated pages.
> > +
> >  \end{description}
> >
> >  \subsubsection{Feature bit requirements}\label{sec:Device Types / Memory Balloon Device / Feature bits / Feature bit requirements}
> > @@ -249,6 +252,10 @@ \subsection{Device Operation}\label{sec:Device Types / Memory Balloon Device / D
> >  and before detecting its physical number in a deflate request
> >  and acknowledging the deflate request.
> >
> > +If VIRTIO_BALLOON_F_DEVICE_INIT_ON_INFLATE is negotiated, the
> > +device MUST NOT modify a page after reporting it as initialized
> > +in the bitmap.
> > +
> >  \paragraph{Legacy Interface: Device Operation}\label{sec:Device
> >  Types / Memory Balloon Device / Device Operation / Legacy
> >  Interface: Device Operation}
> > @@ -672,6 +679,67 @@ \subsubsection{Device Initialized Reported Pages}\label{sec:Device Types / Memor
> >  If VIRTIO_BALLOON_F_PAGE_POISON is not negotiated, the device
> >  MUST fill each initialized page with zeros.
> >
> > +\subsubsection{Device Initialized Pages on Inflate}\label{sec:Device Types / Memory Balloon Device / Device Operation / Device Initialized Pages on Inflate}
> > +
> > +When VIRTIO_BALLOON_F_DEVICE_INIT_ON_INFLATE is negotiated, the
> > +device initializes inflated pages and reports which pages were
> > +successfully initialized via a per-page bitmap.
> > +
> > +The driver appends a device-writable bitmap buffer to each inflate
> > +descriptor chain, after the PFN outbuf.
> 
> Maybe we could say "page physical number" instead of PFN to stay
> consistent with the rest of the balloon spec.
> 
> > The bitmap contains one
> > +bit per balloon page (4KB), where bit N corresponds to the Nth PFN
> > +in the inflate request (0-indexed). Bit N is stored as bit (N mod 8)
> > +of byte (N / 8), with bit 0 being the least significant bit.
> > +The device sets a bit to 1 if it successfully initialized the
> > +corresponding page, or 0 if it did not.
> 
> Does this mean page size cannot be larger than 4kb?

With legacy balloon, pretty much.
This hack of sticking right-shifted PFNs in an outbuf
is a broken interface that can't even support large guests.
If someone worked on a better one, would be great.
But for now, this just supports zero reporting with that.

-- 
MST


  reply	other threads:[~2026-05-15  9:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-07  7:51 [PATCH v4 0/3] balloon: DEVICE_INIT_REPORTED and DEVICE_INIT_ON_INFLATE Michael S. Tsirkin
2026-05-07  7:51 ` [PATCH v4 1/3] balloon: add Security Considerations section Michael S. Tsirkin
2026-05-15  8:53   ` Manos Pitsidianakis
2026-05-07  7:51 ` [PATCH v4 2/3] balloon: add VIRTIO_BALLOON_F_DEVICE_INIT_REPORTED Michael S. Tsirkin
2026-05-15  9:02   ` Manos Pitsidianakis
2026-05-07  7:51 ` [PATCH v4 3/3] balloon: add VIRTIO_BALLOON_F_DEVICE_INIT_ON_INFLATE Michael S. Tsirkin
2026-05-15  9:09   ` Manos Pitsidianakis
2026-05-15  9:23     ` Michael S. Tsirkin [this message]
2026-05-15  9:28       ` Manos Pitsidianakis
2026-05-15  9:35         ` Michael S. Tsirkin
2026-05-15 10:46           ` Manos Pitsidianakis

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=20260515052118-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=manos.pitsidianakis@linaro.org \
    --cc=virtio-comment@lists.linux.dev \
    /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.