mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-15 14:13:31 -06:00
linux-user/main: Allow setting tb-size
While qemu-system can set tb-size using -accel tcg,tb-size=n, there is no similar knob for qemu-user. Add one in a way similar to how one-insn-per-tb is already handled. Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-ID: <20240730215532.1442-1-iii@linux.ibm.com>
This commit is contained in:
parent
98c7362b1e
commit
44ed2fd1ea
1 changed files with 12 additions and 0 deletions
|
@ -72,6 +72,7 @@ char *exec_path;
|
||||||
char real_exec_path[PATH_MAX];
|
char real_exec_path[PATH_MAX];
|
||||||
|
|
||||||
static bool opt_one_insn_per_tb;
|
static bool opt_one_insn_per_tb;
|
||||||
|
static unsigned long opt_tb_size;
|
||||||
static const char *argv0;
|
static const char *argv0;
|
||||||
static const char *gdbstub;
|
static const char *gdbstub;
|
||||||
static envlist_t *envlist;
|
static envlist_t *envlist;
|
||||||
|
@ -425,6 +426,13 @@ static void handle_arg_one_insn_per_tb(const char *arg)
|
||||||
opt_one_insn_per_tb = true;
|
opt_one_insn_per_tb = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void handle_arg_tb_size(const char *arg)
|
||||||
|
{
|
||||||
|
if (qemu_strtoul(arg, NULL, 0, &opt_tb_size)) {
|
||||||
|
usage(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void handle_arg_strace(const char *arg)
|
static void handle_arg_strace(const char *arg)
|
||||||
{
|
{
|
||||||
enable_strace = true;
|
enable_strace = true;
|
||||||
|
@ -517,6 +525,8 @@ static const struct qemu_argument arg_table[] = {
|
||||||
{"one-insn-per-tb",
|
{"one-insn-per-tb",
|
||||||
"QEMU_ONE_INSN_PER_TB", false, handle_arg_one_insn_per_tb,
|
"QEMU_ONE_INSN_PER_TB", false, handle_arg_one_insn_per_tb,
|
||||||
"", "run with one guest instruction per emulated TB"},
|
"", "run with one guest instruction per emulated TB"},
|
||||||
|
{"tb-size", "QEMU_TB_SIZE", true, handle_arg_tb_size,
|
||||||
|
"size", "TCG translation block cache size"},
|
||||||
{"strace", "QEMU_STRACE", false, handle_arg_strace,
|
{"strace", "QEMU_STRACE", false, handle_arg_strace,
|
||||||
"", "log system calls"},
|
"", "log system calls"},
|
||||||
{"seed", "QEMU_RAND_SEED", true, handle_arg_seed,
|
{"seed", "QEMU_RAND_SEED", true, handle_arg_seed,
|
||||||
|
@ -808,6 +818,8 @@ int main(int argc, char **argv, char **envp)
|
||||||
accel_init_interfaces(ac);
|
accel_init_interfaces(ac);
|
||||||
object_property_set_bool(OBJECT(accel), "one-insn-per-tb",
|
object_property_set_bool(OBJECT(accel), "one-insn-per-tb",
|
||||||
opt_one_insn_per_tb, &error_abort);
|
opt_one_insn_per_tb, &error_abort);
|
||||||
|
object_property_set_int(OBJECT(accel), "tb-size",
|
||||||
|
opt_tb_size, &error_abort);
|
||||||
ac->init_machine(NULL);
|
ac->init_machine(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue