[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 14/29] target/i386: Use cpu_*_mmuidx_ra instead of templates
From: |
Richard Henderson |
Subject: |
[PATCH v3 14/29] target/i386: Use cpu_*_mmuidx_ra instead of templates |
Date: |
Sun, 29 Dec 2019 10:11:09 +1100 |
Do not use exec/cpu_ldst_{,useronly_}template.h directly,
but instead use the functional interface.
Cc: Eduardo Habkost <address@hidden>
Acked-by: Paolo Bonzini <address@hidden>
Reviewed-by: Alex Bennée <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
---
target/i386/seg_helper.c | 56 ++++++++++++++++++++--------------------
1 file changed, 28 insertions(+), 28 deletions(-)
diff --git a/target/i386/seg_helper.c b/target/i386/seg_helper.c
index 87a627f9dc..b96de068ca 100644
--- a/target/i386/seg_helper.c
+++ b/target/i386/seg_helper.c
@@ -37,37 +37,37 @@
# define LOG_PCALL_STATE(cpu) do { } while (0)
#endif
-#ifdef CONFIG_USER_ONLY
-#define MEMSUFFIX _kernel
-#define DATA_SIZE 1
-#include "exec/cpu_ldst_useronly_template.h"
+/*
+ * TODO: Convert callers to compute cpu_mmu_index_kernel once
+ * and use *_mmuidx_ra directly.
+ */
+#define cpu_ldub_kernel_ra(e, p, r) \
+ cpu_ldub_mmuidx_ra(e, p, cpu_mmu_index_kernel(e), r)
+#define cpu_lduw_kernel_ra(e, p, r) \
+ cpu_lduw_mmuidx_ra(e, p, cpu_mmu_index_kernel(e), r)
+#define cpu_ldl_kernel_ra(e, p, r) \
+ cpu_ldl_mmuidx_ra(e, p, cpu_mmu_index_kernel(e), r)
+#define cpu_ldq_kernel_ra(e, p, r) \
+ cpu_ldq_mmuidx_ra(e, p, cpu_mmu_index_kernel(e), r)
-#define DATA_SIZE 2
-#include "exec/cpu_ldst_useronly_template.h"
+#define cpu_stb_kernel_ra(e, p, v, r) \
+ cpu_stb_mmuidx_ra(e, p, v, cpu_mmu_index_kernel(e), r)
+#define cpu_stw_kernel_ra(e, p, v, r) \
+ cpu_stw_mmuidx_ra(e, p, v, cpu_mmu_index_kernel(e), r)
+#define cpu_stl_kernel_ra(e, p, v, r) \
+ cpu_stl_mmuidx_ra(e, p, v, cpu_mmu_index_kernel(e), r)
+#define cpu_stq_kernel_ra(e, p, v, r) \
+ cpu_stq_mmuidx_ra(e, p, v, cpu_mmu_index_kernel(e), r)
-#define DATA_SIZE 4
-#include "exec/cpu_ldst_useronly_template.h"
+#define cpu_ldub_kernel(e, p) cpu_ldub_kernel_ra(e, p, 0)
+#define cpu_lduw_kernel(e, p) cpu_lduw_kernel_ra(e, p, 0)
+#define cpu_ldl_kernel(e, p) cpu_ldl_kernel_ra(e, p, 0)
+#define cpu_ldq_kernel(e, p) cpu_ldq_kernel_ra(e, p, 0)
-#define DATA_SIZE 8
-#include "exec/cpu_ldst_useronly_template.h"
-#undef MEMSUFFIX
-#else
-#define CPU_MMU_INDEX (cpu_mmu_index_kernel(env))
-#define MEMSUFFIX _kernel
-#define DATA_SIZE 1
-#include "exec/cpu_ldst_template.h"
-
-#define DATA_SIZE 2
-#include "exec/cpu_ldst_template.h"
-
-#define DATA_SIZE 4
-#include "exec/cpu_ldst_template.h"
-
-#define DATA_SIZE 8
-#include "exec/cpu_ldst_template.h"
-#undef CPU_MMU_INDEX
-#undef MEMSUFFIX
-#endif
+#define cpu_stb_kernel(e, p, v) cpu_stb_kernel_ra(e, p, v, 0)
+#define cpu_stw_kernel(e, p, v) cpu_stw_kernel_ra(e, p, v, 0)
+#define cpu_stl_kernel(e, p, v) cpu_stl_kernel_ra(e, p, v, 0)
+#define cpu_stq_kernel(e, p, v) cpu_stq_kernel_ra(e, p, v, 0)
/* return non zero if error */
static inline int load_segment_ra(CPUX86State *env, uint32_t *e1_ptr,
--
2.20.1
- [PATCH v3 05/29] target/arm: Include tcg.h in sve_helper.c, (continued)
- [PATCH v3 05/29] target/arm: Include tcg.h in sve_helper.c, Richard Henderson, 2019/12/28
- [PATCH v3 06/29] accel/tcg: Include tcg.h in tcg-runtime.c, Richard Henderson, 2019/12/28
- [PATCH v3 07/29] linux-user: Include tcg.h in syscall.c, Richard Henderson, 2019/12/28
- [PATCH v3 08/29] linux-user: Include trace-root.h in syscall-trace.h, Richard Henderson, 2019/12/28
- [PATCH v3 09/29] plugins: Include trace/mem.h in api.c, Richard Henderson, 2019/12/28
- [PATCH v3 10/29] cputlb: Move body of cpu_ldst_template.h out of line, Richard Henderson, 2019/12/28
- [PATCH v3 11/29] translator: Use cpu_ld*_code instead of open-coding, Richard Henderson, 2019/12/28
- [PATCH v3 12/29] cputlb: Rename helper_ret_ld*_cmmu to cpu_ld*_code, Richard Henderson, 2019/12/28
- [PATCH v3 13/29] cputlb: Provide cpu_(ld, st}*_mmuidx_ra for user-only, Richard Henderson, 2019/12/28
- [PATCH v3 14/29] target/i386: Use cpu_*_mmuidx_ra instead of templates,
Richard Henderson <=
- [PATCH v3 16/29] target/nios2: Remove MMU_MODE{0,1}_SUFFIX, Richard Henderson, 2019/12/28
- [PATCH v3 15/29] cputlb: Expand cpu_ldst_useronly_template.h in user-exec.c, Richard Henderson, 2019/12/28
- [PATCH v3 17/29] target/alpha: Remove MMU_MODE{0,1}_SUFFIX, Richard Henderson, 2019/12/28
- [PATCH v3 18/29] target/cris: Remove MMU_MODE{0,1}_SUFFIX, Richard Henderson, 2019/12/28
- [PATCH v3 19/29] target/i386: Remove MMU_MODE{0,1,2}_SUFFIX, Richard Henderson, 2019/12/28
- [PATCH v3 20/29] target/microblaze: Remove MMU_MODE{0,1,2}_SUFFIX, Richard Henderson, 2019/12/28
- [PATCH v3 21/29] target/sh4: Remove MMU_MODE{0,1}_SUFFIX, Richard Henderson, 2019/12/28
- [PATCH v3 22/29] target/unicore32: Remove MMU_MODE{0,1}_SUFFIX, Richard Henderson, 2019/12/28
- [PATCH v3 23/29] target/xtensa: Remove MMU_MODE{0,1,2,3}_SUFFIX, Richard Henderson, 2019/12/28
- [PATCH v3 24/29] target/m68k: Use cpu_*_mmuidx_ra instead of MMU_MODE{0, 1}_SUFFIX, Richard Henderson, 2019/12/28