[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 07/28] cputlb: Provide cpu_(ld,st}*_mmuidx_ra for user-only
From: |
Richard Henderson |
Subject: |
[PATCH 07/28] cputlb: Provide cpu_(ld,st}*_mmuidx_ra for user-only |
Date: |
Wed, 11 Dec 2019 20:00:18 -0800 |
This finishes the new interface began with the previous patch.
Document the interface and deprecate MMU_MODE<N>_SUFFIX.
Signed-off-by: Richard Henderson <address@hidden>
---
include/exec/cpu_ldst.h | 84 ++++++++++++++++++++++++++++++++++++++---
1 file changed, 79 insertions(+), 5 deletions(-)
diff --git a/include/exec/cpu_ldst.h b/include/exec/cpu_ldst.h
index ef59ed61e4..3b2c46bdf4 100644
--- a/include/exec/cpu_ldst.h
+++ b/include/exec/cpu_ldst.h
@@ -25,9 +25,13 @@
*
* The syntax for the accessors is:
*
- * load: cpu_ld{sign}{size}_{mmusuffix}(env, ptr)
+ * load: cpu_ld{sign}{size}_{mmusuffix}(env, ptr)
+ * cpu_ld{sign}{size}_{mmusuffix}_ra(env, ptr, retaddr)
+ * cpu_ld{sign}{size}_mmuidx_ra(env, ptr, mmu_idx, retaddr)
*
- * store: cpu_st{sign}{size}_{mmusuffix}(env, ptr, val)
+ * store: cpu_st{size}_{mmusuffix}(env, ptr, val)
+ * cpu_st{size}_{mmusuffix}_ra(env, ptr, val, retaddr)
+ * cpu_st{size}_mmuidx_ra(env, ptr, val, mmu_idx, retaddr)
*
* sign is:
* (empty): for 32 and 64 bit sizes
@@ -40,9 +44,14 @@
* l: 32 bits
* q: 64 bits
*
- * mmusuffix is one of the generic suffixes "data" or "code", or
- * (for softmmu configs) a target-specific MMU mode suffix as defined
- * in target cpu.h.
+ * mmusuffix is one of the generic suffixes "data" or "code", or "mmuidx".
+ * The "mmuidx" suffix carries an extra mmu_idx argument that specifies
+ * the index to use; the "data" and "code" suffixes take the index from
+ * cpu_mmu_index().
+ *
+ * Deprecated: for softmmu configs, mmusuffix may be a target-specific MMU
+ * mode suffix as defined in target cpu.h. These should be replaced by
+ * one of the "mmuidx" functions.
*/
#ifndef CPU_LDST_H
#define CPU_LDST_H
@@ -145,6 +154,71 @@ static inline void clear_helper_retaddr(void)
#undef MEMSUFFIX
#undef CODE_ACCESS
+/*
+ * Provide the same *_mmuidx_ra interface as for softmmu.
+ * The mmu_idx argument is ignored.
+ */
+
+static inline uint32_t cpu_ldub_mmuidx_ra(CPUArchState *env, abi_ptr addr,
+ int mmu_idx, uintptr_t ra)
+{
+ return cpu_ldub_data_ra(env, addr, ra);
+}
+
+static inline uint32_t cpu_lduw_mmuidx_ra(CPUArchState *env, abi_ptr addr,
+ int mmu_idx, uintptr_t ra)
+{
+ return cpu_lduw_data_ra(env, addr, ra);
+}
+
+static inline uint32_t cpu_ldl_mmuidx_ra(CPUArchState *env, abi_ptr addr,
+ int mmu_idx, uintptr_t ra)
+{
+ return cpu_ldl_data_ra(env, addr, ra);
+}
+
+static inline uint64_t cpu_ldq_mmuidx_ra(CPUArchState *env, abi_ptr addr,
+ int mmu_idx, uintptr_t ra)
+{
+ return cpu_ldq_data_ra(env, addr, ra);
+}
+
+static inline int cpu_ldsb_mmuidx_ra(CPUArchState *env, abi_ptr addr,
+ int mmu_idx, uintptr_t ra)
+{
+ return cpu_ldsb_data_ra(env, addr, ra);
+}
+
+static inline int cpu_ldsw_mmuidx_ra(CPUArchState *env, abi_ptr addr,
+ int mmu_idx, uintptr_t ra)
+{
+ return cpu_ldsw_data_ra(env, addr, ra);
+}
+
+static inline void cpu_stb_mmuidx_ra(CPUArchState *env, abi_ptr addr,
+ uint32_t val, int mmu_idx, uintptr_t ra)
+{
+ cpu_stb_data_ra(env, addr, val, ra);
+}
+
+static inline void cpu_stw_mmuidx_ra(CPUArchState *env, abi_ptr addr,
+ uint32_t val, int mmu_idx, uintptr_t ra)
+{
+ cpu_stw_data_ra(env, addr, val, ra);
+}
+
+static inline void cpu_stl_mmuidx_ra(CPUArchState *env, abi_ptr addr,
+ uint32_t val, int mmu_idx, uintptr_t ra)
+{
+ cpu_stl_data_ra(env, addr, val, ra);
+}
+
+static inline void cpu_stq_mmuidx_ra(CPUArchState *env, abi_ptr addr,
+ uint64_t val, int mmu_idx, uintptr_t ra)
+{
+ cpu_stq_data_ra(env, addr, val, ra);
+}
+
#else
/* Needed for TCG_OVERSIZED_GUEST */
--
2.20.1
- [PATCH 00/28] cputlb: Remove support for MMU_MODE*_SUFFIX, Richard Henderson, 2019/12/11
- [PATCH 01/28] target/xtensa: Use probe_access for itlb_hit_test, Richard Henderson, 2019/12/11
- [PATCH 02/28] cputlb: Use trace_mem_get_info instead of trace_mem_build_info, Richard Henderson, 2019/12/11
- [PATCH 03/28] trace: Remove trace_mem_build_info_no_se_[bl]e, Richard Henderson, 2019/12/11
- [PATCH 08/28] target/i386: Use cpu_*_mmuidx_ra instead of templates, Richard Henderson, 2019/12/11
- [PATCH 04/28] cputlb: Move body of cpu_ldst_template.h out of line, Richard Henderson, 2019/12/11
- [PATCH 07/28] cputlb: Provide cpu_(ld,st}*_mmuidx_ra for user-only,
Richard Henderson <=
- [PATCH 05/28] translator: Use cpu_ld*_code instead of open-coding, Richard Henderson, 2019/12/11
- [PATCH 06/28] cputlb: Rename helper_ret_ld*_cmmu to cpu_ld*_code, Richard Henderson, 2019/12/11
- [PATCH 09/28] target/s390x: Include tcg.h in mem_helper.c, Richard Henderson, 2019/12/11
- [PATCH 12/28] linux-user: Include tcg.h in syscall.c, Richard Henderson, 2019/12/11
- [PATCH 10/28] target/arm: Include tcg.h in sve_helper.c, Richard Henderson, 2019/12/11
- [PATCH 11/28] accel/tcg: Include tcg.h in tcg-runtime.c, Richard Henderson, 2019/12/11
- [PATCH 15/28] target/nios2: Remove MMU_MODE{0,1}_SUFFIX, Richard Henderson, 2019/12/11