mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-03-23 06:25:12 +00:00
target-mips: fix detection of the end of the page during translation
The test is supposed to terminate TB if the end of the page is reached. However, with current implementation it may never succeed for microMIPS or mips16. Backports commit fe2372910a09034591fd2cfc2d70cca43fccaa95 from qemu
This commit is contained in:
parent
6d1bc2c3c7
commit
c0fc9b280e
|
@ -19261,6 +19261,7 @@ gen_intermediate_code_internal(MIPSCPU *cpu, TranslationBlock *tb,
|
|||
CPUMIPSState *env = &cpu->env;
|
||||
DisasContext ctx;
|
||||
target_ulong pc_start;
|
||||
target_ulong next_page_start;
|
||||
CPUBreakpoint *bp;
|
||||
int j, lj = -1;
|
||||
int num_insns;
|
||||
|
@ -19275,6 +19276,7 @@ gen_intermediate_code_internal(MIPSCPU *cpu, TranslationBlock *tb,
|
|||
qemu_log("search pc %d\n", search_pc);
|
||||
|
||||
pc_start = tb->pc;
|
||||
next_page_start = (pc_start & TARGET_PAGE_MASK) + TARGET_PAGE_SIZE;
|
||||
ctx.uc = env->uc;
|
||||
ctx.pc = pc_start;
|
||||
ctx.saved_pc = -1;
|
||||
|
@ -19427,8 +19429,9 @@ gen_intermediate_code_internal(MIPSCPU *cpu, TranslationBlock *tb,
|
|||
break;
|
||||
}
|
||||
|
||||
if ((ctx.pc & (TARGET_PAGE_SIZE - 1)) == 0)
|
||||
if (ctx.pc >= next_page_start) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (tcg_op_buf_full(tcg_ctx)) {
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue