summaryrefslogtreecommitdiffstats
path: root/include/exec/tb-lookup.h
diff options
context:
space:
mode:
authorEmilio G. Cota2017-07-11 20:29:37 +0200
committerRichard Henderson2017-10-24 22:53:41 +0200
commit4e2ca83e71b51577b06b1468e836556912bd5b6e (patch)
treeb9fce2b5f36d6f171f8c80e932e25f9a25f1cd3e /include/exec/tb-lookup.h
parenttcg: Use offsets not indices for TCGv_* (diff)
downloadqemu-4e2ca83e71b51577b06b1468e836556912bd5b6e.tar.gz
qemu-4e2ca83e71b51577b06b1468e836556912bd5b6e.tar.xz
qemu-4e2ca83e71b51577b06b1468e836556912bd5b6e.zip
tcg: define CF_PARALLEL and use it for TB hashing along with CF_COUNT_MASK
This will enable us to decouple code translation from the value of parallel_cpus at any given time. It will also help us minimize TB flushes when generating code via EXCP_ATOMIC. Note that the declaration of parallel_cpus is brought to exec-all.h to be able to define there the "curr_cflags" inline. Signed-off-by: Emilio G. Cota <cota@braap.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'include/exec/tb-lookup.h')
-rw-r--r--include/exec/tb-lookup.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/exec/tb-lookup.h b/include/exec/tb-lookup.h
index 436b6d5ecf..296138591a 100644
--- a/include/exec/tb-lookup.h
+++ b/include/exec/tb-lookup.h
@@ -21,7 +21,7 @@
/* Might cause an exception, so have a longjmp destination ready */
static inline TranslationBlock *
tb_lookup__cpu_state(CPUState *cpu, target_ulong *pc, target_ulong *cs_base,
- uint32_t *flags)
+ uint32_t *flags, uint32_t cf_mask)
{
CPUArchState *env = (CPUArchState *)cpu->env_ptr;
TranslationBlock *tb;
@@ -35,10 +35,10 @@ tb_lookup__cpu_state(CPUState *cpu, target_ulong *pc, target_ulong *cs_base,
tb->cs_base == *cs_base &&
tb->flags == *flags &&
tb->trace_vcpu_dstate == *cpu->trace_dstate &&
- !(atomic_read(&tb->cflags) & CF_INVALID))) {
+ (tb_cflags(tb) & (CF_HASH_MASK | CF_INVALID)) == cf_mask)) {
return tb;
}
- tb = tb_htable_lookup(cpu, *pc, *cs_base, *flags);
+ tb = tb_htable_lookup(cpu, *pc, *cs_base, *flags, cf_mask);
if (tb == NULL) {
return NULL;
}