]> git.proxmox.com Git - mirror_qemu.git/commitdiff
machine: Add SMP Sockets in CpuTopology
authorBabu Moger <babu.moger@amd.com>
Wed, 11 Mar 2020 22:53:06 +0000 (17:53 -0500)
committerEduardo Habkost <ehabkost@redhat.com>
Tue, 17 Mar 2020 23:48:10 +0000 (19:48 -0400)
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 <babu.moger@amd.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <158396718647.58170.2278448323151215741.stgit@naples-babu.amd.com>

hw/core/machine.c
hw/i386/pc.c
include/hw/boards.h
softmmu/vl.c

index 4778bc6b08a810cf25eefa63520af97a3226957e..b958cd1b991b5ee67b0fb64d5338d15a00676482 100644 (file)
@@ -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) {
index 662abb549dea867e3abf01cfe3e2c38cfb459d2a..05e7f1090f8d37f68744b235d9dbc23a46f1bbcb 100644 (file)
@@ -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;
     }
 
index c96120d15f6f01c41e0147e910c45b10911204f9..236d239c19e82fe52f8c74de492e794bde18b530 100644 (file)
@@ -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;
 
index 6a285925b37337437e406ee9523f9802834dde74..1d33a2834037e5b0329105a2e7f08c4ac8594a05 100644 (file)
@@ -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));