fixed self modifying code in case of asynchronous interrupt
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@924 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
516633dc42
commit
ea1c18022e
9
exec.c
9
exec.c
@ -613,7 +613,7 @@ void tb_invalidate_phys_page_range(target_ulong start, target_ulong end,
|
|||||||
CPUState *env = cpu_single_env;
|
CPUState *env = cpu_single_env;
|
||||||
#endif
|
#endif
|
||||||
PageDesc *p;
|
PageDesc *p;
|
||||||
TranslationBlock *tb, *tb_next, *current_tb;
|
TranslationBlock *tb, *tb_next, *current_tb, *saved_tb;
|
||||||
target_ulong tb_start, tb_end;
|
target_ulong tb_start, tb_end;
|
||||||
target_ulong current_pc, current_cs_base;
|
target_ulong current_pc, current_cs_base;
|
||||||
|
|
||||||
@ -681,7 +681,12 @@ void tb_invalidate_phys_page_range(target_ulong start, target_ulong end,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif /* TARGET_HAS_PRECISE_SMC */
|
#endif /* TARGET_HAS_PRECISE_SMC */
|
||||||
|
saved_tb = env->current_tb;
|
||||||
|
env->current_tb = NULL;
|
||||||
tb_phys_invalidate(tb, -1);
|
tb_phys_invalidate(tb, -1);
|
||||||
|
env->current_tb = saved_tb;
|
||||||
|
if (env->interrupt_request && env->current_tb)
|
||||||
|
cpu_interrupt(env, env->interrupt_request);
|
||||||
}
|
}
|
||||||
tb = tb_next;
|
tb = tb_next;
|
||||||
}
|
}
|
||||||
@ -699,6 +704,7 @@ void tb_invalidate_phys_page_range(target_ulong start, target_ulong end,
|
|||||||
/* we generate a block containing just the instruction
|
/* we generate a block containing just the instruction
|
||||||
modifying the memory. It will ensure that it cannot modify
|
modifying the memory. It will ensure that it cannot modify
|
||||||
itself */
|
itself */
|
||||||
|
env->current_tb = NULL;
|
||||||
tb_gen_code(env, current_pc, current_cs_base, current_flags,
|
tb_gen_code(env, current_pc, current_cs_base, current_flags,
|
||||||
CF_SINGLE_INSN);
|
CF_SINGLE_INSN);
|
||||||
cpu_resume_from_signal(env, NULL);
|
cpu_resume_from_signal(env, NULL);
|
||||||
@ -795,6 +801,7 @@ static void tb_invalidate_phys_page(target_ulong addr,
|
|||||||
/* we generate a block containing just the instruction
|
/* we generate a block containing just the instruction
|
||||||
modifying the memory. It will ensure that it cannot modify
|
modifying the memory. It will ensure that it cannot modify
|
||||||
itself */
|
itself */
|
||||||
|
env->current_tb = NULL;
|
||||||
tb_gen_code(env, current_pc, current_cs_base, current_flags,
|
tb_gen_code(env, current_pc, current_cs_base, current_flags,
|
||||||
CF_SINGLE_INSN);
|
CF_SINGLE_INSN);
|
||||||
cpu_resume_from_signal(env, puc);
|
cpu_resume_from_signal(env, puc);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user