[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 08/25] pc-dimm: validate node property
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 08/25] pc-dimm: validate node property |
Date: |
Wed, 27 Aug 2014 12:36:05 -0500 |
From: Hu Tao <address@hidden>
If user specifies a node number that exceeds the available numa nodes in
emulated system for pc-dimm device, the device will report an invalid _PXM
to OSPM. Fix this by checking the node property value.
Cc: address@hidden
Signed-off-by: Hu Tao <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
(cherry picked from commit cfe0ffd0272f1a6d34d27ac1a7072d1c42d33ad3)
Signed-off-by: Michael Roth <address@hidden>
---
hw/mem/pc-dimm.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c
index 08f49ed..92e276f 100644
--- a/hw/mem/pc-dimm.c
+++ b/hw/mem/pc-dimm.c
@@ -252,6 +252,11 @@ static void pc_dimm_realize(DeviceState *dev, Error **errp)
error_setg(errp, "'" PC_DIMM_MEMDEV_PROP "' property is not set");
return;
}
+ if (dimm->node >= nb_numa_nodes) {
+ error_setg(errp, "'" PC_DIMM_NODE_PROP
+ "' exceeds numa node number: %" PRId32, nb_numa_nodes);
+ return;
+ }
}
static MemoryRegion *pc_dimm_get_memory_region(PCDIMMDevice *dimm)
--
1.9.1
- [Qemu-stable] [PATCH 06/25] pci: Use bus master address space for delivering MSI/MSI-X messages, (continued)
- [Qemu-stable] [PATCH 06/25] pci: Use bus master address space for delivering MSI/MSI-X messages, Michael Roth, 2014/08/27
- [Qemu-stable] [PATCH 03/25] vfio: Fix MSI-X vector expansion, Michael Roth, 2014/08/27
- [Qemu-stable] [PATCH 07/25] hw:i386: typo fix: MEMORY_HOPTLUG_DEVICE -> MEMORY_HOTPLUG_DEVICE, Michael Roth, 2014/08/27
- [Qemu-stable] [PATCH 02/25] qdev-monitor: include QOM properties in -device FOO, help output, Michael Roth, 2014/08/27
- [Qemu-stable] [PATCH 10/25] numa: show hex number in error message for consistency and prefix them with 0x, Michael Roth, 2014/08/27
- [Qemu-stable] [PATCH 04/25] l2tpv3 (configure): it is linux-specific, Michael Roth, 2014/08/27
- [Qemu-stable] [PATCH 05/25] ide: only constrain read/write requests to drive size, not other types, Michael Roth, 2014/08/27
- [Qemu-stable] [PATCH 09/25] pc-dimm: fix up error message, Michael Roth, 2014/08/27
- [Qemu-stable] [PATCH 08/25] pc-dimm: validate node property,
Michael Roth <=
- [Qemu-stable] [PATCH 13/25] target-arm: Fix return address for A64 BRK instructions, Michael Roth, 2014/08/27
- [Qemu-stable] [PATCH 11/25] acpi: align RSDP, Michael Roth, 2014/08/27
- [Qemu-stable] [PATCH 12/25] virtio-blk: fix reference a pointer which might be freed, Michael Roth, 2014/08/27
- [Qemu-stable] [PATCH 01/25] qmp: hide "hotplugged" device property from device-list-properties, Michael Roth, 2014/08/27
- [Qemu-stable] [PATCH 15/25] arm/virt: Use PSCI v0.2 function IDs in the DT when KVM uses PSCI v0.2, Michael Roth, 2014/08/27
- [Qemu-stable] [PATCH 17/25] raw-posix: fix O_DIRECT short reads, Michael Roth, 2014/08/27
- [Qemu-stable] [PATCH 16/25] block/iscsi: fix memory corruption on iscsi resize, Michael Roth, 2014/08/27
- [Qemu-stable] [PATCH 19/25] blkdebug: Delete BH in bdrv_aio_cancel, Michael Roth, 2014/08/27
- [Qemu-stable] [PATCH 18/25] qemu-iotests: add test case 101 for short file I/O, Michael Roth, 2014/08/27
- [Qemu-stable] [PATCH 21/25] hostmem: set MPOL_MF_MOVE, Michael Roth, 2014/08/27