about summary refs log tree commit diff stats
path: root/src/libtools
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-12-23 12:48:35 +0100
committerptitSeb <sebastien.chev@gmail.com>2024-12-23 12:48:35 +0100
commit48db75961ee8784acd93278f841ddf80a9796949 (patch)
treec222eadaebbf9386f1916c9f83fdccdd42ac7214 /src/libtools
parentda0820ce0a07356ed53fd7175a65375775c87811 (diff)
downloadbox64-48db75961ee8784acd93278f841ddf80a9796949.tar.gz
box64-48db75961ee8784acd93278f841ddf80a9796949.zip
[DYNAREC] Some light rework of the hotpage handling
Diffstat (limited to 'src/libtools')
-rw-r--r--src/libtools/signals.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/libtools/signals.c b/src/libtools/signals.c
index d7120842..4abf8a4f 100644
--- a/src/libtools/signals.c
+++ b/src/libtools/signals.c
@@ -1478,21 +1478,9 @@ void my_box64signalhandler(int32_t sig, siginfo_t* info, void * ucntx)
         // check if SMC inside block
         db = FindDynablockFromNativeAddress(pc);
         db_searched = 1;
-        static uintptr_t repeated_page = 0;
-        dynarec_log(LOG_DEBUG, "SIGSEGV with Access error on %p for %p , db=%p(%p), prot=0x%hhx (old page=%p)\n", pc, addr, db, db?((void*)db->x64_addr):NULL, prot, (void*)repeated_page);
-        static int repeated_count = 0;
-        if(repeated_page == ((uintptr_t)addr&~(box64_pagesize-1))) {
-            ++repeated_count;   // Access eoor multiple time on same page, disable dynarec on this page a few time...
-            if(repeated_count>1) {
-                dynarec_log(LOG_DEBUG, "Detecting a Hotpage at %p (%d)\n", (void*)repeated_page, repeated_count);
-                SetHotPage(repeated_page);
-            }
-        } else {
-            repeated_page = (uintptr_t)addr&~(box64_pagesize-1);
-            repeated_count = 0;
-        }
         // access error, unprotect the block (and mark them dirty)
         unprotectDB((uintptr_t)addr, 1, 1);    // unprotect 1 byte... But then, the whole page will be unprotected
+        if(db) CheckHotPage((uintptr_t)addr);
         int db_need_test = db?getNeedTest((uintptr_t)db->x64_addr):0;
         if(db && ((addr>=db->x64_addr && addr<(db->x64_addr+db->x64_size)) || db_need_test)) {
             emu = getEmuSignal(emu, p, db);