[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 10/13] machine: Add SMP Sockets in CpuTopology
From: |
Eduardo Habkost |
Subject: |
[PULL 10/13] machine: Add SMP Sockets in CpuTopology |
Date: |
Tue, 17 Mar 2020 21:17:45 -0400 |
From: Babu Moger <address@hidden>
Store the smp sockets in CpuTopology. The socket information required to
build the apic id in EPYC mode. Right now socket information is not passed
to down when decoding the apic id. Add the socket information here.
Signed-off-by: Babu Moger <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Reviewed-by: Igor Mammedov <address@hidden>
Acked-by: Michael S. Tsirkin <address@hidden>
Message-Id: <address@hidden>
---
hw/core/machine.c | 1 +
hw/i386/pc.c | 1 +
include/hw/boards.h | 2 ++
softmmu/vl.c | 1 +
4 files changed, 5 insertions(+)
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 4778bc6b08..b958cd1b99 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -757,6 +757,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 662abb549d..05e7f1090f 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -781,6 +781,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;
x86ms->smp_dies = dies;
}
diff --git a/include/hw/boards.h b/include/hw/boards.h
index c96120d15f..236d239c19 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -236,12 +236,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/softmmu/vl.c b/softmmu/vl.c
index 6a285925b3..1d33a28340 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -3946,6 +3946,7 @@ void qemu_init(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.24.1
- [PULL 03/13] i386: Add missing cpu feature bits in EPYC model, (continued)
- [PULL 03/13] i386: Add missing cpu feature bits in EPYC model, Eduardo Habkost, 2020/03/17
- [PULL 06/13] machine/memory encryption: Disable mem merge, Eduardo Habkost, 2020/03/17
- [PULL 05/13] hw/i386: Rename X86CPUTopoInfo structure to X86CPUTopoIDs, Eduardo Habkost, 2020/03/17
- [PULL 08/13] hw/i386: Introduce X86CPUTopoInfo to contain topology info, Eduardo Habkost, 2020/03/17
- [PULL 09/13] hw/i386: Consolidate topology functions, Eduardo Habkost, 2020/03/17
- [PULL 04/13] i386: Add 2nd Generation AMD EPYC processors, Eduardo Habkost, 2020/03/17
- [PULL 11/13] hw/i386: Remove unnecessary initialization in x86_cpu_new, Eduardo Habkost, 2020/03/17
- [PULL 07/13] cpu: Use DeviceClass reset instead of a special CPUClass reset, Eduardo Habkost, 2020/03/17
- [PULL 12/13] hw/i386: Update structures to save the number of nodes per package, Eduardo Habkost, 2020/03/17
- [PULL 10/13] machine: Add SMP Sockets in CpuTopology,
Eduardo Habkost <=
- [PULL 13/13] hw/i386: Rename apicid_from_topo_ids to x86_apicid_from_topo_ids, Eduardo Habkost, 2020/03/17
- Re: [PULL 00/13] x86 and machine queue for 5.0 soft freeze, Peter Maydell, 2020/03/19