Skip to content

Commit 994813a

Browse files
committed
Also check cpu->stopped
1 parent be2f092 commit 994813a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

qemu/accel/tcg/cputlb.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -1520,7 +1520,7 @@ load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi,
15201520
mr = find_memory_region(uc, paddr);
15211521
if (mr == NULL) {
15221522
uc->invalid_error = UC_ERR_MAP;
1523-
if (uc->nested_level > 0) {
1523+
if (uc->nested_level > 0 && !uc->cpu->stopped) {
15241524
cpu_exit(uc->cpu);
15251525
// XXX(@lazymio): We have to exit early so that the target register won't be overwritten
15261526
// because qemu might generate tcg code like:
@@ -1534,7 +1534,7 @@ load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi,
15341534
uc->invalid_addr = paddr;
15351535
uc->invalid_error = error_code;
15361536
// printf("***** Invalid fetch (unmapped memory) at " TARGET_FMT_lx "\n", addr);
1537-
if (uc->nested_level > 0) {
1537+
if (uc->nested_level > 0 && !uc->cpu->stopped) {
15381538
cpu_exit(uc->cpu);
15391539
// See comments above
15401540
cpu_loop_exit(uc->cpu);
@@ -1592,7 +1592,7 @@ load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi,
15921592
uc->invalid_addr = paddr;
15931593
uc->invalid_error = UC_ERR_READ_PROT;
15941594
// printf("***** Invalid memory read (non-readable) at " TARGET_FMT_lx "\n", addr);
1595-
if (uc->nested_level > 0) {
1595+
if (uc->nested_level > 0 && !uc->cpu->stopped) {
15961596
cpu_exit(uc->cpu);
15971597
// See comments above
15981598
cpu_loop_exit(uc->cpu);
@@ -1624,7 +1624,7 @@ load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi,
16241624
uc->invalid_addr = paddr;
16251625
uc->invalid_error = UC_ERR_FETCH_PROT;
16261626
// printf("***** Invalid fetch (non-executable) at " TARGET_FMT_lx "\n", addr);
1627-
if (uc->nested_level > 0) {
1627+
if (uc->nested_level > 0 && !uc->cpu->stopped) {
16281628
cpu_exit(uc->cpu);
16291629
// See comments above
16301630
cpu_loop_exit(uc->cpu);

0 commit comments

Comments
 (0)