aboutsummaryrefslogtreecommitdiff
path: root/accel
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2023-02-16 10:09:48 +0100
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2023-02-27 22:29:01 +0100
commita371975ef6f634a2322b3dd19682dc0d12d4c77a (patch)
tree0f556042edc3e3722b5e6c9ec78928e467596c6f /accel
parent2d2f2507c65bbb79bb2f0157db3f73ec114d9b32 (diff)
downloadqemu-a371975ef6f634a2322b3dd19682dc0d12d4c77a.zip
qemu-a371975ef6f634a2322b3dd19682dc0d12d4c77a.tar.gz
qemu-a371975ef6f634a2322b3dd19682dc0d12d4c77a.tar.bz2
hw/cpu: Extend CPUState::cluster_index documentation
Copy part of the description of commit f7b78602fd ("accel/tcg: Add cluster number to TCG TB hash") in tcg_cpu_init_cflags(), improving a bit CPUState::cluster_index documentation. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20230216142338.82982-2-philmd@linaro.org>
Diffstat (limited to 'accel')
-rw-r--r--accel/tcg/tcg-accel-ops.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c
index d9228fd..aeb1cba 100644
--- a/accel/tcg/tcg-accel-ops.c
+++ b/accel/tcg/tcg-accel-ops.c
@@ -44,7 +44,18 @@
void tcg_cpu_init_cflags(CPUState *cpu, bool parallel)
{
- uint32_t cflags = cpu->cluster_index << CF_CLUSTER_SHIFT;
+ uint32_t cflags;
+
+ /*
+ * Include the cluster number in the hash we use to look up TBs.
+ * This is important because a TB that is valid for one cluster at
+ * a given physical address and set of CPU flags is not necessarily
+ * valid for another:
+ * the two clusters may have different views of physical memory, or
+ * may have different CPU features (eg FPU present or absent).
+ */
+ cflags = cpu->cluster_index << CF_CLUSTER_SHIFT;
+
cflags |= parallel ? CF_PARALLEL : 0;
cflags |= icount_enabled() ? CF_USE_ICOUNT : 0;
cpu->tcg_cflags = cflags;