[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 04/15] tcg: change tcg_enabled()
From: |
Yang Zhong |
Subject: |
[Qemu-devel] [PATCH v2 04/15] tcg: change tcg_enabled() |
Date: |
Mon, 3 Jul 2017 18:12:12 +0800 |
Change the tcg_enabled() and make sure user build still enable tcg
even x86 softmmu disable tcg.
Signed-off-by: Yang Zhong <address@hidden>
---
accel/tcg/tcg-all.c | 2 +-
accel/tcg/translate-all.c | 6 +-----
bsd-user/main.c | 1 +
include/qemu-common.h | 7 ++++++-
linux-user/main.c | 2 +-
5 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c
index 1b13bc9..979b68a 100644
--- a/accel/tcg/tcg-all.c
+++ b/accel/tcg/tcg-all.c
@@ -33,7 +33,7 @@
#include "qemu/main-loop.h"
long tcg_tb_size;
-static bool tcg_allowed = true;
+bool tcg_allowed;
#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 f6ad46b..bc75294 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -802,6 +802,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();
@@ -813,11 +814,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/bsd-user/main.c b/bsd-user/main.c
index 04f95dd..276aea7 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -35,6 +35,7 @@
#include "trace/control.h"
#include "glib-compat.h"
+bool tcg_allowed = true;
int singlestep;
unsigned long mmap_min_addr;
unsigned long guest_base;
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);
diff --git a/linux-user/main.c b/linux-user/main.c
index ad03c9e..a11508a 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -38,7 +38,7 @@
#include "glib-compat.h"
char *exec_path;
-
+bool tcg_allowed = true;
int singlestep;
static const char *filename;
static const char *argv0;
--
1.9.1
- Re: [Qemu-devel] [PATCH v2 01/15] configure: add the disable-tcg option, (continued)
- Re: [Qemu-devel] [PATCH v2 01/15] configure: add the disable-tcg option, Paolo Bonzini, 2017/07/03
- Re: [Qemu-devel] [PATCH v2 01/15] configure: add the disable-tcg option, Daniel P. Berrange, 2017/07/03
- Re: [Qemu-devel] [PATCH v2 01/15] configure: add the disable-tcg option, Paolo Bonzini, 2017/07/03
- Re: [Qemu-devel] [PATCH v2 01/15] configure: add the disable-tcg option, Thomas Huth, 2017/07/03
- Re: [Qemu-devel] [PATCH v2 01/15] configure: add the disable-tcg option, Daniel P. Berrange, 2017/07/03
- Re: [Qemu-devel] [PATCH v2 01/15] configure: add the disable-tcg option, Paolo Bonzini, 2017/07/03
[Qemu-devel] [PATCH v2 02/15] vl: add tcg_enabled() for tcg related code, Yang Zhong, 2017/07/03
[Qemu-devel] [PATCH v2 03/15] tcg: tcg_handle_interrupt() function, Yang Zhong, 2017/07/03
[Qemu-devel] [PATCH v2 04/15] tcg: change tcg_enabled(),
Yang Zhong <=
[Qemu-devel] [PATCH v2 05/15] tcg: move page_size_init() function, Yang Zhong, 2017/07/03
[Qemu-devel] [PATCH v2 07/15] tcg: move cpu_sync_bndcs_hflags() function, Yang Zhong, 2017/07/03
[Qemu-devel] [PATCH v2 06/15] kvmvapic: remove tcg related code, Yang Zhong, 2017/07/03
[Qemu-devel] [PATCH v2 08/15] tcg: make cpu_get_fp80()/cpu_set_fp80() static, Yang Zhong, 2017/07/03
[Qemu-devel] [PATCH v2 09/15] tcg: add the tcg-stub.c file into accel/stubs/, Yang Zhong, 2017/07/03
[Qemu-devel] [PATCH v2 10/15] tcg: move tb related lock functions, Yang Zhong, 2017/07/03
[Qemu-devel] [PATCH v2 11/15] tcg: split cpu_set_mxcsr() and make cpu_set_fpuc() inline, Yang Zhong, 2017/07/03
[Qemu-devel] [PATCH v2 12/15] tcg: disable tcg in CPUX86State struct, Yang Zhong, 2017/07/03