[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 29/42] tcg: make tcg_allowed global
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 29/42] tcg: make tcg_allowed global |
Date: |
Wed, 5 Jul 2017 09:14:32 +0200 |
From: Yang Zhong <address@hidden>
Change the tcg_enabled() and make sure user build still enable tcg
even x86 softmmu disable tcg.
Signed-off-by: Yang Zhong <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
accel/tcg/cpu-exec-common.c | 2 ++
accel/tcg/tcg-all.c | 1 -
accel/tcg/translate-all.c | 6 +-----
include/qemu-common.h | 7 ++++++-
4 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/accel/tcg/cpu-exec-common.c b/accel/tcg/cpu-exec-common.c
index e81da27..5b4ae54 100644
--- a/accel/tcg/cpu-exec-common.c
+++ b/accel/tcg/cpu-exec-common.c
@@ -23,6 +23,8 @@
#include "exec/exec-all.h"
#include "exec/memory-internal.h"
+bool tcg_allowed;
+
/* exit the current TB, but without causing any exception to be raised */
void cpu_loop_exit_noexc(CPUState *cpu)
{
diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c
index c1ccad3..56dbb56 100644
--- a/accel/tcg/tcg-all.c
+++ b/accel/tcg/tcg-all.c
@@ -33,7 +33,6 @@
#include "qemu/main-loop.h"
unsigned long tcg_tb_size;
-static bool tcg_allowed = true;
#ifndef CONFIG_USER_ONLY
/* mask must never be zero, except for A20 change call */
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index 4fda383..f768681 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -784,6 +784,7 @@ static void tb_htable_init(void)
size. */
void tcg_exec_init(unsigned long tb_size)
{
+ tcg_allowed = true;
cpu_gen_init();
page_init();
tb_htable_init();
@@ -795,11 +796,6 @@ void tcg_exec_init(unsigned long tb_size)
#endif
}
-bool tcg_enabled(void)
-{
- return tcg_ctx.code_gen_buffer != NULL;
-}
-
/*
* Allocate a new translation block. Flush the translation buffer if
* too many translation blocks or too much generated code.
diff --git a/include/qemu-common.h b/include/qemu-common.h
index 387ef52..b5adbfa 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -76,8 +76,13 @@ int qemu_openpty_raw(int *aslave, char *pty_name);
sendto(sockfd, buf, len, flags, destaddr, addrlen)
#endif
+extern bool tcg_allowed;
void tcg_exec_init(unsigned long tb_size);
-bool tcg_enabled(void);
+#ifdef CONFIG_TCG
+#define tcg_enabled() (tcg_allowed)
+#else
+#define tcg_enabled() 0
+#endif
void cpu_exec_init_all(void);
void cpu_exec_step_atomic(CPUState *cpu);
--
1.8.3.1
- Re: [Qemu-devel] [PULL 24/42] configure: add --disable-tcg configure option, (continued)
[Qemu-devel] [PULL 26/42] vl: add tcg_enabled() for tcg related code, Paolo Bonzini, 2017/07/05
[Qemu-devel] [PULL 21/42] qemu-doc: do not refer to years-old version numbers, Paolo Bonzini, 2017/07/05
[Qemu-devel] [PULL 23/42] configure: early test for supported targets, Paolo Bonzini, 2017/07/05
[Qemu-devel] [PULL 20/42] qemu-thread: Assert locks are initialized before using, Paolo Bonzini, 2017/07/05
[Qemu-devel] [PULL 25/42] vl: convert -tb-size to qemu_strtoul, Paolo Bonzini, 2017/07/05
[Qemu-devel] [PULL 27/42] tcg: move page_size_init() function, Paolo Bonzini, 2017/07/05
[Qemu-devel] [PULL 28/42] cpu: move interrupt handling out of translate-common.c, Paolo Bonzini, 2017/07/05
[Qemu-devel] [PULL 29/42] tcg: make tcg_allowed global,
Paolo Bonzini <=
[Qemu-devel] [PULL 32/42] tcg: add the tcg-stub.c file into accel/stubs/, Paolo Bonzini, 2017/07/05
[Qemu-devel] [PULL 31/42] vapic: use tcg_enabled, Paolo Bonzini, 2017/07/05
[Qemu-devel] [PULL 30/42] monitor: disable "info jit" and "info opcount" if !TCG, Paolo Bonzini, 2017/07/05
[Qemu-devel] [PULL 33/42] tcg: move tb_lock out of translate-all.h, Paolo Bonzini, 2017/07/05
[Qemu-devel] [PULL 37/42] target/i386: move cpu_sync_bndcs_hflags() function, Paolo Bonzini, 2017/07/05
[Qemu-devel] [PULL 34/42] exec: elide calls to tb_lock and tb_unlock, Paolo Bonzini, 2017/07/05
[Qemu-devel] [PULL 36/42] tcg: add the CONFIG_TCG into Makefiles, Paolo Bonzini, 2017/07/05
[Qemu-devel] [PULL 35/42] tcg: add CONFIG_TCG guards in headers, Paolo Bonzini, 2017/07/05
[Qemu-devel] [PULL 38/42] target/i386: make cpu_get_fp80()/cpu_set_fp80() static, Paolo Bonzini, 2017/07/05
[Qemu-devel] [PULL 41/42] target/i386: add the tcg_enabled() in target/i386/, Paolo Bonzini, 2017/07/05