[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 06/22] tcg: move page_size_init() function
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 06/22] tcg: move page_size_init() function |
Date: |
Tue, 4 Jul 2017 13:11:59 +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>
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
accel/tcg/translate-all.c | 18 ------------------
exec.c | 20 ++++++++++++++++++++
2 files changed, 20 insertions(+), 18 deletions(-)
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index 93fb923..8428fce 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/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
- [Qemu-devel] [PATCH v4 00/22] add disable-tcg option for x86 build, Paolo Bonzini, 2017/07/04
- [Qemu-devel] [PATCH 03/22] configure: add --disable-tcg configure option, Paolo Bonzini, 2017/07/04
- [Qemu-devel] [PATCH 02/22] configure: early test for supported targets, Paolo Bonzini, 2017/07/04
- [Qemu-devel] [PATCH 04/22] vl: convert -tb-size to qemu_strtoul, Paolo Bonzini, 2017/07/04
- [Qemu-devel] [PATCH 01/22] configure: factor out list of supported Xen/KVM/HAX targets, Paolo Bonzini, 2017/07/04
- [Qemu-devel] [PATCH 06/22] tcg: move page_size_init() function,
Paolo Bonzini <=
- [Qemu-devel] [PATCH 05/22] vl: add tcg_enabled() for tcg related code, Paolo Bonzini, 2017/07/04
- [Qemu-devel] [PATCH 07/22] tcg: tcg_handle_interrupt() function, Paolo Bonzini, 2017/07/04
- [Qemu-devel] [PATCH 08/22] tcg: make tcg_allowed global, Paolo Bonzini, 2017/07/04
- [Qemu-devel] [PATCH 09/22] monitor: disable "info jit" and "info opcount" if !TCG, Paolo Bonzini, 2017/07/04
- [Qemu-devel] [PATCH 10/22] vapic: use tcg_enabled, Paolo Bonzini, 2017/07/04
- [Qemu-devel] [PATCH 11/22] tcg: add the tcg-stub.c file into accel/stubs/, Paolo Bonzini, 2017/07/04
- [Qemu-devel] [PATCH 12/22] tcg: move tb_lock out of translate-all.h, Paolo Bonzini, 2017/07/04
- [Qemu-devel] [PATCH 13/22] exec: elide calls to tb_lock and tb_unlock, Paolo Bonzini, 2017/07/04