mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-09-01 14:31:52 -06:00
accel/tcg: Cap the translation block when we encounter mmio
Do not allow translation to proceed beyond one insn with mmio, as we will not be caching the TranslationBlock. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
04f8ed1145
commit
ddfa9f1176
1 changed files with 4 additions and 0 deletions
|
@ -240,6 +240,8 @@ static bool translator_ld(CPUArchState *env, DisasContextBase *db,
|
||||||
|
|
||||||
/* Use slow path if first page is MMIO. */
|
/* Use slow path if first page is MMIO. */
|
||||||
if (unlikely(tb_page_addr0(tb) == -1)) {
|
if (unlikely(tb_page_addr0(tb) == -1)) {
|
||||||
|
/* We capped translation with first page MMIO in tb_gen_code. */
|
||||||
|
tcg_debug_assert(db->max_insns == 1);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -288,6 +290,8 @@ static bool translator_ld(CPUArchState *env, DisasContextBase *db,
|
||||||
if (unlikely(new_page1 == -1)) {
|
if (unlikely(new_page1 == -1)) {
|
||||||
tb_unlock_pages(tb);
|
tb_unlock_pages(tb);
|
||||||
tb_set_page_addr0(tb, -1);
|
tb_set_page_addr0(tb, -1);
|
||||||
|
/* Require that this be the final insn. */
|
||||||
|
db->max_insns = db->num_insns;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue