aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2021-03-01 19:21:08 -0800
committerRichard Henderson <richard.henderson@linaro.org>2021-03-06 11:53:57 -0800
commit6cc9d67c6f682cf04eea2d6e64a252b63a7eccdf (patch)
treef4a70ec6c66bcb37242891c9b544508b78f5a726 /include
parent872ebd884dd68ecef4c6f9f86c5da519f18bd31e (diff)
downloadqemu-6cc9d67c6f682cf04eea2d6e64a252b63a7eccdf.zip
qemu-6cc9d67c6f682cf04eea2d6e64a252b63a7eccdf.tar.gz
qemu-6cc9d67c6f682cf04eea2d6e64a252b63a7eccdf.tar.bz2
accel/tcg: Precompute curr_cflags into cpu->tcg_cflags
The primary motivation is to remove a dozen insns along the fast-path in tb_lookup. As a byproduct, this allows us to completely remove parallel_cpus. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/exec/exec-all.h7
-rw-r--r--include/hw/core/cpu.h2
2 files changed, 3 insertions, 6 deletions
diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
index a262dd5..6b036ca 100644
--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -513,8 +513,6 @@ struct TranslationBlock {
uintptr_t jmp_dest[2];
};
-extern bool parallel_cpus;
-
/* Hide the qatomic_read to make code a little easier on the eyes */
static inline uint32_t tb_cflags(const TranslationBlock *tb)
{
@@ -524,10 +522,7 @@ static inline uint32_t tb_cflags(const TranslationBlock *tb)
/* current cflags for hashing/comparison */
static inline uint32_t curr_cflags(CPUState *cpu)
{
- uint32_t cflags = deposit32(0, CF_CLUSTER_SHIFT, 8, cpu->cluster_index);
- cflags |= parallel_cpus ? CF_PARALLEL : 0;
- cflags |= icount_enabled() ? CF_USE_ICOUNT : 0;
- return cflags;
+ return cpu->tcg_cflags;
}
/* TranslationBlock invalidate API */
diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
index c005d3d..c68bc3b 100644
--- a/include/hw/core/cpu.h
+++ b/include/hw/core/cpu.h
@@ -282,6 +282,7 @@ struct qemu_work_item;
* to a cluster this will be UNASSIGNED_CLUSTER_INDEX; otherwise it will
* be the same as the cluster-id property of the CPU object's TYPE_CPU_CLUSTER
* QOM parent.
+ * @tcg_cflags: Pre-computed cflags for this cpu.
* @nr_cores: Number of cores within this CPU package.
* @nr_threads: Number of threads within this CPU.
* @running: #true if CPU is currently running (lockless).
@@ -412,6 +413,7 @@ struct CPUState {
/* TODO Move common fields from CPUArchState here. */
int cpu_index;
int cluster_index;
+ uint32_t tcg_cflags;
uint32_t halted;
uint32_t can_do_io;
int32_t exception_index;