[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 01/15] pc-dimm: get memory region from ->get_memory_
From: |
Xiao Guangrong |
Subject: |
[Qemu-devel] [PATCH 01/15] pc-dimm: get memory region from ->get_memory_region() |
Date: |
Thu, 17 Mar 2016 16:32:47 +0800 |
Curretly, the memory region of backed memory is all directly
mapped to guest's address space, however, it will be not true
for nvdimm device if we introduce nvdimm label which only can
be indirectly accessed by ACPI DSM method
Also it improves the comments a bit to reflect this fact
Signed-off-by: Xiao Guangrong <address@hidden>
---
hw/mem/pc-dimm.c | 3 ++-
include/hw/mem/pc-dimm.h | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c
index 973bf20..0ba17f0 100644
--- a/hw/mem/pc-dimm.c
+++ b/hw/mem/pc-dimm.c
@@ -353,8 +353,9 @@ static void pc_dimm_get_size(Object *obj, Visitor *v, const
char *name,
int64_t value;
MemoryRegion *mr;
PCDIMMDevice *dimm = PC_DIMM(obj);
+ PCDIMMDeviceClass *ddc = PC_DIMM_GET_CLASS(obj);
- mr = host_memory_backend_get_memory(dimm->hostmem, errp);
+ mr = ddc->get_memory_region(dimm);
value = memory_region_size(mr);
visit_type_int(v, name, &value, errp);
diff --git a/include/hw/mem/pc-dimm.h b/include/hw/mem/pc-dimm.h
index 218dfb0..827f1bc 100644
--- a/include/hw/mem/pc-dimm.h
+++ b/include/hw/mem/pc-dimm.h
@@ -60,7 +60,8 @@ typedef struct PCDIMMDevice {
/**
* PCDIMMDeviceClass:
- * @get_memory_region: returns #MemoryRegion associated with @dimm
+ * @get_memory_region: returns #MemoryRegion associated with @dimm which
+ * is directly mapped into the physical address space of guest
*/
typedef struct PCDIMMDeviceClass {
/* private */
--
1.8.3.1
- [Qemu-devel] [PATCH 00/15] NVDIMM: introduce nvdimm label support, Xiao Guangrong, 2016/03/17
- [Qemu-devel] [PATCH 01/15] pc-dimm: get memory region from ->get_memory_region(),
Xiao Guangrong <=
- [Qemu-devel] [PATCH 02/15] pc-dimm: introduce realize callback, Xiao Guangrong, 2016/03/17
- [Qemu-devel] [PATCH 05/15] acpi: add aml_object_type, Xiao Guangrong, 2016/03/17
- [Qemu-devel] [PATCH 03/15] pc-dimm: keep the state of the whole backend memory, Xiao Guangrong, 2016/03/17
- [Qemu-devel] [PATCH 04/15] nvdimm: support nvdimm label, Xiao Guangrong, 2016/03/17
- [Qemu-devel] [PATCH 06/15] acpi: add aml_call5, Xiao Guangrong, 2016/03/17
- [Qemu-devel] [PATCH 07/15] nvdimm acpi: set HDLE properly, Xiao Guangrong, 2016/03/17
- [Qemu-devel] [PATCH 08/15] nvdimm acpi: save arg3 of _DSM method, Xiao Guangrong, 2016/03/17
- [Qemu-devel] [PATCH 10/15] nvdimm acpi: abstract the operations for root device and nvdimm devices, Xiao Guangrong, 2016/03/17