[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 10/47] accel/tcg: Split out PageDesc to internal.h
From: |
Richard Henderson |
Subject: |
[PULL 10/47] accel/tcg: Split out PageDesc to internal.h |
Date: |
Wed, 26 Oct 2022 12:10:39 +1000 |
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
accel/tcg/internal.h | 31 +++++++++++++++++++++++++++++++
accel/tcg/translate-all.c | 31 +------------------------------
2 files changed, 32 insertions(+), 30 deletions(-)
diff --git a/accel/tcg/internal.h b/accel/tcg/internal.h
index dc800fd485..62da49ed52 100644
--- a/accel/tcg/internal.h
+++ b/accel/tcg/internal.h
@@ -11,6 +11,37 @@
#include "exec/exec-all.h"
+/*
+ * Access to the various translations structures need to be serialised
+ * via locks for consistency. In user-mode emulation access to the
+ * memory related structures are protected with mmap_lock.
+ * In !user-mode we use per-page locks.
+ */
+#ifdef CONFIG_SOFTMMU
+#define assert_memory_lock()
+#else
+#define assert_memory_lock() tcg_debug_assert(have_mmap_lock())
+#endif
+
+typedef struct PageDesc {
+ /* list of TBs intersecting this ram page */
+ uintptr_t first_tb;
+#ifdef CONFIG_USER_ONLY
+ unsigned long flags;
+ void *target_data;
+#endif
+#ifdef CONFIG_SOFTMMU
+ QemuSpin lock;
+#endif
+} PageDesc;
+
+PageDesc *page_find_alloc(tb_page_addr_t index, bool alloc);
+
+static inline PageDesc *page_find(tb_page_addr_t index)
+{
+ return page_find_alloc(index, false);
+}
+
TranslationBlock *tb_gen_code(CPUState *cpu, target_ulong pc,
target_ulong cs_base, uint32_t flags,
int cflags);
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index 42385fa032..86848c6743 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -65,30 +65,6 @@
/* make various TB consistency checks */
-/* Access to the various translations structures need to be serialised via
locks
- * for consistency.
- * In user-mode emulation access to the memory related structures are protected
- * with mmap_lock.
- * In !user-mode we use per-page locks.
- */
-#ifdef CONFIG_SOFTMMU
-#define assert_memory_lock()
-#else
-#define assert_memory_lock() tcg_debug_assert(have_mmap_lock())
-#endif
-
-typedef struct PageDesc {
- /* list of TBs intersecting this ram page */
- uintptr_t first_tb;
-#ifdef CONFIG_USER_ONLY
- unsigned long flags;
- void *target_data;
-#endif
-#ifdef CONFIG_SOFTMMU
- QemuSpin lock;
-#endif
-} PageDesc;
-
/**
* struct page_entry - page descriptor entry
* @pd: pointer to the &struct PageDesc of the page this entry represents
@@ -445,7 +421,7 @@ void page_init(void)
#endif
}
-static PageDesc *page_find_alloc(tb_page_addr_t index, bool alloc)
+PageDesc *page_find_alloc(tb_page_addr_t index, bool alloc)
{
PageDesc *pd;
void **lp;
@@ -511,11 +487,6 @@ static PageDesc *page_find_alloc(tb_page_addr_t index,
bool alloc)
return pd + (index & (V_L2_SIZE - 1));
}
-static inline PageDesc *page_find(tb_page_addr_t index)
-{
- return page_find_alloc(index, false);
-}
-
static void page_lock_pair(PageDesc **ret_p1, tb_page_addr_t phys1,
PageDesc **ret_p2, tb_page_addr_t phys2, bool
alloc);
--
2.34.1
- [PULL 00/47] tcg patch queue, Richard Henderson, 2022/10/25
- [PULL 01/47] Revert "accel/tcg: Init TCG cflags in vCPU thread handler", Richard Henderson, 2022/10/25
- [PULL 02/47] tcg/loongarch64: Add direct jump support, Richard Henderson, 2022/10/25
- [PULL 03/47] tcg/aarch64: Remove unused code in tcg_out_op, Richard Henderson, 2022/10/25
- [PULL 05/47] include/qemu/osdep: Add qemu_build_assert, Richard Henderson, 2022/10/25
- [PULL 04/47] accel/tcg: Add a quicker check for breakpoints, Richard Henderson, 2022/10/25
- [PULL 06/47] include/qemu/atomic: Use qemu_build_assert, Richard Henderson, 2022/10/25
- [PULL 08/47] accel/tcg: Make page_alloc_target_data allocation constant, Richard Henderson, 2022/10/25
- [PULL 07/47] include/qemu/thread: Use qatomic_* functions, Richard Henderson, 2022/10/25
- [PULL 09/47] accel/tcg: Remove disabled debug in translate-all.c, Richard Henderson, 2022/10/25
- [PULL 10/47] accel/tcg: Split out PageDesc to internal.h,
Richard Henderson <=
- [PULL 12/47] accel/tcg: Move assert_no_pages_locked to internal.h, Richard Henderson, 2022/10/25
- [PULL 11/47] accel/tcg: Split out tb-maint.c, Richard Henderson, 2022/10/25
- [PULL 13/47] accel/tcg: Drop cpu_get_tb_cpu_state from TARGET_HAS_PRECISE_SMC, Richard Henderson, 2022/10/25
- [PULL 14/47] accel/tcg: Remove duplicate store to tb->page_addr[], Richard Henderson, 2022/10/25
- [PULL 15/47] accel/tcg: Introduce tb_{set_}page_addr{0,1}, Richard Henderson, 2022/10/25
- [PULL 16/47] accel/tcg: Rename tb_invalidate_phys_page, Richard Henderson, 2022/10/25
- [PULL 17/47] accel/tcg: Rename tb_invalidate_phys_page_range and drop end parameter, Richard Henderson, 2022/10/25
- [PULL 18/47] accel/tcg: Unify declarations of tb_invalidate_phys_range, Richard Henderson, 2022/10/25
- [PULL 19/47] accel/tcg: Use tb_invalidate_phys_page in page_set_flags, Richard Henderson, 2022/10/25
- [PULL 20/47] accel/tcg: Call tb_invalidate_phys_page for PAGE_RESET, Richard Henderson, 2022/10/25