From: Warner Losh <imp@bsdimp.com>
To: qemu-devel@nongnu.org
Cc: "Warner Losh" <imp@bsdimp.com>,
"Jessica Clarke" <jrtc27@jrtc27.com>,
"Kyle Evans" <kevans@freebsd.org>,
"Ilya Leoshkevich" <iii@linux.ibm.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PULL 2/3] bsd-user/main: Allow setting tb-size
Date: Mon, 4 Nov 2024 20:40:38 -0700 [thread overview]
Message-ID: <20241105034039.31143-3-imp@bsdimp.com> (raw)
In-Reply-To: <20241105034039.31143-1-imp@bsdimp.com>
From: Ilya Leoshkevich <iii@linux.ibm.com>
While qemu-system can set tb-size using -accel tcg,tb-size=n, there
is no similar knob for qemu-bsd-user. Add one in a way similar to how
one-insn-per-tb is already handled.
Suggested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Signed-off-by: Warner Losh <imp@bsdimp.com>
---
bsd-user/main.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/bsd-user/main.c b/bsd-user/main.c
index cc980e6f401..7c230b0c7a5 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -60,6 +60,7 @@ uintptr_t qemu_host_page_size;
intptr_t qemu_host_page_mask;
static bool opt_one_insn_per_tb;
+static unsigned long opt_tb_size;
uintptr_t guest_base;
bool have_guest_base;
/*
@@ -169,6 +170,7 @@ static void usage(void)
" (use '-d help' for a list of log items)\n"
"-D logfile write logs to 'logfile' (default stderr)\n"
"-one-insn-per-tb run with one guest instruction per emulated TB\n"
+ "-tb-size size TCG translation block cache size\n"
"-strace log system calls\n"
"-trace [[enable=]<pattern>][,events=<file>][,file=<file>]\n"
" specify tracing options\n"
@@ -387,6 +389,11 @@ int main(int argc, char **argv)
seed_optarg = optarg;
} else if (!strcmp(r, "one-insn-per-tb")) {
opt_one_insn_per_tb = true;
+ } else if (!strcmp(r, "tb-size")) {
+ r = argv[optind++];
+ if (qemu_strtoul(r, NULL, 0, &opt_tb_size)) {
+ usage();
+ }
} else if (!strcmp(r, "strace")) {
do_strace = 1;
} else if (!strcmp(r, "trace")) {
@@ -452,6 +459,8 @@ int main(int argc, char **argv)
accel_init_interfaces(ac);
object_property_set_bool(OBJECT(accel), "one-insn-per-tb",
opt_one_insn_per_tb, &error_abort);
+ object_property_set_int(OBJECT(accel), "tb-size",
+ opt_tb_size, &error_abort);
ac->init_machine(NULL);
}
--
2.46.1
next prev parent reply other threads:[~2024-11-05 3:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-05 3:40 [PULL 0/3] Bsd user 2024q4 patches Warner Losh
2024-11-05 3:40 ` [PULL 1/3] bsd-user/x86_64/target_arch_thread.h: Align stack Warner Losh
2024-11-05 3:40 ` Warner Losh [this message]
2024-11-05 3:40 ` [PULL 3/3] bsd-user: Set TaskState ts_tid for initial threads Warner Losh
2024-11-06 17:27 ` [PULL 0/3] Bsd user 2024q4 patches Peter Maydell
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=20241105034039.31143-3-imp@bsdimp.com \
--to=imp@bsdimp.com \
--cc=iii@linux.ibm.com \
--cc=jrtc27@jrtc27.com \
--cc=kevans@freebsd.org \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
/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).