MMU: fix problems with blocks that cross vmem page boundaries

In rare cases, this can result in a violation of the JIT block cache constraint
that blocks must end in the same place. This can cause instability, lockups,
due to blocks not properly being invalidated properly.
l Please enter the commit message for your changes. Lines starting
This commit is contained in:
Fiora 2015-01-04 21:15:50 -08:00
parent b058bbd223
commit e85f0ff179
1 changed files with 9 additions and 0 deletions

View File

@ -670,6 +670,15 @@ u32 PPCAnalyzer::Analyze(u32 address, CodeBlock *block, CodeBuffer *buffer, u32
if (inst.hex != 0) if (inst.hex != 0)
{ {
// Slight hack: the JIT block cache currently assumes all blocks end at the same place,
// but broken blocks due to page faults break this assumption. Avoid this by just ending
// all virtual memory instruction blocks at page boundaries.
// FIXME: improve the JIT block cache so we don't need to do this.
if (virtualAddr && i > 0 && (address & 0xfff) == 0)
{
break;
}
num_inst++; num_inst++;
memset(&code[i], 0, sizeof(CodeOp)); memset(&code[i], 0, sizeof(CodeOp));
GekkoOPInfo *opinfo = GetOpInfo(inst); GekkoOPInfo *opinfo = GetOpInfo(inst);