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, philmd@linaro.org, david@redhat.com,
	peterx@redhat.com, pbonzini@redhat.com,
	marcel.apfelbaum@gmail.com, den-plotnikov@yandex-team.ru
Subject: Re: [PATCH] pci: make ROM memory resizable
Date: Mon, 24 Apr 2023 17:06:55 -0400	[thread overview]
Message-ID: <20230424170630-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <241d3c11-17bd-4db1-04de-6268031b57df@yandex-team.ru>

On Tue, Apr 25, 2023 at 12:02:49AM +0300, Vladimir Sementsov-Ogievskiy wrote:
> On 24.04.23 23:45, Michael S. Tsirkin wrote:
> > On Mon, Apr 24, 2023 at 04:42:00PM -0400, Michael S. Tsirkin wrote:
> > > On Mon, Apr 24, 2023 at 11:36:47PM +0300, Vladimir Sementsov-Ogievskiy wrote:
> > > > On migration, on target we load local ROM file. But actual ROM content
> > > > migrates through migration channel. Original ROM content from local
> > > > file doesn't matter. But when size mismatch - we have an error like
> > > > 
> > > >   Size mismatch: 0000:00:03.0/virtio-net-pci.rom: 0x40000 != 0x80000: Invalid argument
> > > > 
> > > > Let's just allow resizing of ROM memory. This way migration is not
> > > > relate on local ROM file on target node which is loaded by default but
> > > > is not actually needed.
> > > > 
> > > > Signed-off-by: Vladimir Sementsov-Ogievskiy<vsementsov@yandex-team.ru>
> > Also isn't ROM size reflected in config space etc?
> > I don't remember code that would update that on migration.
> > 
> > 
> 
> Thanks a lot for fast answers!
> 
> Hmm. I'm a newbie in these things.
> 
> But yes, I noted, that my patch helps, if, for example jump from 200K to 500K zero-filled ROM file. But if jump to 600K, migration fails with
> 
> (qemu) qemu: get_pci_config_device: Bad config data: i=0x32 read: b8 device: 0 cmask: ff wmask: f0 w1cmask:0
> qemu: Failed to load PCIDevice:config
> qemu: Failed to load virtio-net:virtio
> qemu: error while loading state for instance 0x0 of device '0000:00:03.0/virtio-net'
> qemu: load of migration failed: Invalid argument
> 
> 
> I thought, that, maybe, romfile for this device just mustn't be more than 512K where config starts. But now I think that it's exactly the problem you are saying about.
> 
> 
> I know also, that there were another step around this problem: 08b1df8ff463e72b087 "pci: add romsize property".. But it doesn't help when you already have a running instance with small ROM and want to migrate it to the node where you have corresponding local ROM file updated to new package with bigger size.
> 

set romsize on destination?

> Hmm. So, simply reuse "resizable" memory blocks doesn't help. And I need more precise reinitialization of device on load of incoming migration..
> 
> -- 
> Best regards,
> Vladimir



  reply	other threads:[~2023-04-24 21:07 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-24 20:36 [PATCH] pci: make ROM memory resizable Vladimir Sementsov-Ogievskiy
2023-04-24 20:41 ` Michael S. Tsirkin
2023-04-24 20:45   ` Michael S. Tsirkin
2023-04-24 21:02     ` Vladimir Sementsov-Ogievskiy
2023-04-24 21:06       ` Michael S. Tsirkin [this message]
2023-04-24 21:33         ` Vladimir Sementsov-Ogievskiy
2023-04-24 20:48   ` Vladimir Sementsov-Ogievskiy
2023-04-25  7:26 ` Michael S. Tsirkin
2023-04-25  7:43   ` Michael S. Tsirkin
2023-04-25  8:34     ` Vladimir Sementsov-Ogievskiy
2023-04-25 12:49       ` Michael S. Tsirkin
2023-04-25 10:18   ` Laszlo Ersek
2023-04-25 12:10   ` Gerd Hoffmann
2023-04-25 12:59     ` Vladimir Sementsov-Ogievskiy
2023-04-25 13:18       ` Gerd Hoffmann
2023-04-25 10:55 ` Vladimir Sementsov-Ogievskiy
2023-04-25 12:18   ` Igor Mammedov

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=20230424170630-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=david@redhat.com \
    --cc=den-plotnikov@yandex-team.ru \
    --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.