]> www.infradead.org Git - users/dwmw2/qemu.git/commit
accel/tcg: Clear PAGE_WRITE before translation
authorIlya Leoshkevich <iii@linux.ibm.com>
Thu, 5 Aug 2021 20:48:35 +0000 (22:48 +0200)
committerRichard Henderson <richard.henderson@linaro.org>
Tue, 14 Sep 2021 19:00:20 +0000 (12:00 -0700)
commitf025692c992c1ed6cc54ac2802cff14e9052c0d3
tree01931a3394d5f38e9f237de94ac0b82fcce8ff22
parent4e116893c6079b51efdc9e226be3f1a530f47f5e
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>
accel/tcg/translate-all.c
accel/tcg/translator.c
include/exec/translate-all.h
include/exec/translator.h