[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 6/9] i386/cpu: Support thread and module level cache topology
From: |
Zhao Liu |
Subject: |
[PATCH v5 6/9] i386/cpu: Support thread and module level cache topology |
Date: |
Fri, 1 Nov 2024 16:33:28 +0800 |
Allow cache to be defined at the thread and module level. This
increases flexibility for x86 users to customize their cache topology.
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Tested-by: Yongwei Ma <yongwei.ma@intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
target/i386/cpu.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index d46710a4030f..09aaed95a856 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -243,9 +243,15 @@ static uint32_t max_thread_ids_for_cache(X86CPUTopoInfo
*topo_info,
uint32_t num_ids = 0;
switch (share_level) {
+ case CPU_TOPOLOGY_LEVEL_THREAD:
+ num_ids = 1;
+ break;
case CPU_TOPOLOGY_LEVEL_CORE:
num_ids = 1 << apicid_core_offset(topo_info);
break;
+ case CPU_TOPOLOGY_LEVEL_MODULE:
+ num_ids = 1 << apicid_module_offset(topo_info);
+ break;
case CPU_TOPOLOGY_LEVEL_DIE:
num_ids = 1 << apicid_die_offset(topo_info);
break;
@@ -253,10 +259,6 @@ static uint32_t max_thread_ids_for_cache(X86CPUTopoInfo
*topo_info,
num_ids = 1 << apicid_pkg_offset(topo_info);
break;
default:
- /*
- * Currently there is no use case for THREAD and MODULE, so use
- * assert directly to facilitate debugging.
- */
g_assert_not_reached();
}
--
2.34.1
- [PATCH v5 0/9] Introduce SMP Cache Topology, Zhao Liu, 2024/11/01
- [PATCH v5 1/9] i386/cpu: Don't enumerate the "invalid" CPU topology level, Zhao Liu, 2024/11/01
- [PATCH v5 2/9] hw/core: Make CPU topology enumeration arch-agnostic, Zhao Liu, 2024/11/01
- [PATCH v5 3/9] qapi/qom: Define cache enumeration and properties for machine, Zhao Liu, 2024/11/01
- [PATCH v5 4/9] hw/core: Check smp cache topology support for machine, Zhao Liu, 2024/11/01
- [PATCH v5 5/9] hw/core: Add a helper to check the cache topology level, Zhao Liu, 2024/11/01
- [PATCH v5 6/9] i386/cpu: Support thread and module level cache topology,
Zhao Liu <=
- [PATCH v5 7/9] i386/cpu: Update cache topology with machine's configuration, Zhao Liu, 2024/11/01
- [PATCH v5 8/9] i386/pc: Support cache topology in -machine for PC machine, Zhao Liu, 2024/11/01
- [PATCH v5 9/9] i386/cpu: add has_caches flag to check smp_cache configuration, Zhao Liu, 2024/11/01
- Re: [PATCH v5 0/9] Introduce SMP Cache Topology, Philippe Mathieu-Daudé, 2024/11/05