On 7/13/21 12:46 PM, Taylor Simpson wrote:
  void HELPER(commit_store)(CPUHexagonState *env, int slot_num)
  {
-    switch (env->mem_log_stores[slot_num].width) {
+    uint8_t width = env->mem_log_stores[slot_num].width;
+    target_ulong va = env->mem_log_stores[slot_num].va;
+
+#ifdef CONFIG_USER_ONLY
+    g_assert(width == 1 || width == 2 || width == 4 || width == 8);
+    /* We perform this check elsewhere in system mode */
+    probe_write(env, va, width, MMU_USER_IDX, 0);
+#endif
+
+    switch (width) {
      case 1:
-        put_user_u8(env->mem_log_stores[slot_num].data32,
-                    env->mem_log_stores[slot_num].va);
+        put_user_u8(env->mem_log_stores[slot_num].data32, va);

The primary problem here is that put_user_* is the wrong set of functions to use. You should have been using exec/cpu_ldst.h, in particular cpu_ld*_data_ra and cpu_st*_data_ra.


r~

Reply via email to