diff mbox series

[RFC,4/4] cpu: Remove nr_cores from struct CPUState

Message ID 20241205145716.472456-5-xiaoyao.li@intel.com (mailing list archive)
State New
Headers show
Series cpu: Drop CPUState::nr_cores | expand

Commit Message

Xiaoyao Li Dec. 5, 2024, 2:57 p.m. UTC
There is no user of it now, remove it.

Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
---
 hw/core/cpu-common.c  | 1 -
 hw/i386/x86-common.c  | 2 +-
 include/hw/core/cpu.h | 2 --
 system/cpus.c         | 1 -
 4 files changed, 1 insertion(+), 5 deletions(-)

Comments

Zhao Liu Dec. 11, 2024, 2:56 a.m. UTC | #1
On Thu, Dec 05, 2024 at 09:57:16AM -0500, Xiaoyao Li wrote:
> Date: Thu, 5 Dec 2024 09:57:16 -0500
> From: Xiaoyao Li <xiaoyao.li@intel.com>
> Subject: [RFC PATCH 4/4] cpu: Remove nr_cores from struct CPUState
> X-Mailer: git-send-email 2.34.1
> 
> There is no user of it now, remove it.
> 
> Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
> ---
>  hw/core/cpu-common.c  | 1 -
>  hw/i386/x86-common.c  | 2 +-
>  include/hw/core/cpu.h | 2 --
>  system/cpus.c         | 1 -
>  4 files changed, 1 insertion(+), 5 deletions(-)
> 

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
diff mbox series

Patch

diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c
index 09c79035949b..77089d4ed304 100644
--- a/hw/core/cpu-common.c
+++ b/hw/core/cpu-common.c
@@ -243,7 +243,6 @@  static void cpu_common_initfn(Object *obj)
     cpu->cluster_index = UNASSIGNED_CLUSTER_INDEX;
     /* user-mode doesn't have configurable SMP topology */
     /* the default value is changed by qemu_init_vcpu() for system-mode */
-    cpu->nr_cores = 1;
     cpu->nr_threads = 1;
     cpu->cflags_next_tb = -1;
 
diff --git a/hw/i386/x86-common.c b/hw/i386/x86-common.c
index f7a20c1da30c..2dd7d8e34b76 100644
--- a/hw/i386/x86-common.c
+++ b/hw/i386/x86-common.c
@@ -377,7 +377,7 @@  void x86_cpu_pre_plug(HotplugHandler *hotplug_dev,
      */
     /* TODO: move socket_id/core_id/thread_id checks into x86_cpu_realizefn()
      * once -smp refactoring is complete and there will be CPU private
-     * CPUState::nr_cores and CPUState::nr_threads fields instead of globals */
+     * CPUState::nr_threads fields instead of globals */
     x86_topo_ids_from_apicid(cpu->apic_id, &topo_info, &topo_ids);
     if (cpu->socket_id != -1 && cpu->socket_id != topo_ids.pkg_id) {
         error_setg(errp, "property socket-id: %u doesn't match set apic-id:"
diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
index c3ca0babcb3f..fb397cdfc53d 100644
--- a/include/hw/core/cpu.h
+++ b/include/hw/core/cpu.h
@@ -407,7 +407,6 @@  struct qemu_work_item;
  *   Under TCG this value is propagated to @tcg_cflags.
  *   See TranslationBlock::TCG CF_CLUSTER_MASK.
  * @tcg_cflags: Pre-computed cflags for this cpu.
- * @nr_cores: Number of cores within this CPU package.
  * @nr_threads: Number of threads within this CPU core.
  * @thread: Host thread details, only live once @created is #true
  * @sem: WIN32 only semaphore used only for qtest
@@ -466,7 +465,6 @@  struct CPUState {
     CPUClass *cc;
     /*< public >*/
 
-    int nr_cores;
     int nr_threads;
 
     struct QemuThread *thread;
diff --git a/system/cpus.c b/system/cpus.c
index 1c818ff6828c..909d8128e81b 100644
--- a/system/cpus.c
+++ b/system/cpus.c
@@ -666,7 +666,6 @@  void qemu_init_vcpu(CPUState *cpu)
 {
     MachineState *ms = MACHINE(qdev_get_machine());
 
-    cpu->nr_cores = machine_topo_get_cores_per_socket(ms);
     cpu->nr_threads =  ms->smp.threads;
     cpu->stopped = true;
     cpu->random_seed = qemu_guest_random_seed_thread_part1();