[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 28/88] smbios: Fix assertion on socket count calcula
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 28/88] smbios: Fix assertion on socket count calculation |
Date: |
Thu, 8 Jan 2015 11:33:32 -0600 |
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>
(cherry picked from commit 7dfddd7f884b6dd2abf230d8fa6c7c83aab4f5ec)
Signed-off-by: Michael Roth <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++) {
--
1.9.1
- [Qemu-devel] [PATCH 15/88] qapi: dealloc visitor, implement visit_start_union, (continued)
- [Qemu-devel] [PATCH 15/88] qapi: dealloc visitor, implement visit_start_union, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 16/88] tests: add QMP input visitor test for unions with no discriminator, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 17/88] qemu-iotests: Test missing "driver" key for blockdev-add, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 18/88] monitor: Reset HMP mon->rs in CHR_EVENT_OPEN, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 20/88] vhost-user: fix VIRTIO_NET_F_MRG_RXBUF negotiation, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 22/88] ivshmem: validate incoming_posn value from server, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 24/88] ivshmem: Fix fd leak on error, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 25/88] pc-dimm: Don't check dimm->node when there is non-NUMA config, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 26/88] tests: avoid running duplicate qom-tests, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 33/88] virtio/vhost-scsi: fix virtio-scsi/vhost-scsi child refcount in transports, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 28/88] smbios: Fix assertion on socket count calculation,
Michael Roth <=
- [Qemu-devel] [PATCH 38/88] virtio-balloon: fix virtio-balloon child refcount in transports, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 27/88] snapshot: fix referencing wrong variable in while loop in do_delvm, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 32/88] virtio/vhost-scsi: use aliases instead of duplicate qdev properties, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 34/88] virtio-serial: use aliases instead of duplicate qdev properties, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 31/88] virtio-net: fix virtio-net child refcount in transports, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 36/88] virtio-rng: use aliases instead of duplicate qdev properties, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 35/88] virtio-serial: fix virtio-serial child refcount in transports, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 39/88] virtio-9p: use aliases instead of duplicate qdev properties, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 42/88] vmware-vga: CVE-2014-3689: turn off hw accel, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 30/88] virtio-net: use aliases instead of duplicate qdev properties, Michael Roth, 2015/01/08