From 994813a0e55731b84ff81a1ceb5a31a589062e6a Mon Sep 17 00:00:00 2001 From: mio Date: Fri, 19 May 2023 23:24:42 +0200 Subject: [PATCH] Also check cpu->stopped --- qemu/accel/tcg/cputlb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qemu/accel/tcg/cputlb.c b/qemu/accel/tcg/cputlb.c index 3d0ae80f..65b77bf0 100644 --- a/qemu/accel/tcg/cputlb.c +++ b/qemu/accel/tcg/cputlb.c @@ -1520,7 +1520,7 @@ load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi, mr = find_memory_region(uc, paddr); if (mr == NULL) { uc->invalid_error = UC_ERR_MAP; - if (uc->nested_level > 0) { + if (uc->nested_level > 0 && !uc->cpu->stopped) { cpu_exit(uc->cpu); // XXX(@lazymio): We have to exit early so that the target register won't be overwritten // because qemu might generate tcg code like: @@ -1534,7 +1534,7 @@ load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi, uc->invalid_addr = paddr; uc->invalid_error = error_code; // printf("***** Invalid fetch (unmapped memory) at " TARGET_FMT_lx "\n", addr); - if (uc->nested_level > 0) { + if (uc->nested_level > 0 && !uc->cpu->stopped) { cpu_exit(uc->cpu); // See comments above cpu_loop_exit(uc->cpu); @@ -1592,7 +1592,7 @@ load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi, uc->invalid_addr = paddr; uc->invalid_error = UC_ERR_READ_PROT; // printf("***** Invalid memory read (non-readable) at " TARGET_FMT_lx "\n", addr); - if (uc->nested_level > 0) { + if (uc->nested_level > 0 && !uc->cpu->stopped) { cpu_exit(uc->cpu); // See comments above cpu_loop_exit(uc->cpu); @@ -1624,7 +1624,7 @@ load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi, uc->invalid_addr = paddr; uc->invalid_error = UC_ERR_FETCH_PROT; // printf("***** Invalid fetch (non-executable) at " TARGET_FMT_lx "\n", addr); - if (uc->nested_level > 0) { + if (uc->nested_level > 0 && !uc->cpu->stopped) { cpu_exit(uc->cpu); // See comments above cpu_loop_exit(uc->cpu);