From c360a0fd71239948197f81737ba8b4eb132915f1 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Tue, 14 Aug 2018 17:17:19 +0100 Subject: accel/tcg: Handle get_page_addr_code() returning -1 in tb_check_watchpoint() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When we support execution from non-RAM MMIO regions, get_page_addr_code() will return -1 to indicate that there is no RAM at the requested address. Handle this in tb_check_watchpoint() -- if the exception happened for a PC which doesn't correspond to RAM then there is no need to invalidate any TBs, because the one-instruction TB will not have been cached. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Tested-by: Cédric Le Goater Message-id: 20180710160013.26559-4-peter.maydell@linaro.org --- accel/tcg/translate-all.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'accel/tcg') diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 1571987..ff7d014 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -2121,7 +2121,9 @@ void tb_check_watchpoint(CPUState *cpu) cpu_get_tb_cpu_state(env, &pc, &cs_base, &flags); addr = get_page_addr_code(env, pc); - tb_invalidate_phys_range(addr, addr + 1); + if (addr != -1) { + tb_invalidate_phys_range(addr, addr + 1); + } } } -- cgit v1.1