jit: Defer invalidations made while running.

Previously, invalidating icache could happen while running, which might
cause the CPU to return into outer space.  This runs such invalidations
after letting the CPU exit.

It was easy to trigger this with the debugger: step using the GE debugger,
add a CPU memory breakpoint, then resume from the GE debugger.
However, cheats and the like could cause similar issues.
This commit is contained in:
Unknown W. Brackets committed 2022-10-09 21:26:13 -07:00
1 parent 4d5e6f53bb
commit 825450a373
4 files changed
+51 -17

No files matched your search

+5 -10
View File
@@ -648,16 +648,11 @@ void CBreakPoints::Update(u32 addr) {
resume = true;
}
{
std::lock_guard<std::recursive_mutex> guard(MIPSComp::jitLock);
if (MIPSComp::jit) {
// In case this is a delay slot, clear the previous instruction too.
if (addr != 0)
MIPSComp::jit->InvalidateCacheAt(addr - 4, 8);
else
MIPSComp::jit->ClearCache();
}
}
// In case this is a delay slot, clear the previous instruction too.
if (addr != 0)
mipsr4k.InvalidateICache(addr - 4, 8);
else
mipsr4k.ClearJitCache();
if (resume)
Core_EnableStepping(false);