Signed-off-by: Artyom Tarasenko <atar4q...@gmail.com>
---
 target-sparc/ldst_helper.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/target-sparc/ldst_helper.c b/target-sparc/ldst_helper.c
index 6ce5ccc..f17ac9b 100644
--- a/target-sparc/ldst_helper.c
+++ b/target-sparc/ldst_helper.c
@@ -2341,9 +2341,13 @@ void sparc_cpu_unassigned_access(CPUState *cs, hwaddr 
addr,
 #endif
 
     if (is_exec) {
-        helper_raise_exception(env, TT_CODE_ACCESS);
+        if (env->lsu & (IMMU_E)) {
+            helper_raise_exception(env, TT_CODE_ACCESS);
+        }
     } else {
-        helper_raise_exception(env, TT_DATA_ACCESS);
+        if (env->lsu & (DMMU_E)) {
+                helper_raise_exception(env, TT_DATA_ACCESS);
+        }
     }
 }
 #endif
-- 
2.7.2


Reply via email to