From: Peter Xu <peterx@redhat.com>
To: Catherine Ho <catherine.hecx@gmail.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Richard Henderson <rth@twiddle.net>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
Markus Armbruster <armbru@redhat.com>,
Juan Quintela <quintela@redhat.com>,
QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v2] migration: avoid filling ignore-shared ramblock when in incoming migration
Date: Thu, 4 Apr 2019 17:45:50 +0800 [thread overview]
Message-ID: <20190404094550.GD23212@xz-x1> (raw)
In-Reply-To: <CAEn6zmH91NvHySpA32GY4m-1W=r2NHF2Y4-b-+XTADBjkYxNAQ@mail.gmail.com>
On Thu, Apr 04, 2019 at 03:33:20PM +0800, Catherine Ho wrote:
> Hi Peter Xu
>
> On Thu, 4 Apr 2019 at 12:25, Peter Xu <peterx@redhat.com> wrote:
>
> > On Wed, Apr 03, 2019 at 11:21:47PM +0800, Catherine Ho wrote:
> > > Hi Peter Xu
> > >
> > > On Wed, 3 Apr 2019 at 10:25, Peter Xu <peterx@redhat.com> wrote:
> > >
> > > > On Tue, Apr 02, 2019 at 11:30:01AM -0400, Catherine Ho wrote:
> > > > > Commit 18269069c310 ("migration: Introduce ignore-shared capability")
> > > > > addes ignore-shared capability to bypass the shared ramblock (e,g,
> > > > > membackend + numa node). It does good to live migration.
> > > > >
> > > > > This commit expectes that QEMU doesn't write to guest RAM until
> > > > > VM starts, but it does on aarch64 qemu:
> > > > > Backtrace:
> > > > > 1 0x000055f4a296dd84 in address_space_write_rom_internal () at
> > > > exec.c:3458
> > > > > 2 0x000055f4a296de3a in address_space_write_rom () at exec.c:3479
> > > > > 3 0x000055f4a2d519ff in rom_reset () at hw/core/loader.c:1101
> > > > > 4 0x000055f4a2d475ec in qemu_devices_reset () at hw/core/reset.c:69
> > > > > 5 0x000055f4a2c90a28 in qemu_system_reset () at vl.c:1675
> > > > > 6 0x000055f4a2c9851d in main () at vl.c:4552
> > > > >
> > > > > Actually, on arm64 virt marchine, ramblock "dtb" will be filled into
> > ram
> > > > > during rom_reset. In ignore-shared incoming case, this rom filling
> > > > > is not required since all the data has been stored in memory backend
> > > > file.
> > > > >
> > > > > Fixes: commit 18269069c310 ("migration: Introduce ignore-shared
> > > > capability")
> > > > > Signed-off-by: Catherine Ho <catherine.hecx@gmail.com>
> > > > > Suggested-by: Yury Kotov <yury-kotov@yandex-team.ru>
> > > >
> > > > (note: IIUC normally you should have your signed-off to be the last
> > > > line before the suggested-by :)
> > > >
> > > > About the patch content, I have had a question on whether we should
> > > > need to check ignore-shared at all... That question lies in:
> > > >
> > > > https://patchwork.kernel.org/patch/10859889/#22546487
> > > >
> > > > And if my understanding was correct above, IMHO the patch could be as
> > > > simply be as "if (runstate_check(RUN_STATE_INMIGRATE)) return;" at [1]
> > > > below.
> > > >
> > > >
> > > Thanks, but I thought this method would break the x86 rom_reset logic
> > during
> > > RUN_STATE_INMIGRATE.
> > > Please see the debugging patch and log lines below:
> > > diff --git a/hw/core/loader.c b/hw/core/loader.c
> > > index fe5cb24122..b0c871af26 100644
> > > --- a/hw/core/loader.c
> > > +++ b/hw/core/loader.c
> > > @@ -1086,8 +1086,9 @@ int rom_add_option(const char *file, int32_t
> > > bootindex)
> > > static void rom_reset(void *unused)
> > > {
> > > Rom *rom;
> > > -
> > > QTAILQ_FOREACH(rom, &roms, next) {
> > > + if (runstate_check(RUN_STATE_INMIGRATE))
> > > + printf("rom name=%s\n",rom->name);
> > > if (rom->fw_file) {
> > > continue;
> > > }
> > >
> > > rom name=kvmvapic.bin
> > > rom name=linuxboot_dma.bin
> > > rom name=bios-256k.bin
> > > rom name=etc/acpi/tables
> > > rom name=etc/table-loader
> > > rom name=etc/acpi/rsdp
> >
> > Hi, Catherine,
> >
> > I only see that rom names were dumped. Could you help explain what is
> > broken? Thanks,
> >
> > Sorry, I have another concern here. What if there is no memory_backend
> file?
> If there is no memory backend file (i.e. without -object
> memory-backend-file,id=dimm1,size=512M,mem-path=/path/memory)
>
> Should the rom blobs still be written into ram in such case?
Please see my previous reply - I think it shouldn't be needed because
we should migrate very soon after this point for those RAM. In other
words, IIUC even if we do rom_reset() now with these ROMs then the RAM
data should be re-filled again too with the migration stream coming in.
Regards,
--
Peter Xu
prev parent reply other threads:[~2019-04-04 9:55 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1553010562-13561-1-git-send-email-catherine.hecx@gmail.com>
[not found] ` <20190320050735.GB8956@xz-x1>
[not found] ` <CAEn6zmEzwQD_Ot8sttJj0KwML3Zkhfg9+QBxbOLn6bUsDpVn7w@mail.gmail.com>
[not found] ` <20190321061024.GB9149@xz-x1>
[not found] ` <CAEn6zmGFv+UbhyriwakFKB=UhnC6=thhybDF9D1E9JzoYL-1oA@mail.gmail.com>
[not found] ` <CAFEAcA8q0c5BFh-11KNRJWCi6+Yer_5peekmQptmaw8Ag3SNhw@mail.gmail.com>
[not found] ` <20190322101211.GA2703@work-vm>
[not found] ` <20190325033948.GG9149@xz-x1>
[not found] ` <CAEn6zmF0DRqqUxjKpdxWYdb_ofGXV_wACfELA991qLfvo9N6vA@mail.gmail.com>
2019-04-02 2:57 ` [Qemu-devel] [PATCH] migration: avoid copying ignore-shared ramblock when in incoming migration Catherine Ho
2019-04-02 3:05 ` Peter Maydell
2019-04-02 7:47 ` Catherine Ho
2019-04-02 7:49 ` Catherine Ho
2019-04-02 7:51 ` Peter Maydell
2019-04-02 7:58 ` Peter Xu
2019-04-02 9:06 ` Catherine Ho
2019-04-02 12:36 ` Peter Xu
2019-04-02 14:17 ` Catherine Ho
2019-04-02 14:33 ` Catherine Ho
2019-04-02 17:37 ` Dr. David Alan Gilbert
2019-04-02 15:30 ` [Qemu-devel] [PATCH v2] migration: avoid filling " Catherine Ho
2019-04-03 2:25 ` Peter Xu
2019-04-03 15:21 ` Catherine Ho
2019-04-04 4:25 ` Peter Xu
2019-04-04 7:17 ` Catherine Ho
2019-04-04 7:31 ` Peter Xu
2019-04-04 7:33 ` Catherine Ho
2019-04-04 9:45 ` Peter Xu [this message]
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=20190404094550.GD23212@xz-x1 \
--to=peterx@redhat.com \
--cc=armbru@redhat.com \
--cc=catherine.hecx@gmail.com \
--cc=dgilbert@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=rth@twiddle.net \
/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).