qemu-patch-raspberry4/accel/tcg
Emilio G. Cota a688e73ba8 translate-all: fix locking of TBs whose two pages share the same physical page
Commit 0b5c91f ("translate-all: use per-page locking in !user-mode",
2018-06-15) introduced per-page locking. It assumed that the physical
pages corresponding to a TB (at most two pages) are always distinct,
which is wrong. For instance, an xtensa test provided by Max Filippov
is broken by the commit, since the test maps two virtual pages
to the same physical page:

	virt1: 7fff, virt2: 8000
	phys1 6000fff, phys2 6000000

Fix it by removing the assumption from page_lock_pair.
If the two physical page addresses are equal, we only lock
the PageDesc once. Note that the two callers of page_lock_pair,
namely page_unlock_tb and tb_link_page, are also updated so that
we do not try to unlock the same PageDesc twice.

Fixes: 0b5c91f74f
Reported-by: Max Filippov <jcmvbkbc@gmail.com>
Tested-by: Max Filippov <jcmvbkbc@gmail.com>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Emilio G. Cota <cota@braap.org>
Message-Id: <1529944302-14186-1-git-send-email-cota@braap.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2018-07-02 08:02:20 -07:00
..
atomic_template.h trace: enable tracing of TCG atomics 2018-06-27 11:09:24 +01:00
cpu-exec-common.c icount: fix cpu_restore_state_from_tb for non-tb-exit cases 2018-04-11 09:05:22 +10:00
cpu-exec.c tcg: remove tb_lock 2018-06-15 08:18:48 -10:00
cputlb.c tcg: Support MMU protection regions smaller than TARGET_PAGE_SIZE 2018-06-26 17:50:41 +01:00
Makefile.objs tcg: Add generic vector expanders 2018-02-08 15:54:05 +00:00
softmmu_template.h tcg: Support MMU protection regions smaller than TARGET_PAGE_SIZE 2018-06-26 17:50:41 +01:00
tcg-all.c tcg: make tcg_allowed global 2017-07-04 16:01:16 +02:00
tcg-runtime-gvec.c tcg: Fix out-of-line generic vector compares 2018-04-06 23:08:50 +10:00
tcg-runtime.c tcg: add cs_base and flags to -d exec output 2017-12-29 12:43:40 -08:00
tcg-runtime.h tcg: Introduce atomic helpers for integer min/max 2018-05-10 18:10:57 +01:00
trace-events trace-events: fix code style: print 0x before hex numbers 2017-08-01 12:13:07 +01:00
translate-all.c translate-all: fix locking of TBs whose two pages share the same physical page 2018-07-02 08:02:20 -07:00
translate-all.h move public invalidate APIs out of translate-all.{c,h}, clean up 2018-06-28 19:05:30 +02:00
translator.c translator: merge max_insns into DisasContextBase 2018-05-09 10:12:21 -07:00
user-exec-stub.c i386/cpu: make -cpu host support monitor/mwait 2018-06-29 13:02:47 +02:00
user-exec.c icount: fix cpu_restore_state_from_tb for non-tb-exit cases 2018-04-11 09:05:22 +10:00