[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 01/29] smbios: Fix assertion on socket count calculat
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 01/29] smbios: Fix assertion on socket count calculation |
Date: |
Mon, 3 Nov 2014 14:44:42 +0200 |
From: Eduardo Habkost <address@hidden>
QEMU currently allows the number of VCPUs to not be a multiple of the
number of threads per socket, but the smbios socket count calculation
introduced by commit c97294ec1b9e36887e119589d456557d72ab37b5 doesn't
take that into account, triggering an assertion. e.g.:
$ ./x86_64-softmmu/qemu-system-x86_64 -smp 4,sockets=2,cores=6,threads=1
qemu-system-x86_64: /home/ehabkost/rh/proj/virt/qemu/hw/i386/smbios.c:825:
smbios_get_tables: Assertion `smbios_smp_sockets >= 1' failed.
Aborted (core dumped)
Socket count calculation doesn't belong to smbios.c and should
eventually be moved to the main SMP topology configuration code. But
while we don't move the code, at least make it correct by rounding up
the division.
Cc: Gabriel Somlo <address@hidden>
Cc: address@hidden
Signed-off-by: Eduardo Habkost <address@hidden>
Reviewed-By: Igor Mammedov <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/i386/smbios.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/i386/smbios.c b/hw/i386/smbios.c
index e3fa1b2..0ae5960 100644
--- a/hw/i386/smbios.c
+++ b/hw/i386/smbios.c
@@ -821,7 +821,7 @@ void smbios_get_tables(uint8_t **tables, size_t *tables_len,
smbios_build_type_2_table();
smbios_build_type_3_table();
- smbios_smp_sockets = smp_cpus / (smp_cores * smp_threads);
+ smbios_smp_sockets = DIV_ROUND_UP(smp_cpus, smp_cores * smp_threads);
assert(smbios_smp_sockets >= 1);
for (i = 0; i < smbios_smp_sockets; i++) {
--
MST
- [Qemu-devel] [PULL 00/29] pc, virtio, misc bugfixes, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 01/29] smbios: Fix assertion on socket count calculation,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 02/29] well-defined listing order for machine types, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 03/29] i386/pc: add piix and q35 machtypes to sorting families for -M \?, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 04/29] pc: Fix disabling of vapic for compat PC models, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 05/29] i386: Add an ACPI_EXTRACT_NAME_BUFFER16 directive., Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 06/29] pcie: change confused comment clearer, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 08/29] intel_iommu: fix VTD_SID_TO_BUS, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 07/29] virtio-pci: fix migration for pci bus master, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 09/29] tests: fix rebuild-expected-aml.sh for acpi-test rename, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 10/29] acpi: create separate file for TCPA log, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 12/29] acpi:ich9: convert cpu hotplug to hotplug_handler API, Michael S. Tsirkin, 2014/11/03