From add7ed9bb57490e29371a542d47891b7c9210c43 Mon Sep 17 00:00:00 2001 From: Keqian Zhu Date: Sun, 6 Nov 2022 06:36:15 +0800 Subject: [PATCH 1/3] arm/virt: Fix vcpu hotplug idx_from_topo_ids Add missing "nr_threads" when compute cpu index. Fixes: 5454c0090823 ("arm/virt: Add CPU topology support") Signed-off-by: Keqian Zhu --- include/hw/arm/topology.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/arm/topology.h b/include/hw/arm/topology.h index d0dad1a9a3..33e4a0d552 100644 --- a/include/hw/arm/topology.h +++ b/include/hw/arm/topology.h @@ -39,7 +39,7 @@ static inline unsigned idx_from_topo_ids(unsigned nr_clusters, assert(topo != NULL); return topo->pkg_id * nr_clusters * nr_cores * nr_threads + - topo->cluster_id * nr_cores + + topo->cluster_id * nr_cores * nr_threads + topo->core_id * nr_threads + topo->smt_id; } -- 2.27.0