[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 27/42] tcg: move page_size_init() function
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 27/42] tcg: move page_size_init() function |
Date: |
Wed, 5 Jul 2017 09:14:30 +0200 |
From: Yang Zhong <address@hidden>
translate-all.c will be disabled if tcg is disabled in the build,
so page_size_init() function and related variables will be moved
to exec.c file.
Signed-off-by: Yang Zhong <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
accel/tcg/translate-all.c | 18 ------------------
accel/tcg/translate-common.c | 3 ---
exec.c | 20 ++++++++++++++++++++
3 files changed, 20 insertions(+), 21 deletions(-)
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index dc7e816..4fda383 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -112,9 +112,6 @@ typedef struct PageDesc {
#define V_L2_BITS 10
#define V_L2_SIZE (1 << V_L2_BITS)
-uintptr_t qemu_host_page_size;
-intptr_t qemu_host_page_mask;
-
/*
* L1 Mapping properties
*/
@@ -363,21 +360,6 @@ bool cpu_restore_state(CPUState *cpu, uintptr_t retaddr)
return r;
}
-void page_size_init(void)
-{
- /* NOTE: we can always suppose that qemu_host_page_size >=
- TARGET_PAGE_SIZE */
- qemu_real_host_page_size = getpagesize();
- qemu_real_host_page_mask = -(intptr_t)qemu_real_host_page_size;
- if (qemu_host_page_size == 0) {
- qemu_host_page_size = qemu_real_host_page_size;
- }
- if (qemu_host_page_size < TARGET_PAGE_SIZE) {
- qemu_host_page_size = TARGET_PAGE_SIZE;
- }
- qemu_host_page_mask = -(intptr_t)qemu_host_page_size;
-}
-
static void page_init(void)
{
page_size_init();
diff --git a/accel/tcg/translate-common.c b/accel/tcg/translate-common.c
index 40fe5a1..e6b8c4c 100644
--- a/accel/tcg/translate-common.c
+++ b/accel/tcg/translate-common.c
@@ -23,9 +23,6 @@
#include "sysemu/cpus.h"
#include "qemu/main-loop.h"
-uintptr_t qemu_real_host_page_size;
-intptr_t qemu_real_host_page_mask;
-
#ifndef CONFIG_USER_ONLY
/* mask must never be zero, except for A20 change call */
static void tcg_handle_interrupt(CPUState *cpu, int mask)
diff --git a/exec.c b/exec.c
index 42ad1ea..ee61915 100644
--- a/exec.c
+++ b/exec.c
@@ -118,6 +118,11 @@ __thread CPUState *current_cpu;
2 = Adaptive rate instruction counting. */
int use_icount;
+uintptr_t qemu_host_page_size;
+intptr_t qemu_host_page_mask;
+uintptr_t qemu_real_host_page_size;
+intptr_t qemu_real_host_page_mask;
+
bool set_preferred_target_page_bits(int bits)
{
/* The target page size is the lowest common denominator for all
@@ -3590,3 +3595,18 @@ err:
}
#endif
+
+void page_size_init(void)
+{
+ /* NOTE: we can always suppose that qemu_host_page_size >=
+ TARGET_PAGE_SIZE */
+ qemu_real_host_page_size = getpagesize();
+ qemu_real_host_page_mask = -(intptr_t)qemu_real_host_page_size;
+ if (qemu_host_page_size == 0) {
+ qemu_host_page_size = qemu_real_host_page_size;
+ }
+ if (qemu_host_page_size < TARGET_PAGE_SIZE) {
+ qemu_host_page_size = TARGET_PAGE_SIZE;
+ }
+ qemu_host_page_mask = -(intptr_t)qemu_host_page_size;
+}
--
1.8.3.1
- Re: [Qemu-devel] [PULL 22/42] configure: factor out list of supported Xen/KVM/HAX targets, (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 <=
- [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, 2017/07/05
- [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