summaryrefslogtreecommitdiffstats
path: root/hw/mem
Commit message (Collapse)AuthorAgeFilesLines
* pc-dimm: Add Error argument to pc_existing_dimms_capacityBharata B Rao2015-01-271-10/+22
| | | | | | | | | | | Now that pc_existing_dimms_capacity() is an API, include Error pointer as an argument and modify the caller appropriately. Suggested-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com>
* pc-dimm: Make pc_existing_dimms_capacity globalBharata B Rao2015-01-271-0/+25
| | | | | | | | | | Move pc_existing_dimms_capacity() to pc-dimm.c since it would be needed by PowerPC memory hotplug code too. Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pc: pc-dimm: use backend alignment during address auto allocationIgor Mammedov2014-11-231-1/+4
| | | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pc: limit DIMM address and size to page aligned valuesIgor Mammedov2014-11-231-1/+13
| | | | | | | | | | | | | | | | | | When running in KVM mode, kvm_set_phys_mem() will silently fail if registered MemoryRegion address/size is not page aligned. Causing memory hotplug failure in guest. Mapping non aligned MemoryRegion in TCG mode 'works', but sane guest OS still expects page aligned memory module and fails to initialize it if it's not aligned. So do not allow non aligned (i.e. valid) address/size values for DIMM to avoid either KVM failure or guest issues caused by it. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pc-dimm: Don't check dimm->node when there is non-NUMA configzhanghailiang2014-09-291-1/+1
| | | | | | | | | | | | | | | | It should not break memory hotplug feature if there is non-NUMA option. This patch would also allow to use pc-dimm as replacement for initial memory for non-NUMA configs. Note: After this patch, the memory hotplug can work normally for Linux guest OS when there is non-NUMA option and NUMA option. But not support Windows guest OS to hotplug memory with no-NUMA config, actully, it's Windows limitation. Reviewed-By: Igor Mammedov <imammedo@redhat.com> Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pc-dimm: fix up error messageMichael S. Tsirkin2014-08-141-2/+3
| | | | | | | | - int should be printed using %d - print actual wrong value for property Cc: qemu-stable@nongnu.org Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pc-dimm: validate node propertyHu Tao2014-08-141-0/+5
| | | | | | | | | | | 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: qemu-stable@nongnu.org Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pc-dimm: error out if memory hotplug is not enabledIgor Mammedov2014-07-061-1/+7
| | | | | | | | | | | | | | | | | | | fixes QEMU abort in case it's started without memory hotplug enabled. as result of fix it will print following messages: " -device pc-dimm,id=d1,memdev=m1: memory hotplug is not enabled, enable it on startup -device pc-dimm,id=d1,memdev=m1: Device 'pc-dimm' could not be initialized " Also fixup assert condition to detect hotplug address space overflow. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reported-by: Hu Tao <hutao@cn.fujitsu.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* qmp: add query-memory-devices commandIgor Mammedov2014-06-191-0/+39
| | | | | | | | | | ... allowing to get state of present memory devices. Currently implemented only for PCDIMMDevice. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pc-dimm: add busy slot check and slot auto-allocationIgor Mammedov2014-06-191-0/+46
| | | | | | | | | | | | | - if slot property is not specified on -device/device_add command, treat default value as request for assigning PCDIMMDevice to the first free slot. - if slot is provided with -device/device_add command, attempt to use it or fail command if it's already occupied. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pc-dimm: add busy address check and address auto-allocationIgor Mammedov2014-06-191-0/+82
| | | | | | | | | | | | | | | | | | | | | | | | - if 'addr' property is not specified on -device/device_add command, treat the default value as request for assigning PCDIMMDevice to the first free memory region. - if 'addr' is provided with -device/device_add command, attempt to use it or fail command if it's already occupied or falls inside of an existing PCDIMMDevice memory region. Note: GCompareFunc(a, b) used by g_slist_insert_sorted() returns 'gint', however it might be too small to fit difference between 2 addresses. So use 128bit to calculate the difference and normalize result to -1/0/1 return values. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Tested-by: Andrey Korolyov <andrey@xdel.ru> MST: commit log tweaks
* pc-dimm: do not allow setting an in-use memdevIgor Mammedov2014-06-191-1/+16
| | | | | | | | | | | | | | using the same memdev backend more than once will cause assertion at MemoryRegion mapping time because it's already mapped. Prevent it by checking that the associated MemoryRegion is not mapped. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Acked-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> MST: tweak commit log
* pc: implement pc-dimm device abstractionVasilis Liaskovitis2014-06-192-0/+100
Each hotplug-able memory slot is a PCDIMMDevice. A hot-add operation for a memory device: - creates a new PCDIMMDevice and makes hotplug controller to map it into guest address space Hotplug operations are done through normal device_add commands. For migration case, all hotplugged memory devices on source should be specified on target's command line using '-device' option with properties set to the same values as on source. To simplify review, patch introduces only PCDIMMDevice QOM skeleton that will be extended by following patches to implement actual memory hotplug and related functions. Signed-off-by: Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com> Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
OpenPOWER on IntegriCloud