[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 31/38] i386/cpu: Drop cores_per_pkg in cpu_x86_cpuid()
From: |
Paolo Bonzini |
Subject: |
[PULL 31/38] i386/cpu: Drop cores_per_pkg in cpu_x86_cpuid() |
Date: |
Fri, 10 Jan 2025 19:46:12 +0100 |
From: Xiaoyao Li <xiaoyao.li@intel.com>
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 <xiaoyao.li@intel.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Link: https://lore.kernel.org/r/20241219110125.1266461-4-xiaoyao.li@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/cpu.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 579d9bac955..6d9c85576f6 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -6499,7 +6499,6 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index,
uint32_t count,
uint32_t limit;
uint32_t signature[3];
X86CPUTopoInfo topo_info;
- uint32_t cores_per_pkg;
uint32_t threads_per_pkg;
topo_info.dies_per_pkg = env->nr_dies;
@@ -6507,9 +6506,8 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index,
uint32_t count,
topo_info.cores_per_module = cs->nr_cores / env->nr_dies / env->nr_modules;
topo_info.threads_per_core = cs->nr_threads;
- cores_per_pkg = topo_info.cores_per_module * topo_info.modules_per_die *
- topo_info.dies_per_pkg;
- threads_per_pkg = cores_per_pkg * topo_info.threads_per_core;
+ threads_per_pkg = topo_info.threads_per_core * topo_info.cores_per_module *
+ topo_info.modules_per_die * topo_info.dies_per_pkg;
/* Calculate & apply limits for different index ranges */
if (index >= 0xC0000000) {
--
2.47.1
- [PULL 19/38] i386/cpu: Mark avx10_version filtered when prefix is NULL, (continued)
- [PULL 19/38] i386/cpu: Mark avx10_version filtered when prefix is NULL, Paolo Bonzini, 2025/01/10
- [PULL 22/38] target/i386/kvm: Only save/load kvmclock MSRs when kvmclock enabled, Paolo Bonzini, 2025/01/10
- [PULL 23/38] target/i386/kvm: Drop workaround for KVM_X86_DISABLE_EXITS_HTL typo, Paolo Bonzini, 2025/01/10
- [PULL 25/38] target/i386/kvm: Clean up return values of MSR filter related functions, Paolo Bonzini, 2025/01/10
- [PULL 26/38] target/i386/kvm: Return -1 when kvm_msr_energy_thread_init() fails, Paolo Bonzini, 2025/01/10
- [PULL 27/38] target/i386/kvm: Clean up error handling in kvm_arch_init(), Paolo Bonzini, 2025/01/10
- [PULL 32/38] i386/topology: Update the comment of x86_apicid_from_topo_ids(), Paolo Bonzini, 2025/01/10
- [PULL 20/38] target/i386/kvm: Add feature bit definitions for KVM CPUID, Paolo Bonzini, 2025/01/10
- [PULL 37/38] i386/cpu: Set up CPUID_HT in x86_cpu_expand_features() instead of cpu_x86_cpuid(), Paolo Bonzini, 2025/01/10
- [PULL 12/38] rust: qemu-api-macros: add automatic TryFrom/TryInto derivation, Paolo Bonzini, 2025/01/10
- [PULL 31/38] i386/cpu: Drop cores_per_pkg in cpu_x86_cpuid(),
Paolo Bonzini <=
- [PULL 35/38] i386/cpu: Hoist check of CPUID_EXT3_TOPOEXT against threads_per_core, Paolo Bonzini, 2025/01/10
- [PULL 38/38] i386/cpu: Set and track CPUID_EXT3_CMP_LEG in env->features[FEAT_8000_0001_ECX], Paolo Bonzini, 2025/01/10
- [PULL 36/38] cpu: Remove nr_cores from struct CPUState, Paolo Bonzini, 2025/01/10