[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 30/38] i386/cpu: Drop the variable smp_cores and smp_threads in x8
From: |
Paolo Bonzini |
Subject: |
[PULL 30/38] i386/cpu: Drop the variable smp_cores and smp_threads in x86_cpu_pre_plug() |
Date: |
Fri, 10 Jan 2025 19:46:11 +0100 |
From: Xiaoyao Li <xiaoyao.li@intel.com>
No need to define smp_cores and smp_threads, just using ms->smp.cores
and ms->smp.threads is straightforward. It's also consistent with other
checks of socket/die/module.
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-3-xiaoyao.li@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
hw/i386/x86-common.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/hw/i386/x86-common.c b/hw/i386/x86-common.c
index a7d46c31059..5b0629f9ad3 100644
--- a/hw/i386/x86-common.c
+++ b/hw/i386/x86-common.c
@@ -248,8 +248,6 @@ void x86_cpu_pre_plug(HotplugHandler *hotplug_dev,
CPUX86State *env = &cpu->env;
MachineState *ms = MACHINE(hotplug_dev);
X86MachineState *x86ms = X86_MACHINE(hotplug_dev);
- unsigned int smp_cores = ms->smp.cores;
- unsigned int smp_threads = ms->smp.threads;
X86CPUTopoInfo topo_info;
if (!object_dynamic_cast(OBJECT(cpu), ms->cpu_type)) {
@@ -329,17 +327,17 @@ void x86_cpu_pre_plug(HotplugHandler *hotplug_dev,
if (cpu->core_id < 0) {
error_setg(errp, "CPU core-id is not set");
return;
- } else if (cpu->core_id > (smp_cores - 1)) {
+ } else if (cpu->core_id > (ms->smp.cores - 1)) {
error_setg(errp, "Invalid CPU core-id: %u must be in range 0:%u",
- cpu->core_id, smp_cores - 1);
+ cpu->core_id, ms->smp.cores - 1);
return;
}
if (cpu->thread_id < 0) {
error_setg(errp, "CPU thread-id is not set");
return;
- } else if (cpu->thread_id > (smp_threads - 1)) {
+ } else if (cpu->thread_id > (ms->smp.threads - 1)) {
error_setg(errp, "Invalid CPU thread-id: %u must be in range 0:%u",
- cpu->thread_id, smp_threads - 1);
+ cpu->thread_id, ms->smp.threads - 1);
return;
}
--
2.47.1
- [PULL 03/38] rust: qom: add ParentField, (continued)
- [PULL 03/38] rust: qom: add ParentField, Paolo Bonzini, 2025/01/10
- [PULL 10/38] rust: qom: make INSTANCE_POST_INIT take a shared reference, Paolo Bonzini, 2025/01/10
- [PULL 17/38] target/i386: improve code generation for BT, Paolo Bonzini, 2025/01/10
- [PULL 06/38] rust: macros: check that the first field of a #[derive(Object)] struct is a ParentField, Paolo Bonzini, 2025/01/10
- [PULL 05/38] rust: macros: check that #[derive(Object)] requires #[repr(C)], Paolo Bonzini, 2025/01/10
- [PULL 11/38] rust: qemu-api-macros: extend error reporting facility to parse errors, Paolo Bonzini, 2025/01/10
- [PULL 13/38] rust: qdev: expose inherited methods to subclasses of SysBusDevice, Paolo Bonzini, 2025/01/10
- [PULL 21/38] target/i386/kvm: Remove local MSR_KVM_WALL_CLOCK and MSR_KVM_SYSTEM_TIME definitions, Paolo Bonzini, 2025/01/10
- [PULL 24/38] target/i386/confidential-guest: Fix comment of x86_confidential_guest_kvm_type(), Paolo Bonzini, 2025/01/10
- [PULL 33/38] i386/topology: Introduce helpers for various topology info of different level, Paolo Bonzini, 2025/01/10
- [PULL 30/38] i386/cpu: Drop the variable smp_cores and smp_threads in x86_cpu_pre_plug(),
Paolo Bonzini <=
- [PULL 34/38] i386/cpu: Track a X86CPUTopoInfo directly in CPUX86State, Paolo Bonzini, 2025/01/10
- [PULL 28/38] target/i386/kvm: Replace ARRAY_SIZE(msr_handlers) with KVM_MSR_FILTER_MAX_RANGES, Paolo Bonzini, 2025/01/10
- [PULL 29/38] i386/cpu: Extract a common fucntion to setup value of MSR_CORE_THREAD_COUNT, Paolo Bonzini, 2025/01/10
- [PULL 18/38] target/i386: use shr to load high-byte registers into T0/T1, Paolo Bonzini, 2025/01/10
- [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