All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Cc: qemu-devel@nongnu.org, marcel.apfelbaum@gmail.com,
	philmd@linaro.org, david@redhat.com, peterx@redhat.com,
	pbonzini@redhat.com, den-plotnikov@yandex-team.ru,
	lersek@redhat.com, kraxel@redhat.com
Subject: Re: [PATCH 3/3] pci: ROM preallocation for incoming migration
Date: Tue, 25 Apr 2023 09:32:54 -0400	[thread overview]
Message-ID: <20230425093235-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <56042897-8efc-d77d-68eb-9af94a8921a5@yandex-team.ru>

On Tue, Apr 25, 2023 at 04:19:12PM +0300, Vladimir Sementsov-Ogievskiy wrote:
> On 25.04.23 16:07, Vladimir Sementsov-Ogievskiy wrote:
> > On 25.04.23 15:43, Michael S. Tsirkin wrote:
> > > On Tue, Apr 25, 2023 at 01:56:03PM +0300, Vladimir Sementsov-Ogievskiy wrote:
> > > > On incoming migration we have the following sequence to load option
> > > > ROM:
> > > > 
> > > > 1. On device realize we do normal load ROM from the file
> > > > 
> > > > 2. Than, on incoming migration we rewrite ROM from the incoming RAM
> > > >     block. If sizes mismatch we fail.
> > > > 
> > > > This is not ideal when we migrate to updated distribution: we have to
> > > > keep old ROM files in new distribution and be careful around romfile
> > > > property to load correct ROM file. Which is loaded actually just to
> > > > allocate the ROM with correct length.
> > > > 
> > > > Note, that romsize property doesn't really help: if we try to specify
> > > > it when default romfile is larger, it fails with something like:
> > > > 
> > > > romfile "efi-virtio.rom" (160768 bytes) is too large for ROM size 65536
> > > > 
> > > > This commit brings new behavior for romfile="",romsize=SIZE combination
> > > > of options. Current behavior is just ignore romsize and not load or
> > > > create any ROM.
> > > > 
> > > > Let's instead preallocate ROM, not loading any file. This way we can
> > > > migrate old vm to new environment not thinking about ROM files on
> > > > destination host:
> > > > 
> > > > 1. specify romfile="",romsize=SIZE on target, with correct SIZE
> > > >     (actually, size of romfile on source aligned up to power of two, or
> > > >      just original romsize option on source)
> > > > 
> > > > 2. On device realize we just preallocate ROM, and not load any file
> > > > 
> > > > 3. On incoming migration ROM is filled from the migration stream
> > > > 
> > > > As a bonus we avoid extra reading from ROM file on target.
> > > > 
> > > > Signed-off-by: Vladimir Sementsov-Ogievskiy<vsementsov@yandex-team.ru>
> > > why is this a bad idea:
> > > - on source presumably user overrides romfile
> > > - we have a general rule that source and destination flags must match
> > > 
> > > I propose instead to ignore romfile if qemu is incoming migration
> > > and romsize has been specified.
> > > 
> > 
> > Hmm, that would work even better, as no additional options needed, thanks. I'll resend
> > 
> 
> romsize needed anyway, of course.

yes but it can match on source and dest.

> -- 
> Best regards,
> Vladimir



  reply	other threads:[~2023-04-25 13:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-25 10:56 [PATCH 0/3] ROM migration Vladimir Sementsov-Ogievskiy
2023-04-25 10:56 ` [PATCH 1/3] pci: pci_add_option_rom(): improve style Vladimir Sementsov-Ogievskiy
2023-04-25 10:56 ` [PATCH 2/3] pci: pci_add_option_rom(): refactor: use g_autofree for path variable Vladimir Sementsov-Ogievskiy
2023-04-25 10:56 ` [PATCH 3/3] pci: ROM preallocation for incoming migration Vladimir Sementsov-Ogievskiy
2023-04-25 12:43   ` Michael S. Tsirkin
2023-04-25 13:07     ` Vladimir Sementsov-Ogievskiy
2023-04-25 13:19       ` Vladimir Sementsov-Ogievskiy
2023-04-25 13:32         ` Michael S. Tsirkin [this message]
2023-04-25 14:55           ` Igor Mammedov
2023-04-25 15:58             ` Vladimir Sementsov-Ogievskiy

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=20230425093235-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=david@redhat.com \
    --cc=den-plotnikov@yandex-team.ru \
    --cc=kraxel@redhat.com \
    --cc=lersek@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@yandex-team.ru \
    /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.