diff options
author | Claudio Fontana | 2021-02-04 17:39:24 +0100 |
---|---|---|
committer | Richard Henderson | 2021-02-05 21:24:15 +0100 |
commit | 940e43aa30e0f793bd18b79221296cdf17724018 (patch) | |
tree | 9ab6484293ad85368f66aaf72ee944493cf3913c /accel/tcg | |
parent | cpu: tcg_ops: move to tcg-cpu-ops.h, keep a pointer in CPUClass (diff) | |
download | qemu-940e43aa30e0f793bd18b79221296cdf17724018.tar.gz qemu-940e43aa30e0f793bd18b79221296cdf17724018.tar.xz qemu-940e43aa30e0f793bd18b79221296cdf17724018.zip |
accel: extend AccelState and AccelClass to user-mode
Signed-off-by: Claudio Fontana <cfontana@suse.de>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
[claudio: rebased on Richard's splitwx work]
Signed-off-by: Claudio Fontana <cfontana@suse.de>
Message-Id: <20210204163931.7358-17-cfontana@suse.de>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'accel/tcg')
-rw-r--r-- | accel/tcg/meson.build | 2 | ||||
-rw-r--r-- | accel/tcg/tcg-all.c | 15 |
2 files changed, 13 insertions, 4 deletions
diff --git a/accel/tcg/meson.build b/accel/tcg/meson.build index f39aab0a0c..424d9bb1fc 100644 --- a/accel/tcg/meson.build +++ b/accel/tcg/meson.build @@ -1,5 +1,6 @@ tcg_ss = ss.source_set() tcg_ss.add(files( + 'tcg-all.c', 'cpu-exec-common.c', 'cpu-exec.c', 'tcg-runtime-gvec.c', @@ -13,7 +14,6 @@ tcg_ss.add(when: 'CONFIG_PLUGIN', if_true: [files('plugin-gen.c'), libdl]) specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_ss) specific_ss.add(when: ['CONFIG_SOFTMMU', 'CONFIG_TCG'], if_true: files( - 'tcg-all.c', 'cputlb.c', 'tcg-cpus.c', 'tcg-cpus-mttcg.c', diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index 2eea8c32ee..642a7b94a7 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -30,9 +30,12 @@ #include "tcg/tcg.h" #include "qapi/error.h" #include "qemu/error-report.h" -#include "hw/boards.h" +#include "qemu/accel.h" #include "qapi/qapi-builtin-visit.h" + +#ifndef CONFIG_USER_ONLY #include "tcg-cpus.h" +#endif /* CONFIG_USER_ONLY */ struct TCGState { AccelState parent_obj; @@ -97,7 +100,7 @@ static void tcg_accel_instance_init(Object *obj) s->mttcg_enabled = default_mttcg_enabled(); /* If debugging enabled, default "auto on", otherwise off. */ -#ifdef CONFIG_DEBUG_TCG +#if defined(CONFIG_DEBUG_TCG) && !defined(CONFIG_USER_ONLY) s->splitwx_enabled = -1; #else s->splitwx_enabled = 0; @@ -114,8 +117,12 @@ static int tcg_init(MachineState *ms) mttcg_enabled = s->mttcg_enabled; /* - * Initialize TCG regions + * Initialize TCG regions only for softmmu. + * + * This needs to be done later for user mode, because the prologue + * generation needs to be delayed so that GUEST_BASE is already set. */ +#ifndef CONFIG_USER_ONLY tcg_region_init(); if (mttcg_enabled) { @@ -125,6 +132,8 @@ static int tcg_init(MachineState *ms) } else { cpus_register_accel(&tcg_cpus_rr); } +#endif /* !CONFIG_USER_ONLY */ + return 0; } |