From: Igor Mammedov <imammedo@redhat.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, f4bug@amsat.org,
nieklinnenbank@gmail.com, hsp.cat7@gmail.com,
pbonzini@redhat.com, alex.bennee@linaro.org, rth@twiddle.net
Subject: [PATCH] softmmu/vl.c: fix too slow TCG regression
Date: Wed, 26 Feb 2020 11:35:39 -0500 [thread overview]
Message-ID: <20200226163539.31960-1-imammedo@redhat.com> (raw)
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
---
softmmu/vl.c | 49 +++++++++++++++++++++++++------------------------
1 file changed, 25 insertions(+), 24 deletions(-)
diff --git a/softmmu/vl.c b/softmmu/vl.c
index a9cce78f45..da7577129c 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -2634,29 +2634,6 @@ static void set_memory_options(uint64_t *ram_slots, ram_addr_t *maxram_size,
exit(EXIT_FAILURE);
}
- 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 (mem_str && 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;
- }
-
- if (!xen_enabled()) {
- /* On 32-bit hosts, QEMU is limited by virtual address space */
- if (ram_size > (2047 << 20) && HOST_LONG_BITS == 32) {
- error_report("at most 2047 MB RAM can be simulated");
- exit(1);
- }
- }
-
loc_pop(&loc);
}
@@ -3821,6 +3798,8 @@ void qemu_init(int argc, char **argv, char **envp)
machine_class = select_machine();
object_set_machine_compat_props(machine_class->compat_props);
+ set_memory_options(&ram_slots, &maxram_size, machine_class);
+
os_daemonize();
/*
@@ -4296,7 +4275,29 @@ void qemu_init(int argc, char **argv, char **envp)
current_machine->cpu_type = parse_cpu_option(cpu_option);
}
- set_memory_options(&ram_slots, &maxram_size, machine_class);
+ if (!xen_enabled()) {
+ /* On 32-bit hosts, QEMU is limited by virtual address space */
+ if (ram_size > (2047 << 20) && HOST_LONG_BITS == 32) {
+ error_report("at most 2047 MB RAM can be simulated");
+ exit(1);
+ }
+ }
+
+ 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;
+ }
+
current_machine->ram_size = ram_size;
current_machine->maxram_size = maxram_size;
current_machine->ram_slots = ram_slots;
--
2.18.1
next reply other threads:[~2020-02-26 16:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-26 16:35 Igor Mammedov [this message]
2020-02-26 18:21 ` [PATCH] softmmu/vl.c: fix too slow TCG regression Alex Bennée
2020-02-26 19:51 ` Niek Linnenbank
2020-02-27 9:15 ` Peter Maydell
2020-02-27 9:55 ` 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=20200226163539.31960-1-imammedo@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 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).