[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v7 2/5] i386/cpu: Support module level cache topology
From: |
Zhao Liu |
Subject: |
[PATCH v7 2/5] i386/cpu: Support module level cache topology |
Date: |
Wed, 8 Jan 2025 23:01:47 +0800 |
Allow cache to be defined at the 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>
---
Changes since Patch v6:
* Dropped "thread" level cache topology support.
---
target/i386/cpu.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 660ddafc28b5..4728373fdf03 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -247,6 +247,9 @@ static uint32_t max_thread_ids_for_cache(X86CPUTopoInfo
*topo_info,
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;
@@ -255,7 +258,7 @@ static uint32_t max_thread_ids_for_cache(X86CPUTopoInfo
*topo_info,
break;
default:
/*
- * Currently there is no use case for THREAD and MODULE, so use
+ * Currently there is no use case for THREAD, so use
* assert directly to facilitate debugging.
*/
g_assert_not_reached();
--
2.34.1
- [PATCH v7 0/5] i386: Support SMP Cache Topology, Zhao Liu, 2025/01/08
- [PATCH v7 1/5] hw/core/machine: Reject thread level cache, Zhao Liu, 2025/01/08
- [PATCH v7 2/5] i386/cpu: Support module level cache topology,
Zhao Liu <=
- [PATCH v7 3/5] i386/cpu: Update cache topology with machine's configuration, Zhao Liu, 2025/01/08
- [PATCH v7 4/5] i386/pc: Support cache topology in -machine for PC machine, Zhao Liu, 2025/01/08
- [PATCH v7 5/5] i386/cpu: add has_caches flag to check smp_cache configuration, Zhao Liu, 2025/01/08
- RE: [PATCH v7 0/5] i386: Support SMP Cache Topology, Alireza Sanaee, 2025/01/10
- Re: [PATCH v7 0/5] i386: Support SMP Cache Topology, Jonathan Cameron, 2025/01/10