cpu-exec: Rename cpu_resume_from_signal() to cpu_loop_exit_noexc()
The function cpu_resume_from_signal() is now always called with a NULL puc argument, and is rather misnamed since it is never called from a signal handler. It is essentially forcing an exit to the top level cpu loop but without raising any exception, so rename it to cpu_loop_exit_noexc() and drop the useless unused argument. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Sergey Fedorov <sergey.fedorov@linaro.org> Acked-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Riku Voipio <riku.voipio@linaro.org> Message-id: 1463494687-25947-4-git-send-email-peter.maydell@linaro.org
This commit is contained in:
parent
f213e72f23
commit
6886b98036
@ -26,10 +26,8 @@
|
|||||||
bool exit_request;
|
bool exit_request;
|
||||||
CPUState *tcg_current_cpu;
|
CPUState *tcg_current_cpu;
|
||||||
|
|
||||||
/* exit the current TB from a signal handler. The host registers are
|
/* exit the current TB, but without causing any exception to be raised */
|
||||||
restored in a state compatible with the CPU emulator
|
void cpu_loop_exit_noexc(CPUState *cpu)
|
||||||
*/
|
|
||||||
void cpu_resume_from_signal(CPUState *cpu, void *puc)
|
|
||||||
{
|
{
|
||||||
/* XXX: restore cpu registers saved in host registers */
|
/* XXX: restore cpu registers saved in host registers */
|
||||||
|
|
||||||
|
2
exec.c
2
exec.c
@ -2091,7 +2091,7 @@ static void check_watchpoint(int offset, int len, MemTxAttrs attrs, int flags)
|
|||||||
} else {
|
} else {
|
||||||
cpu_get_tb_cpu_state(env, &pc, &cs_base, &cpu_flags);
|
cpu_get_tb_cpu_state(env, &pc, &cs_base, &cpu_flags);
|
||||||
tb_gen_code(cpu, pc, cs_base, cpu_flags, 1);
|
tb_gen_code(cpu, pc, cs_base, cpu_flags, 1);
|
||||||
cpu_resume_from_signal(cpu, NULL);
|
cpu_loop_exit_noexc(cpu);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -450,7 +450,7 @@ static void patch_instruction(VAPICROMState *s, X86CPU *cpu, target_ulong ip)
|
|||||||
|
|
||||||
if (!kvm_enabled()) {
|
if (!kvm_enabled()) {
|
||||||
tb_gen_code(cs, current_pc, current_cs_base, current_flags, 1);
|
tb_gen_code(cs, current_pc, current_cs_base, current_flags, 1);
|
||||||
cpu_resume_from_signal(cs, NULL);
|
cpu_loop_exit_noexc(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ void restore_state_to_opc(CPUArchState *env, struct TranslationBlock *tb,
|
|||||||
void cpu_gen_init(void);
|
void cpu_gen_init(void);
|
||||||
bool cpu_restore_state(CPUState *cpu, uintptr_t searched_pc);
|
bool cpu_restore_state(CPUState *cpu, uintptr_t searched_pc);
|
||||||
|
|
||||||
void QEMU_NORETURN cpu_resume_from_signal(CPUState *cpu, void *puc);
|
void QEMU_NORETURN cpu_loop_exit_noexc(CPUState *cpu);
|
||||||
void QEMU_NORETURN cpu_io_recompile(CPUState *cpu, uintptr_t retaddr);
|
void QEMU_NORETURN cpu_io_recompile(CPUState *cpu, uintptr_t retaddr);
|
||||||
TranslationBlock *tb_gen_code(CPUState *cpu,
|
TranslationBlock *tb_gen_code(CPUState *cpu,
|
||||||
target_ulong pc, target_ulong cs_base,
|
target_ulong pc, target_ulong cs_base,
|
||||||
|
@ -218,7 +218,7 @@ void breakpoint_handler(CPUState *cs)
|
|||||||
if (check_hw_breakpoints(env, false)) {
|
if (check_hw_breakpoints(env, false)) {
|
||||||
raise_exception(env, EXCP01_DB);
|
raise_exception(env, EXCP01_DB);
|
||||||
} else {
|
} else {
|
||||||
cpu_resume_from_signal(cs, NULL);
|
cpu_loop_exit_noexc(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -141,7 +141,7 @@ void lm32_debug_excp_handler(CPUState *cs)
|
|||||||
if (check_watchpoints(env)) {
|
if (check_watchpoints(env)) {
|
||||||
raise_exception(env, EXCP_WATCHPOINT);
|
raise_exception(env, EXCP_WATCHPOINT);
|
||||||
} else {
|
} else {
|
||||||
cpu_resume_from_signal(cs, NULL);
|
cpu_loop_exit_noexc(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -688,7 +688,7 @@ void s390x_cpu_debug_excp_handler(CPUState *cs)
|
|||||||
will be triggered, it will call load_psw which will recompute
|
will be triggered, it will call load_psw which will recompute
|
||||||
the watchpoints. */
|
the watchpoints. */
|
||||||
cpu_watchpoint_remove_all(cs, BP_CPU);
|
cpu_watchpoint_remove_all(cs, BP_CPU);
|
||||||
cpu_resume_from_signal(cs, NULL);
|
cpu_loop_exit_noexc(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_USER_ONLY */
|
#endif /* CONFIG_USER_ONLY */
|
||||||
|
@ -108,7 +108,7 @@ void xtensa_breakpoint_handler(CPUState *cs)
|
|||||||
if (cause) {
|
if (cause) {
|
||||||
debug_exception_env(env, cause);
|
debug_exception_env(env, cause);
|
||||||
}
|
}
|
||||||
cpu_resume_from_signal(cs, NULL);
|
cpu_loop_exit_noexc(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1395,7 +1395,7 @@ void tb_invalidate_phys_page_range(tb_page_addr_t start, tb_page_addr_t end,
|
|||||||
modifying the memory. It will ensure that it cannot modify
|
modifying the memory. It will ensure that it cannot modify
|
||||||
itself */
|
itself */
|
||||||
tb_gen_code(cpu, current_pc, current_cs_base, current_flags, 1);
|
tb_gen_code(cpu, current_pc, current_cs_base, current_flags, 1);
|
||||||
cpu_resume_from_signal(cpu, NULL);
|
cpu_loop_exit_noexc(cpu);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -1654,7 +1654,7 @@ void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr)
|
|||||||
repeating the fault, which is horribly inefficient.
|
repeating the fault, which is horribly inefficient.
|
||||||
Better would be to execute just this insn uncached, or generate a
|
Better would be to execute just this insn uncached, or generate a
|
||||||
second new TB. */
|
second new TB. */
|
||||||
cpu_resume_from_signal(cpu, NULL);
|
cpu_loop_exit_noexc(cpu);
|
||||||
}
|
}
|
||||||
|
|
||||||
void tb_flush_jmp_cache(CPUState *cpu, target_ulong addr)
|
void tb_flush_jmp_cache(CPUState *cpu, target_ulong addr)
|
||||||
|
@ -74,7 +74,7 @@ static void cpu_exit_tb_from_sighandler(CPUState *cpu, void *puc)
|
|||||||
sigprocmask(SIG_SETMASK, &uc->sc_mask, NULL);
|
sigprocmask(SIG_SETMASK, &uc->sc_mask, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
cpu_resume_from_signal(cpu, NULL);
|
cpu_loop_exit_noexc(cpu);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 'pc' is the host PC at which the exception was raised. 'address' is
|
/* 'pc' is the host PC at which the exception was raised. 'address' is
|
||||||
|
Loading…
Reference in New Issue
Block a user