[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 5/8] i386/cpu: Support thread and module level cache topology
From: |
Zhao Liu |
Subject: |
[PATCH 5/8] i386/cpu: Support thread and module level cache topology |
Date: |
Thu, 4 Jul 2024 11:16:00 +0800 |
Allows 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>
---
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 4ae3bbf30682..0ddbfa577caf 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -241,9 +241,15 @@ static uint32_t max_thread_ids_for_cache(X86CPUTopoInfo
*topo_info,
uint32_t num_ids = 0;
switch (share_level) {
+ case CPU_TOPO_LEVEL_THREAD:
+ num_ids = 1;
+ break;
case CPU_TOPO_LEVEL_CORE:
num_ids = 1 << apicid_core_offset(topo_info);
break;
+ case CPU_TOPO_LEVEL_MODULE:
+ num_ids = 1 << apicid_module_offset(topo_info);
+ break;
case CPU_TOPO_LEVEL_DIE:
num_ids = 1 << apicid_die_offset(topo_info);
break;
@@ -251,10 +257,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
- Re: [PATCH 2/8] qapi/qom: Introduce smp-cache object, (continued)
- Re: [PATCH 2/8] qapi/qom: Introduce smp-cache object, Zhao Liu, 2024/07/24
- Re: [PATCH 2/8] qapi/qom: Introduce smp-cache object, Markus Armbruster, 2024/07/25
- Message not available
- Re: [PATCH 2/8] qapi/qom: Introduce smp-cache object, Jonathan Cameron, 2024/07/25
- Re: [PATCH 2/8] qapi/qom: Introduce smp-cache object, Zhao Liu, 2024/07/25
- Re: [PATCH 2/8] qapi/qom: Introduce smp-cache object, Zhao Liu, 2024/07/25
[PATCH 3/8] hw/core: Add smp cache topology for machine, Zhao Liu, 2024/07/03
[PATCH 5/8] i386/cpu: Support thread and module level cache topology,
Zhao Liu <=
[PATCH 4/8] hw/core: Check smp cache topology support for machine, Zhao Liu, 2024/07/03
[PATCH 6/8] i386/cpu: Update cache topology with machine's configuration, Zhao Liu, 2024/07/03
[PATCH 7/8] i386/pc: Support cache topology in -machine for PC machine, Zhao Liu, 2024/07/03
[PATCH 8/8] qemu-options: Add the description of smp-cache object, Zhao Liu, 2024/07/03
Re: [PATCH 0/8] Introduce SMP Cache Topology, Zhao Liu, 2024/07/22