[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH 1/5] hw/boards: Add sockets in CpuTopology struc
From: |
Moger, Babu |
Subject: |
[Qemu-devel] [RFC PATCH 1/5] hw/boards: Add sockets in CpuTopology structure |
Date: |
Wed, 31 Jul 2019 23:20:46 +0000 |
Add sockets in CpuTopology. This is required when building
the CPU topology.
Signed-off-by: Babu Moger <address@hidden>
---
hw/core/machine.c | 1 +
hw/i386/pc.c | 1 +
include/hw/boards.h | 2 ++
vl.c | 1 +
4 files changed, 5 insertions(+)
diff --git a/hw/core/machine.c b/hw/core/machine.c
index c58a8e594e..4034b7e903 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -795,6 +795,7 @@ static void smp_parse(MachineState *ms, QemuOpts *opts)
ms->smp.cpus = cpus;
ms->smp.cores = cores;
ms->smp.threads = threads;
+ ms->smp.sockets = sockets;
}
if (ms->smp.cpus > 1) {
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 549c437050..ef39463fd5 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1605,6 +1605,7 @@ void pc_smp_parse(MachineState *ms, QemuOpts *opts)
ms->smp.cpus = cpus;
ms->smp.cores = cores;
ms->smp.threads = threads;
+ ms->smp.sockets = sockets;
pcms->smp_dies = dies;
}
diff --git a/include/hw/boards.h b/include/hw/boards.h
index a71d1a53a5..12eb5032a5 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -245,12 +245,14 @@ typedef struct DeviceMemoryState {
* @cpus: the number of present logical processors on the machine
* @cores: the number of cores in one package
* @threads: the number of threads in one core
+ * @sockets: the number of sockets on the machine
* @max_cpus: the maximum number of logical processors on the machine
*/
typedef struct CpuTopology {
unsigned int cpus;
unsigned int cores;
unsigned int threads;
+ unsigned int sockets;
unsigned int max_cpus;
} CpuTopology;
diff --git a/vl.c b/vl.c
index b426b32134..d8faf5ab43 100644
--- a/vl.c
+++ b/vl.c
@@ -3981,6 +3981,7 @@ int main(int argc, char **argv, char **envp)
current_machine->smp.max_cpus = machine_class->default_cpus;
current_machine->smp.cores = 1;
current_machine->smp.threads = 1;
+ current_machine->smp.sockets = 1;
machine_class->smp_parse(current_machine,
qemu_opts_find(qemu_find_opts("smp-opts"), NULL));
--
2.20.1
- [Qemu-devel] [RFC PATCH 0/5] APIC ID fixes for AMD EPYC CPU models, Moger, Babu, 2019/07/31
- [Qemu-devel] [RFC PATCH 1/5] hw/boards: Add sockets in CpuTopology structure,
Moger, Babu <=
- [Qemu-devel] [RFC PATCH 3/5] i386: Use topology functions from topology.h, Moger, Babu, 2019/07/31
- [Qemu-devel] [RFC PATCH 2/5] hw/i386: Add AMD EPYC topology encoding, Moger, Babu, 2019/07/31
- [Qemu-devel] [RFC PATCH 5/5] i386: Fix pkg_id offset EPYC, Moger, Babu, 2019/07/31
- [Qemu-devel] [RFC PATCH 4/5] hw/i386: Generate apicid based on cpu_type, Moger, Babu, 2019/07/31