aboutsummaryrefslogtreecommitdiff
path: root/linux-user/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux-user/main.c')
-rw-r--r--linux-user/main.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/linux-user/main.c b/linux-user/main.c
index b97634a..5ac5b55 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -40,7 +40,6 @@
#include "qemu/plugin.h"
#include "user/guest-base.h"
#include "user/page-protection.h"
-#include "exec/exec-all.h"
#include "exec/gdbstub.h"
#include "gdbstub/user.h"
#include "tcg/startup.h"
@@ -72,6 +71,7 @@ char *exec_path;
char real_exec_path[PATH_MAX];
static bool opt_one_insn_per_tb;
+static unsigned long opt_tb_size;
static const char *argv0;
static const char *gdbstub;
static envlist_t *envlist;
@@ -122,6 +122,7 @@ static const char *last_log_filename;
#endif
unsigned long reserved_va;
+unsigned long guest_addr_max;
static void usage(int exitcode);
@@ -425,6 +426,13 @@ static void handle_arg_one_insn_per_tb(const char *arg)
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)
{
enable_strace = true;
@@ -517,6 +525,8 @@ static const struct qemu_argument arg_table[] = {
{"one-insn-per-tb",
"QEMU_ONE_INSN_PER_TB", false, handle_arg_one_insn_per_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,
"", "log system calls"},
{"seed", "QEMU_RAND_SEED", true, handle_arg_seed,
@@ -808,6 +818,8 @@ int main(int argc, char **argv, char **envp)
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);
}
@@ -847,6 +859,13 @@ int main(int argc, char **argv, char **envp)
/* MAX_RESERVED_VA + 1 is a large power of 2, so is aligned. */
reserved_va = max_reserved_va;
}
+ if (reserved_va != 0) {
+ guest_addr_max = reserved_va;
+ } else if (MIN(TARGET_VIRT_ADDR_SPACE_BITS, TARGET_ABI_BITS) <= 32) {
+ guest_addr_max = UINT32_MAX;
+ } else {
+ guest_addr_max = ~0ul;
+ }
/*
* Temporarily disable
@@ -1023,12 +1042,7 @@ int main(int argc, char **argv, char **envp)
target_cpu_copy_regs(env, regs);
if (gdbstub) {
- if (gdbserver_start(gdbstub) < 0) {
- fprintf(stderr, "qemu: could not open gdbserver on %s\n",
- gdbstub);
- exit(EXIT_FAILURE);
- }
- gdb_handlesig(cpu, 0, NULL, NULL, 0);
+ gdbserver_start(gdbstub, &error_fatal);
}
#ifdef CONFIG_SEMIHOSTING