If I understand everything you've taught me, then the following patch would
have also satisfied the permissions issue. Could you confirm this please?
The essential change is the MMU_USER_IDX in the call to make_memop_idx()
diff --git a/target/sparc/ldst_helper.c b/target/sparc/ldst_helper.c
index e581bb42ac..be3c03a3b6 100644
--- a/target/sparc/ldst_helper.c
+++ b/target/sparc/ldst_helper.c
@@ -702,6 +702,24 @@ uint64_t helper_ld_asi(CPUSPARCState *env,
target_ulong addr,
break;
}
break;
+ case ASI_USERTXT: /* User code access */
+ oi = make_memop_idx(memop, MMU_USER_IDX);
+ switch (size) {
+ case 1:
+ ret = cpu_ldb_code_mmu(env, addr, oi, GETPC());
+ break;
+ case 2:
+ ret = cpu_ldw_code_mmu(env, addr, oi, GETPC());
+ break;
+ default:
+ case 4:
+ ret = cpu_ldl_code_mmu(env, addr, oi, GETPC());
+ break;
+ case 8:
+ ret = cpu_ldq_code_mmu(env, addr, oi, GETPC());
+ break;
+ }
+ break;