Commit 6f5a9f7e56ab8dfeacca9ac779c0661261642873
1 parent
4a38940d
fixed async signal support for tb_phys_invalidate()
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1670 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
12 additions
and
5 deletions
exec.c
... | ... | @@ -672,12 +672,19 @@ void tb_invalidate_phys_page_range(target_ulong start, target_ulong end, |
672 | 672 | #endif |
673 | 673 | } |
674 | 674 | #endif /* TARGET_HAS_PRECISE_SMC */ |
675 | - saved_tb = env->current_tb; | |
676 | - env->current_tb = NULL; | |
675 | + /* we need to do that to handle the case where a signal | |
676 | + occurs while doing tb_phys_invalidate() */ | |
677 | + saved_tb = NULL; | |
678 | + if (env) { | |
679 | + saved_tb = env->current_tb; | |
680 | + env->current_tb = NULL; | |
681 | + } | |
677 | 682 | tb_phys_invalidate(tb, -1); |
678 | - env->current_tb = saved_tb; | |
679 | - if (env->interrupt_request && env->current_tb) | |
680 | - cpu_interrupt(env, env->interrupt_request); | |
683 | + if (env) { | |
684 | + env->current_tb = saved_tb; | |
685 | + if (env->interrupt_request && env->current_tb) | |
686 | + cpu_interrupt(env, env->interrupt_request); | |
687 | + } | |
681 | 688 | } |
682 | 689 | tb = tb_next; |
683 | 690 | } | ... | ... |