From: Igor Mammedov <imammedo@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "QEMU Developers" <qemu-devel@nongnu.org>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Niek Linnenbank" <nieklinnenbank@gmail.com>,
"Howard Spoelstra" <hsp.cat7@gmail.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Richard Henderson" <rth@twiddle.net>
Subject: Re: [PATCH] softmmu/vl.c: fix too slow TCG regression
Date: Thu, 27 Feb 2020 10:55:32 +0100 [thread overview]
Message-ID: <20200227105532.0b4c730a@redhat.com> (raw)
In-Reply-To: <CAFEAcA9BTrC_OOTRboydOFn6GFsyKzqUNEExw5VRXmRsYvoXYA@mail.gmail.com>
On Thu, 27 Feb 2020 09:15:00 +0000
Peter Maydell <peter.maydell@linaro.org> wrote:
> On Wed, 26 Feb 2020 at 16:35, Igor Mammedov <imammedo@redhat.com> wrote:
> >
> > Commit a1b18df9a4 moved -m option parsing after configure_accelerators()
> > that broke TCG accelerator initialization which accesses global ram_size
> > from size_code_gen_buffer() which is equal to 0 at that moment.
> >
> > Partially revert a1b18df9a4, by returning set_memory_options() to its
> > original location and only keep 32-bit host VA check and 'memory-backend'
> > size check introduced by fe64d06afc at current place.
> >
> > Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> > ---
> >
> > PS:
> > This should take care of regression and give more time to think about
> > how to remove size_code_gen_buffer() dependency on ram_size
>
> > + if (current_machine->ram_memdev_id) {
> > + Object *backend;
> > + ram_addr_t backend_size;
> > +
> > + backend = object_resolve_path_type(current_machine->ram_memdev_id,
> > + TYPE_MEMORY_BACKEND, NULL);
> > + backend_size = object_property_get_uint(backend, "size", &error_abort);
> > + if (backend_size != ram_size) {
> > + error_report("Size specified by -m option must match size of "
> > + "explicitly specified 'memory-backend' property");
> > + exit(EXIT_FAILURE);
> > + }
> > + ram_size = backend_size;
>
> Why do we do this assignment? We've just checked that
> backend_size == ram_size so the assignment won't do
> anything, will it?
>
> In the version of this check in set_memory_options()
> the assignment was useful because the error check
> only happened if mem_str is not NULL, ie there was
> an explicitly specified 'size' option somewhere. It
> looks like now we require the backend size to match
> even if the size is not explicitly specified by the
> user but comes from some default somewhere?
Size might come from default and in that case mem_str
was skipping the check and updating ram_size with backend's
value.
So this patch is not correct, as it is breaking the case
where no "-m" was specified and explicit backend was
provided.
>
> thanks
> -- PMM
>
prev parent reply other threads:[~2020-02-27 9:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-26 16:35 [PATCH] softmmu/vl.c: fix too slow TCG regression Igor Mammedov
2020-02-26 18:21 ` Alex Bennée
2020-02-26 19:51 ` Niek Linnenbank
2020-02-27 9:15 ` Peter Maydell
2020-02-27 9:55 ` Igor Mammedov [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=20200227105532.0b4c730a@redhat.com \
--to=imammedo@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=f4bug@amsat.org \
--cc=hsp.cat7@gmail.com \
--cc=nieklinnenbank@gmail.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--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 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.