From ec603b5584fa71213ef8f324fe89e4b27cc9d2bc Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Tue, 14 Nov 2017 10:34:20 +0100 Subject: tcg: Record code_gen_buffer address for user-only memory helpers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When we handle a signal from a fault within a user-only memory helper, we cannot cpu_restore_state with the PC found within the signal frame. Use a TLS variable, helper_retaddr, to record the unwind start point to find the faulting guest insn. Tested-by: Alex Bennée Reviewed-by: Alex Bennée Reported-by: Peter Maydell Signed-off-by: Richard Henderson --- include/exec/cpu_ldst.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/exec/cpu_ldst.h') diff --git a/include/exec/cpu_ldst.h b/include/exec/cpu_ldst.h index 6eb5fe8..191f2e9 100644 --- a/include/exec/cpu_ldst.h +++ b/include/exec/cpu_ldst.h @@ -76,6 +76,8 @@ #if defined(CONFIG_USER_ONLY) +extern __thread uintptr_t helper_retaddr; + /* In user-only mode we provide only the _code and _data accessors. */ #define MEMSUFFIX _data -- cgit v1.1