/openbmc/qemu/tests/unit/ |
H A D | test-x86-topo.c | 31 X86CPUTopoInfo topo_info = {0}; in test_topo_bits() local 37 topo_info = (X86CPUTopoInfo) {1, 1, 1, 1}; in test_topo_bits() 38 g_assert_cmpuint(apicid_smt_width(&topo_info), ==, 0); in test_topo_bits() 39 g_assert_cmpuint(apicid_core_width(&topo_info), ==, 0); in test_topo_bits() 40 g_assert_cmpuint(apicid_module_width(&topo_info), ==, 0); in test_topo_bits() 41 g_assert_cmpuint(apicid_die_width(&topo_info), ==, 0); in test_topo_bits() 43 topo_info = (X86CPUTopoInfo) {1, 1, 1, 1}; in test_topo_bits() 44 g_assert_cmpuint(x86_apicid_from_cpu_idx(&topo_info, 0), ==, 0); in test_topo_bits() 45 g_assert_cmpuint(x86_apicid_from_cpu_idx(&topo_info, 1), ==, 1); in test_topo_bits() 46 g_assert_cmpuint(x86_apicid_from_cpu_idx(&topo_info, 2), ==, 2); in test_topo_bits() [all …]
|
/openbmc/qemu/include/hw/i386/ |
H A D | topology.h | 76 static inline unsigned apicid_smt_width(X86CPUTopoInfo *topo_info) in apicid_smt_width() argument 78 return apicid_bitwidth_for_count(topo_info->threads_per_core); in apicid_smt_width() 82 static inline unsigned apicid_core_width(X86CPUTopoInfo *topo_info) in apicid_core_width() argument 84 return apicid_bitwidth_for_count(topo_info->cores_per_module); in apicid_core_width() 88 static inline unsigned apicid_module_width(X86CPUTopoInfo *topo_info) in apicid_module_width() argument 90 return apicid_bitwidth_for_count(topo_info->modules_per_die); in apicid_module_width() 94 static inline unsigned apicid_die_width(X86CPUTopoInfo *topo_info) in apicid_die_width() argument 96 return apicid_bitwidth_for_count(topo_info->dies_per_pkg); in apicid_die_width() 100 static inline unsigned apicid_core_offset(X86CPUTopoInfo *topo_info) in apicid_core_offset() argument 102 return apicid_smt_width(topo_info); in apicid_core_offset() [all …]
|
H A D | x86.h | 113 void init_topo_info(X86CPUTopoInfo *topo_info, const X86MachineState *x86ms);
|
/openbmc/qemu/hw/i386/ |
H A D | x86.c | 42 void init_topo_info(X86CPUTopoInfo *topo_info, in init_topo_info() argument 47 topo_info->dies_per_pkg = ms->smp.dies; in init_topo_info() 54 topo_info->modules_per_die = ms->smp.modules; in init_topo_info() 55 topo_info->cores_per_module = ms->smp.cores; in init_topo_info() 56 topo_info->threads_per_core = ms->smp.threads; in init_topo_info() 70 X86CPUTopoInfo topo_info; in x86_cpu_apic_id_from_index() local 72 init_topo_info(&topo_info, x86ms); in x86_cpu_apic_id_from_index() 74 return x86_apicid_from_cpu_idx(&topo_info, cpu_index); in x86_cpu_apic_id_from_index() 91 X86CPUTopoInfo topo_info; in x86_get_default_cpu_node_id() local 93 init_topo_info(&topo_info, x86ms); in x86_get_default_cpu_node_id() [all …]
|
H A D | x86-common.c | 253 X86CPUTopoInfo topo_info; in x86_cpu_pre_plug() local 272 init_topo_info(&topo_info, x86ms); in x86_cpu_pre_plug() 351 cpu->apic_id = x86_apicid_from_topo_ids(&topo_info, &topo_ids); in x86_cpu_pre_plug() 356 x86_topo_ids_from_apicid(cpu->apic_id, &topo_info, &topo_ids); in x86_cpu_pre_plug() 379 x86_topo_ids_from_apicid(cpu->apic_id, &topo_info, &topo_ids); in x86_cpu_pre_plug()
|
/openbmc/qemu/target/i386/kvm/ |
H A D | vmsr_energy.c | 338 void vmsr_init_topo_info(X86CPUTopoInfo *topo_info, in vmsr_init_topo_info() argument 341 topo_info->dies_per_pkg = ms->smp.dies; in vmsr_init_topo_info() 342 topo_info->modules_per_die = ms->smp.modules; in vmsr_init_topo_info() 343 topo_info->cores_per_module = ms->smp.cores; in vmsr_init_topo_info() 344 topo_info->threads_per_core = ms->smp.threads; in vmsr_init_topo_info()
|
H A D | vmsr_energy.h | 96 void vmsr_init_topo_info(X86CPUTopoInfo *topo_info, const MachineState *ms);
|
/openbmc/qemu/target/i386/ |
H A D | cpu.c | 240 static uint32_t max_thread_ids_for_cache(X86CPUTopoInfo *topo_info, in max_thread_ids_for_cache() argument 247 num_ids = 1 << apicid_core_offset(topo_info); in max_thread_ids_for_cache() 250 num_ids = 1 << apicid_die_offset(topo_info); in max_thread_ids_for_cache() 253 num_ids = 1 << apicid_pkg_offset(topo_info); in max_thread_ids_for_cache() 266 static uint32_t max_core_ids_in_package(X86CPUTopoInfo *topo_info) in max_core_ids_in_package() argument 268 uint32_t num_cores = 1 << (apicid_pkg_offset(topo_info) - in max_core_ids_in_package() 269 apicid_core_offset(topo_info)); in max_core_ids_in_package() 275 X86CPUTopoInfo *topo_info, in encode_cache_cpuid4() argument 285 (max_core_ids_in_package(topo_info) << 26) | in encode_cache_cpuid4() 286 (max_thread_ids_for_cache(topo_info, cache->share_level) << 14); in encode_cache_cpuid4() [all …]
|