[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 76/79] cpu: don't allow negative core id
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 76/79] cpu: don't allow negative core id |
Date: |
Mon, 28 Aug 2017 19:14:51 -0500 |
From: Laurent Vivier <address@hidden>
With pseries machine type a negative core-id is not managed properly:
-1 gives an inaccurate error message ("core -1 already populated"),
-2 crashes QEMU (core dump)
As it seems a negative value is invalid for any architecture,
instead of checking this in spapr_core_pre_plug() I think it's better
to check this in the generic part, core_prop_set_core_id()
Signed-off-by: Laurent Vivier <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Greg Kurz <address@hidden>
Reviewed-by: David Gibson <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>
(cherry picked from commit be2960baae07e5257cde8c814cbd91647e235147)
Signed-off-by: Michael Roth <address@hidden>
---
hw/cpu/core.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hw/cpu/core.c b/hw/cpu/core.c
index 2bf960d..bd578ab 100644
--- a/hw/cpu/core.c
+++ b/hw/cpu/core.c
@@ -33,6 +33,11 @@ static void core_prop_set_core_id(Object *obj, Visitor *v,
const char *name,
return;
}
+ if (value < 0) {
+ error_setg(errp, "Invalid core id %"PRId64, value);
+ return;
+ }
+
core->core_id = value;
}
--
2.7.4
- [Qemu-devel] [PATCH 71/79] virtio-net: fix offload ctrl endian, (continued)
- [Qemu-devel] [PATCH 71/79] virtio-net: fix offload ctrl endian, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 06/79] block: An empty filename counts as no filename, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 72/79] input: limit kbd queue depth, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 74/79] qemu-iotests: Test automatic commit job cancel on hot unplug, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 05/79] qemu-img/convert: Move bs_n > 1 && -B check down, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 64/79] block: Do not strcmp() with NULL uri->scheme, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 69/79] commit: Add NULL check for overlay_bs, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 68/79] virtio-scsi: finalize IOMMU support, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 73/79] input: Decrement queue count on kbd delay, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 75/79] block: Skip implicit nodes in query-block/blockstats, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 76/79] cpu: don't allow negative core id,
Michael Roth <=
- [Qemu-devel] [PATCH 78/79] block/nfs: fix mutex assertion in nfs_file_close(), Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 07/79] iotests/051: Add test for empty filename, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 70/79] spapr: fix memory leak in spapr_core_pre_plug(), Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 79/79] 9pfs: local: fix fchmodat_nofollow() limitations, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 08/79] migration: setup bi-directional I/O channel for exec: protocol, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 77/79] hw/i386: allow SHPC for Q35 machine, Michael Roth, 2017/08/28
- Re: [Qemu-devel] [PATCH 00/79] Patch Round-up for stable 2.9.1, freeze on 2017-09-04, Michael Roth, 2017/08/28
- Re: [Qemu-devel] [PATCH 00/79] Patch Round-up for stable 2.9.1, freeze on 2017-09-04, Thomas Huth, 2017/08/28