diff mbox series

[RFC,25/34] accel/tcg: [CPUTLB] Use tcg_ctx->mo_te instead of MO_TE

Message ID 20240119144024.14289-26-anjo@rev.ng (mailing list archive)
State New, archived
Headers show
Series Compile accel/tcg once (partially) | expand

Commit Message

Anton Johansson Jan. 19, 2024, 2:40 p.m. UTC
Makes *_code() memory access functions target independent.

Signed-off-by: Anton Johansson <anjo@rev.ng>
---
 accel/tcg/cputlb.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index a75a52d141..bfbbfd0fdb 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -2988,19 +2988,22 @@  uint32_t cpu_ldub_code(CPUArchState *env, abi_ptr addr)
 
 uint32_t cpu_lduw_code(CPUArchState *env, abi_ptr addr)
 {
-    MemOpIdx oi = make_memop_idx(MO_TEUW, cpu_mmu_index(env, true));
+    MemOpIdx oi = make_memop_idx(tcg_ctx->mo_te | MO_UW,
+                                 cpu_mmu_index(env, true));
     return do_ld2_mmu(env_cpu(env), addr, oi, 0, MMU_INST_FETCH);
 }
 
 uint32_t cpu_ldl_code(CPUArchState *env, abi_ptr addr)
 {
-    MemOpIdx oi = make_memop_idx(MO_TEUL, cpu_mmu_index(env, true));
+    MemOpIdx oi = make_memop_idx(tcg_ctx->mo_te | MO_UL,
+                                 cpu_mmu_index(env, true));
     return do_ld4_mmu(env_cpu(env), addr, oi, 0, MMU_INST_FETCH);
 }
 
 uint64_t cpu_ldq_code(CPUArchState *env, abi_ptr addr)
 {
-    MemOpIdx oi = make_memop_idx(MO_TEUQ, cpu_mmu_index(env, true));
+    MemOpIdx oi = make_memop_idx(tcg_ctx->mo_te | MO_UQ,
+                                 cpu_mmu_index(env, true));
     return do_ld8_mmu(env_cpu(env), addr, oi, 0, MMU_INST_FETCH);
 }