]> git.proxmox.com Git - mirror_qemu.git/commit
spapr: Add Hcalls to support PAPR NVDIMM device
authorShivaprasad G Bhat <sbhat@linux.ibm.com>
Mon, 10 Feb 2020 04:56:42 +0000 (22:56 -0600)
committerDavid Gibson <david@gibson.dropbear.id.au>
Thu, 20 Feb 2020 22:15:04 +0000 (09:15 +1100)
commitb5fca656f7011ca56fdfa93160c4296db9e3f4d9
tree04e1e3562113f06733680b5d742065aff94d34a8
parentee3a71e36654317b14ede0290e87628f8b79f850
spapr: Add Hcalls to support PAPR NVDIMM device

This patch implements few of the necessary hcalls for the nvdimm support.

PAPR semantics is such that each NVDIMM device is comprising of multiple
SCM(Storage Class Memory) blocks. The guest requests the hypervisor to
bind each of the SCM blocks of the NVDIMM device using hcalls. There can
be SCM block unbind requests in case of driver errors or unplug(not
supported now) use cases. The NVDIMM label read/writes are done through
hcalls.

Since each virtual NVDIMM device is divided into multiple SCM blocks,
the bind, unbind, and queries using hcalls on those blocks can come
independently. This doesn't fit well into the qemu device semantics,
where the map/unmap are done at the (whole)device/object level granularity.
The patch doesnt actually bind/unbind on hcalls but let it happen at the
device_add/del phase itself instead.

The guest kernel makes bind/unbind requests for the virtual NVDIMM device
at the region level granularity. Without interleaving, each virtual NVDIMM
device is presented as a separate guest physical address range. So, there
is no way a partial bind/unbind request can come for the vNVDIMM in a
hcall for a subset of SCM blocks of a virtual NVDIMM. Hence it is safe to
do bind/unbind everything during the device_add/del.

Signed-off-by: Shivaprasad G Bhat <sbhat@linux.ibm.com>
Message-Id: <158131059899.2897.11515211602702956854.stgit@lep8c.aus.stglabs.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr_nvdimm.c
include/hw/ppc/spapr.h