about summary refs log tree commit diff stats
path: root/src/dynarec
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-10-24 15:24:54 +0200
committerptitSeb <sebastien.chev@gmail.com>2024-10-24 15:24:54 +0200
commit320459c2c6324c0934b5faa640e3e656a4bf9e1e (patch)
tree258a5ad68935243f282e6e796d8eac66cf082872 /src/dynarec
parent8d14c10b8cf773d252dfeb7717d90fc07e3590ee (diff)
downloadbox64-320459c2c6324c0934b5faa640e3e656a4bf9e1e.tar.gz
box64-320459c2c6324c0934b5faa640e3e656a4bf9e1e.zip
Make BOX64_IGNOREINT3 also ignore other privilged instructions
Diffstat (limited to 'src/dynarec')
-rw-r--r--src/dynarec/arm64/dynarec_arm64_00.c61
1 files changed, 36 insertions, 25 deletions
diff --git a/src/dynarec/arm64/dynarec_arm64_00.c b/src/dynarec/arm64/dynarec_arm64_00.c
index 5a55e015..e06cd2d6 100644
--- a/src/dynarec/arm64/dynarec_arm64_00.c
+++ b/src/dynarec/arm64/dynarec_arm64_00.c
@@ -3014,15 +3014,20 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
         case 0xE6:                      /* OUT Ib, AL */
         case 0xE7:                      /* OUT Ib, EAX */
             INST_NAME(opcode==0xE4?"IN AL, Ib":(opcode==0xE5?"IN EAX, Ib":(opcode==0xE6?"OUT Ib, AL":"OUT Ib, EAX")));
-            SETFLAGS(X_ALL, SF_SET_NODF);    // Hack to set flags in "don't care" state
-            u8 = F8;
-            GETIP(ip);
-            STORE_XEMU_CALL(xRIP);
-            CALL(native_priv, -1);
-            LOAD_XEMU_CALL(xRIP);
-            jump_to_epilog(dyn, 0, xRIP, ninst);
-            *need_epilog = 0;
-            *ok = 0;
+            if(rex.is32bits && box64_ignoreint3)
+            { 
+                F8;
+            } else {
+                SETFLAGS(X_ALL, SF_SET_NODF);    // Hack to set flags in "don't care" state
+                u8 = F8;
+                GETIP(ip);
+                STORE_XEMU_CALL(xRIP);
+                CALL(native_priv, -1);
+                LOAD_XEMU_CALL(xRIP);
+                jump_to_epilog(dyn, 0, xRIP, ninst);
+                *need_epilog = 0;
+                *ok = 0;
+            }
             break;
         case 0xE8:
             INST_NAME("CALL Id");
@@ -3196,14 +3201,17 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
         case 0xEE:                      /* OUT DX, AL */
         case 0xEF:                      /* OUT DX, EAX */
             INST_NAME(opcode==0xEC?"IN AL, DX":(opcode==0xED?"IN EAX, DX":(opcode==0xEE?"OUT DX, AL":"OUT DX, EAX")));
-            SETFLAGS(X_ALL, SF_SET_NODF);    // Hack to set flags in "don't care" state
-            GETIP(ip);
-            STORE_XEMU_CALL(xRIP);
-            CALL(native_priv, -1);
-            LOAD_XEMU_CALL(xRIP);
-            jump_to_epilog(dyn, 0, xRIP, ninst);
-            *need_epilog = 0;
-            *ok = 0;
+            if(rex.is32bits && box64_ignoreint3)
+            {} else {
+                SETFLAGS(X_ALL, SF_SET_NODF);    // Hack to set flags in "don't care" state
+                GETIP(ip);
+                STORE_XEMU_CALL(xRIP);
+                CALL(native_priv, -1);
+                LOAD_XEMU_CALL(xRIP);
+                jump_to_epilog(dyn, 0, xRIP, ninst);
+                *need_epilog = 0;
+                *ok = 0;
+            }
             break;
 
         case 0xF0:
@@ -3561,14 +3569,17 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
         case 0xFA:                      /* STI */
         case 0xFB:                      /* CLI */
             INST_NAME(opcode==0xFA?"CLI":"STI");
-            SETFLAGS(X_ALL, SF_SET_NODF);    // Hack to set flags in "don't care" state
-            GETIP(ip);
-            STORE_XEMU_CALL(xRIP);
-            CALL(native_priv, -1);
-            LOAD_XEMU_CALL(xRIP);
-            jump_to_epilog(dyn, 0, xRIP, ninst);
-            *need_epilog = 0;
-            *ok = 0;
+            if(rex.is32bits && box64_ignoreint3)
+            {} else {
+                SETFLAGS(X_ALL, SF_SET_NODF);    // Hack to set flags in "don't care" state
+                GETIP(ip);
+                STORE_XEMU_CALL(xRIP);
+                CALL(native_priv, -1);
+                LOAD_XEMU_CALL(xRIP);
+                jump_to_epilog(dyn, 0, xRIP, ninst);
+                *need_epilog = 0;
+                *ok = 0;
+            }
             break;
         case 0xFC:
             INST_NAME("CLD");