diff --git a/qemu/cpu-exec-common.c b/qemu/cpu-exec-common.c index ef134f58..f1289f1d 100644 --- a/qemu/cpu-exec-common.c +++ b/qemu/cpu-exec-common.c @@ -26,11 +26,8 @@ /* exit the current TB from a signal handler. The host registers are restored in a state compatible with the CPU emulator */ -#if defined(CONFIG_SOFTMMU) - void cpu_resume_from_signal(CPUState *cpu, void *puc) { -#endif /* XXX: restore cpu registers saved in host registers */ cpu->exception_index = -1; diff --git a/qemu/translate-all.c b/qemu/translate-all.c index 7324174b..624554a8 100644 --- a/qemu/translate-all.c +++ b/qemu/translate-all.c @@ -2059,7 +2059,7 @@ static int page_check_range(target_ulong start, target_ulong len, int flags) /* unprotect the page if it was put read-only because it contains translated code */ if (!(p->flags & PAGE_WRITE)) { - if (!page_unprotect(addr, 0, NULL)) { + if (!page_unprotect(addr, 0)) { return -1; } } @@ -2069,8 +2069,12 @@ static int page_check_range(target_ulong start, target_ulong len, int flags) } /* called from signal handler: invalidate the code and unprotect the - page. Return TRUE if the fault was successfully handled. */ -static int page_unprotect(target_ulong address, uintptr_t pc, void *puc) + * page. Return 0 if the fault was not handled, 1 if it was handled, + * and 2 if it was handled but the caller must cause the TB to be + * immediately exited. (We can only return 2 if the 'pc' argument is + * non-zero.) + */ +int page_unprotect(target_ulong address, uintptr_t pc) { unsigned int prot; PageDesc *p; @@ -2103,7 +2107,7 @@ static int page_unprotect(target_ulong address, uintptr_t pc, void *puc) the corresponding translated code. */ if (tb_invalidate_phys_page(addr, pc)) { mmap_unlock(); - cpu_resume_from_signal(current_cpu, puc); + return 2; } #ifdef DEBUG_TB_CHECK tb_invalidate_check(addr); diff --git a/qemu/translate-all.h b/qemu/translate-all.h index 8d5a48ed..87d1b942 100644 --- a/qemu/translate-all.h +++ b/qemu/translate-all.h @@ -28,7 +28,7 @@ void tb_invalidate_phys_range(struct uc_struct *uc, tb_page_addr_t start, tb_pag void tb_cleanup(struct uc_struct *uc); #ifdef CONFIG_USER_ONLY -int page_unprotect(target_ulong address, uintptr_t pc, void *puc); +int page_unprotect(target_ulong address, uintptr_t pc); #endif #endif /* TRANSLATE_ALL_H */