[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 06/17] accel/tcg: move USER code to user-exec.c
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PULL 06/17] accel/tcg: move USER code to user-exec.c |
Date: |
Sun, 17 Sep 2017 08:05:24 -0700 |
From: Philippe Mathieu-Daudé <address@hidden>
Suggested-by: Paolo Bonzini <address@hidden>
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
---
accel/tcg/tcg-runtime.c | 54 -------------------------------------------------
accel/tcg/user-exec.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 52 insertions(+), 54 deletions(-)
diff --git a/accel/tcg/tcg-runtime.c b/accel/tcg/tcg-runtime.c
index 3e23649dd7..aafb171294 100644
--- a/accel/tcg/tcg-runtime.c
+++ b/accel/tcg/tcg-runtime.c
@@ -178,57 +178,3 @@ void HELPER(exit_atomic)(CPUArchState *env)
{
cpu_loop_exit_atomic(ENV_GET_CPU(env), GETPC());
}
-
-#ifndef CONFIG_SOFTMMU
-/* The softmmu versions of these helpers are in cputlb.c. */
-
-/* Do not allow unaligned operations to proceed. Return the host address. */
-static void *atomic_mmu_lookup(CPUArchState *env, target_ulong addr,
- int size, uintptr_t retaddr)
-{
- /* Enforce qemu required alignment. */
- if (unlikely(addr & (size - 1))) {
- cpu_loop_exit_atomic(ENV_GET_CPU(env), retaddr);
- }
- return g2h(addr);
-}
-
-/* Macro to call the above, with local variables from the use context. */
-#define ATOMIC_MMU_LOOKUP atomic_mmu_lookup(env, addr, DATA_SIZE, GETPC())
-
-#define ATOMIC_NAME(X) HELPER(glue(glue(atomic_ ## X, SUFFIX), END))
-#define EXTRA_ARGS
-
-#define DATA_SIZE 1
-#include "atomic_template.h"
-
-#define DATA_SIZE 2
-#include "atomic_template.h"
-
-#define DATA_SIZE 4
-#include "atomic_template.h"
-
-#ifdef CONFIG_ATOMIC64
-#define DATA_SIZE 8
-#include "atomic_template.h"
-#endif
-
-/* The following is only callable from other helpers, and matches up
- with the softmmu version. */
-
-#ifdef CONFIG_ATOMIC128
-
-#undef EXTRA_ARGS
-#undef ATOMIC_NAME
-#undef ATOMIC_MMU_LOOKUP
-
-#define EXTRA_ARGS , TCGMemOpIdx oi, uintptr_t retaddr
-#define ATOMIC_NAME(X) \
- HELPER(glue(glue(glue(atomic_ ## X, SUFFIX), END), _mmu))
-#define ATOMIC_MMU_LOOKUP atomic_mmu_lookup(env, addr, DATA_SIZE, retaddr)
-
-#define DATA_SIZE 16
-#include "atomic_template.h"
-#endif /* CONFIG_ATOMIC128 */
-
-#endif /* !CONFIG_SOFTMMU */
diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c
index 2a975eaf69..492ea0826c 100644
--- a/accel/tcg/user-exec.c
+++ b/accel/tcg/user-exec.c
@@ -24,6 +24,7 @@
#include "qemu/bitops.h"
#include "exec/cpu_ldst.h"
#include "translate-all.h"
+#include "exec/helper-proto.h"
#undef EAX
#undef ECX
@@ -573,3 +574,54 @@ int cpu_signal_handler(int host_signum, void *pinfo,
#error host CPU specific signal handler needed
#endif
+
+/* The softmmu versions of these helpers are in cputlb.c. */
+
+/* Do not allow unaligned operations to proceed. Return the host address. */
+static void *atomic_mmu_lookup(CPUArchState *env, target_ulong addr,
+ int size, uintptr_t retaddr)
+{
+ /* Enforce qemu required alignment. */
+ if (unlikely(addr & (size - 1))) {
+ cpu_loop_exit_atomic(ENV_GET_CPU(env), retaddr);
+ }
+ return g2h(addr);
+}
+
+/* Macro to call the above, with local variables from the use context. */
+#define ATOMIC_MMU_LOOKUP atomic_mmu_lookup(env, addr, DATA_SIZE, GETPC())
+
+#define ATOMIC_NAME(X) HELPER(glue(glue(atomic_ ## X, SUFFIX), END))
+#define EXTRA_ARGS
+
+#define DATA_SIZE 1
+#include "atomic_template.h"
+
+#define DATA_SIZE 2
+#include "atomic_template.h"
+
+#define DATA_SIZE 4
+#include "atomic_template.h"
+
+#ifdef CONFIG_ATOMIC64
+#define DATA_SIZE 8
+#include "atomic_template.h"
+#endif
+
+/* The following is only callable from other helpers, and matches up
+ with the softmmu version. */
+
+#ifdef CONFIG_ATOMIC128
+
+#undef EXTRA_ARGS
+#undef ATOMIC_NAME
+#undef ATOMIC_MMU_LOOKUP
+
+#define EXTRA_ARGS , TCGMemOpIdx oi, uintptr_t retaddr
+#define ATOMIC_NAME(X) \
+ HELPER(glue(glue(glue(atomic_ ## X, SUFFIX), END), _mmu))
+#define ATOMIC_MMU_LOOKUP atomic_mmu_lookup(env, addr, DATA_SIZE, retaddr)
+
+#define DATA_SIZE 16
+#include "atomic_template.h"
+#endif /* CONFIG_ATOMIC128 */
--
2.13.5
- [Qemu-devel] [PULL 00/17] TCG queued patches, Richard Henderson, 2017/09/17
- [Qemu-devel] [PULL 01/17] tcg/ppc: disable atomic write check on ppc32, Richard Henderson, 2017/09/17
- [Qemu-devel] [PULL 04/17] accel/tcg: move tcg-runtime to accel/tcg/, Richard Henderson, 2017/09/17
- [Qemu-devel] [PULL 02/17] accel/tcg: move softmmu_template.h to accel/tcg/, Richard Henderson, 2017/09/17
- [Qemu-devel] [PULL 03/17] accel/tcg: move user-exec to accel/tcg/, Richard Henderson, 2017/09/17
- [Qemu-devel] [PULL 06/17] accel/tcg: move USER code to user-exec.c,
Richard Henderson <=
- [Qemu-devel] [PULL 05/17] accel/tcg: move atomic_template.h to accel/tcg/, Richard Henderson, 2017/09/17
- [Qemu-devel] [PULL 07/17] tcg: Add tcg_op_supported, Richard Henderson, 2017/09/17
- [Qemu-devel] [PULL 10/17] tcg: Remove tcg_regset_{or, and, andnot, not}, Richard Henderson, 2017/09/17
- [Qemu-devel] [PULL 08/17] tcg: Remove tcg_regset_clear, Richard Henderson, 2017/09/17
- [Qemu-devel] [PULL 09/17] tcg: Remove tcg_regset_set, Richard Henderson, 2017/09/17
- [Qemu-devel] [PULL 11/17] tcg: Remove tcg_regset_set32, Richard Henderson, 2017/09/17
- [Qemu-devel] [PULL 14/17] tcg/arm: Fully convert tcg_target_op_def, Richard Henderson, 2017/09/17
- [Qemu-devel] [PULL 12/17] tcg: Fix types in tcg_regset_{set, reset}_reg, Richard Henderson, 2017/09/17
- [Qemu-devel] [PULL 13/17] tcg/aarch64: Fully convert tcg_target_op_def, Richard Henderson, 2017/09/17
- [Qemu-devel] [PULL 17/17] tcg/mips: Fully convert tcg_target_op_def, Richard Henderson, 2017/09/17