@@ -1520,7 +1520,7 @@ load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi,
1520
1520
mr = find_memory_region (uc , paddr );
1521
1521
if (mr == NULL ) {
1522
1522
uc -> invalid_error = UC_ERR_MAP ;
1523
- if (uc -> nested_level > 0 ) {
1523
+ if (uc -> nested_level > 0 && ! uc -> cpu -> stopped ) {
1524
1524
cpu_exit (uc -> cpu );
1525
1525
// XXX(@lazymio): We have to exit early so that the target register won't be overwritten
1526
1526
// because qemu might generate tcg code like:
@@ -1534,7 +1534,7 @@ load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi,
1534
1534
uc -> invalid_addr = paddr ;
1535
1535
uc -> invalid_error = error_code ;
1536
1536
// 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 ) {
1538
1538
cpu_exit (uc -> cpu );
1539
1539
// See comments above
1540
1540
cpu_loop_exit (uc -> cpu );
@@ -1592,7 +1592,7 @@ load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi,
1592
1592
uc -> invalid_addr = paddr ;
1593
1593
uc -> invalid_error = UC_ERR_READ_PROT ;
1594
1594
// 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 ) {
1596
1596
cpu_exit (uc -> cpu );
1597
1597
// See comments above
1598
1598
cpu_loop_exit (uc -> cpu );
@@ -1624,7 +1624,7 @@ load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi,
1624
1624
uc -> invalid_addr = paddr ;
1625
1625
uc -> invalid_error = UC_ERR_FETCH_PROT ;
1626
1626
// 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 ) {
1628
1628
cpu_exit (uc -> cpu );
1629
1629
// See comments above
1630
1630
cpu_loop_exit (uc -> cpu );
0 commit comments