Commit 3c3e88a8 authored by Xiao Guangrong's avatar Xiao Guangrong Committed by Michael S. Tsirkin
Browse files

pc-dimm: get memory region from ->get_memory_region()



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: default avatarXiao Guangrong <guangrong.xiao@linux.intel.com>
Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
parent 28213cb6
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -354,8 +354,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);
+2 −1
Original line number Diff line number Diff line
@@ -58,7 +58,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 */