qemu/accel/tcg
Peter Maydell 9fd9b7de61 accel/tcg: Consider cluster index in tb_lookup__cpu_state()
In commit f7b78602fd we added the CPU cluster number to the
cflags field of the TB hash; this included adding it to the value
kept in tb->cflags, since we pass that field directly into the hash
calculation in some places. Unfortunately we forgot to check whether
other parts of the code were doing comparisons against tb->cflags
that would need to be updated.

It turns out that there is exactly one such place: the
tb_lookup__cpu_state() function checks whether the TB it has
found in the tb_jmp_cache has a tb->cflags matching the cf_mask
that is passed in. The tb->cflags has the cluster_index in it
but the cf_mask does not.

Hoist the "add cluster index to the cf_mask" code up from
tb_htable_lookup() to tb_lookup__cpu_state() so it can be considered
in the "did this TB match in the jmp cache" condition, as well as
when we do the full hash lookup by physical PC, flags, etc.
(tb_htable_lookup() is only called from tb_lookup__cpu_state(),
so this change doesn't require any further knock-on changes.)

Fixes: f7b78602fd ("accel/tcg: Add cluster number to TCG TB hash")
Tested-by: Cleber Rosa <crosa@redhat.com>
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reported-by: Howard Spoelstra <hsp.cat7@gmail.com>
Reported-by: Cleber Rosa <crosa@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20190205151810.571-1-peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2019-02-06 03:39:24 +00:00
..
atomic_template.h tcg: Fix LGPL version number 2019-01-30 11:01:52 +01:00
cpu-exec-common.c tcg: Fix LGPL version number 2019-01-30 11:01:52 +01:00
cpu-exec.c accel/tcg: Consider cluster index in tb_lookup__cpu_state() 2019-02-06 03:39:24 +00:00
cputlb.c tcg: Fix LGPL version number 2019-01-30 11:01:52 +01:00
Makefile.objs tcg: Add generic vector expanders 2018-02-08 15:54:05 +00:00
softmmu_template.h tcg: Fix LGPL version number 2019-01-30 11:01:52 +01:00
tcg-all.c tcg: access cpu->icount_decr.u16.high with atomics 2018-10-18 18:58:10 -07:00
tcg-runtime-gvec.c tcg: Fix LGPL version number 2019-01-30 11:01:52 +01: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: Add opcodes for vector minmax arithmetic 2019-01-28 07:03:34 -08:00
trace-events trace-events: fix code style: print 0x before hex numbers 2017-08-01 12:13:07 +01:00
translate-all.c tcg: Fix LGPL version number 2019-01-30 11:01:52 +01:00
translate-all.h tcg: Fix LGPL version number 2019-01-30 11:01:52 +01:00
translator.c translator: fix breakpoint processing 2018-10-02 19:08:57 +02:00
user-exec-stub.c i386/cpu: make -cpu host support monitor/mwait 2018-06-29 13:02:47 +02:00
user-exec.c tcg: Fix LGPL version number 2019-01-30 11:01:52 +01:00