[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH RFC 03/16] hw/smbios/smbios: fix number of sockets cal
From: |
Andrew Jones |
Subject: |
[Qemu-ppc] [PATCH RFC 03/16] hw/smbios/smbios: fix number of sockets calculation |
Date: |
Fri, 10 Jun 2016 19:40:14 +0200 |
The specification "sect. 7.5 Processor Information (Type 4)" says
"NOTE One structure is provided for each processor instance in a
system. For example, a system that supports up to two processors
includes two Processor Information structures - even if only one
processor is currently installed..."
We should use max_cpus in the calculation. The rounding is still
necessary, since smp_cores and smp_threads may have been calculated
based on smp_cpus, rather than max_cpus. The rounding is safe,
because smp_parse will fail when the result produces a topology
supporting more cpus than max_cpus.
Signed-off-by: Andrew Jones <address@hidden>
---
hw/smbios/smbios.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c
index cb8a1111029cf..cf18ecfd8599c 100644
--- a/hw/smbios/smbios.c
+++ b/hw/smbios/smbios.c
@@ -881,7 +881,7 @@ void smbios_get_tables(const struct smbios_phys_mem_area
*mem_array,
smbios_build_type_2_table();
smbios_build_type_3_table();
- smbios_smp_sockets = DIV_ROUND_UP(smp_cpus, smp_cores * smp_threads);
+ smbios_smp_sockets = DIV_ROUND_UP(max_cpus, smp_cores * smp_threads);
assert(smbios_smp_sockets >= 1);
for (i = 0; i < smbios_smp_sockets; i++) {
--
2.4.11
[Qemu-ppc] [PATCH RFC 07/16] qom/cpu: make nr-cores, nr-threads real properties, Andrew Jones, 2016/06/10
- Re: [Qemu-ppc] [Qemu-devel] [PATCH RFC 07/16] qom/cpu: make nr-cores, nr-threads real properties, Thomas Huth, 2016/06/11
- Re: [Qemu-ppc] [Qemu-devel] [PATCH RFC 07/16] qom/cpu: make nr-cores, nr-threads real properties, Andrew Jones, 2016/06/12
- Re: [Qemu-ppc] [Qemu-devel] [PATCH RFC 07/16] qom/cpu: make nr-cores, nr-threads real properties, David Gibson, 2016/06/13
- Re: [Qemu-ppc] [Qemu-devel] [PATCH RFC 07/16] qom/cpu: make nr-cores, nr-threads real properties, Andrew Jones, 2016/06/14
- Re: [Qemu-ppc] [Qemu-devel] [PATCH RFC 07/16] qom/cpu: make nr-cores, nr-threads real properties, David Gibson, 2016/06/14
[Qemu-ppc] [PATCH RFC 03/16] hw/smbios/smbios: fix number of sockets calculation,
Andrew Jones <=
[Qemu-ppc] [PATCH RFC 08/16] hw/core/machine: set cpu global nr_cores, nr_threads in pre_init, Andrew Jones, 2016/06/10
[Qemu-ppc] [PATCH RFC 05/16] hw/core/machine: add smp properites, Andrew Jones, 2016/06/10
[Qemu-ppc] [PATCH RFC 09/16] hw/i386/pc: don't use smp_cores, smp_threads, Andrew Jones, 2016/06/10
[Qemu-ppc] [PATCH RFC 11/16] target-ppc: don't use smp_threads, Andrew Jones, 2016/06/10
[Qemu-ppc] [PATCH RFC 10/16] hw/ppc/spapr: don't use smp_cores, smp_threads, Andrew Jones, 2016/06/10