diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2021-09-17 17:32:56 -0700 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2021-11-02 07:00:52 -0400 |
commit | 72d2bbf9ff3e1edf5d57b53149eeaa36f19fb891 (patch) | |
tree | 6a99451d40f398e90b2421aec5da2a30c591e4b2 /include | |
parent | 09e94676ade52708cbece8fd4bd255a25b6ee475 (diff) | |
download | qemu-72d2bbf9ff3e1edf5d57b53149eeaa36f19fb891.zip qemu-72d2bbf9ff3e1edf5d57b53149eeaa36f19fb891.tar.gz qemu-72d2bbf9ff3e1edf5d57b53149eeaa36f19fb891.tar.bz2 |
linux-user: Add cpu_loop_exit_sigsegv
This is a new interface to be provided by the os emulator for
raising SIGSEGV on fault. Use the new record_sigsegv target hook.
Reviewed by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/exec/exec-all.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 5dd663c..f745785 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -685,6 +685,21 @@ MMUAccessType adjust_signal_pc(uintptr_t *pc, bool is_write); bool handle_sigsegv_accerr_write(CPUState *cpu, sigset_t *old_set, uintptr_t host_pc, abi_ptr guest_addr); +/** + * cpu_loop_exit_sigsegv: + * @cpu: the cpu context + * @addr: the guest address of the fault + * @access_type: access was read/write/execute + * @maperr: true for invalid page, false for permission fault + * @ra: host pc for unwinding + * + * Use the TCGCPUOps hook to record cpu state, do guest operating system + * specific things to raise SIGSEGV, and jump to the main cpu loop. + */ +void QEMU_NORETURN cpu_loop_exit_sigsegv(CPUState *cpu, target_ulong addr, + MMUAccessType access_type, + bool maperr, uintptr_t ra); + #else static inline void mmap_lock(void) {} static inline void mmap_unlock(void) {} |