aboutsummaryrefslogtreecommitdiff
path: root/include/exec/translate-all.h
diff options
context:
space:
mode:
authorIlya Leoshkevich <iii@linux.ibm.com>2021-08-05 22:48:35 +0200
committerRichard Henderson <richard.henderson@linaro.org>2021-09-14 12:00:20 -0700
commitf025692c992c1ed6cc54ac2802cff14e9052c0d3 (patch)
tree01931a3394d5f38e9f237de94ac0b82fcce8ff22 /include/exec/translate-all.h
parent4e116893c6079b51efdc9e226be3f1a530f47f5e (diff)
accel/tcg: Clear PAGE_WRITE before translation
translate_insn() implementations fetch instruction bytes piecemeal, which can cause qemu-user to generate inconsistent translations if another thread modifies them concurrently [1]. Fix by making pages containing translated instruction non-writable right before loading instruction bytes from them. [1] https://lists.nongnu.org/archive/html/qemu-devel/2021-08/msg00644.html Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Message-Id: <20210805204835.158918-1-iii@linux.ibm.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'include/exec/translate-all.h')
-rw-r--r--include/exec/translate-all.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/exec/translate-all.h b/include/exec/translate-all.h
index a557b4e2bb..9f646389af 100644
--- a/include/exec/translate-all.h
+++ b/include/exec/translate-all.h
@@ -33,6 +33,7 @@ void tb_invalidate_phys_page_range(tb_page_addr_t start, tb_page_addr_t end);
void tb_check_watchpoint(CPUState *cpu, uintptr_t retaddr);
#ifdef CONFIG_USER_ONLY
+void page_protect(tb_page_addr_t page_addr);
int page_unprotect(target_ulong address, uintptr_t pc);
#endif