Skip to content

Commit 00ec7be

Browse files
calmisibonzini
authored andcommitted
i386/cpu: Drop cores_per_pkg in cpu_x86_cpuid()
Local variable cores_per_pkg is only used to calculate threads_per_pkg. No need for it. Drop it and open-code it instead. Signed-off-by: Xiaoyao Li <[email protected]> Reviewed-by: Zhao Liu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 81bd606 commit 00ec7be

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

target/i386/cpu.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6499,17 +6499,15 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
64996499
uint32_t limit;
65006500
uint32_t signature[3];
65016501
X86CPUTopoInfo topo_info;
6502-
uint32_t cores_per_pkg;
65036502
uint32_t threads_per_pkg;
65046503

65056504
topo_info.dies_per_pkg = env->nr_dies;
65066505
topo_info.modules_per_die = env->nr_modules;
65076506
topo_info.cores_per_module = cs->nr_cores / env->nr_dies / env->nr_modules;
65086507
topo_info.threads_per_core = cs->nr_threads;
65096508

6510-
cores_per_pkg = topo_info.cores_per_module * topo_info.modules_per_die *
6511-
topo_info.dies_per_pkg;
6512-
threads_per_pkg = cores_per_pkg * topo_info.threads_per_core;
6509+
threads_per_pkg = topo_info.threads_per_core * topo_info.cores_per_module *
6510+
topo_info.modules_per_die * topo_info.dies_per_pkg;
65136511

65146512
/* Calculate & apply limits for different index ranges */
65156513
if (index >= 0xC0000000) {

0 commit comments

Comments
 (0)