spapr: Add NVDIMM device support
commitee3a71e36654317b14ede0290e87628f8b79f850
authorShivaprasad G Bhat <sbhat@linux.ibm.com>
Mon, 10 Feb 2020 04:56:31 +0000 (9 22:56 -0600)
committerDavid Gibson <david@gibson.dropbear.id.au>
Thu, 20 Feb 2020 22:15:04 +0000 (21 09:15 +1100)
treec42f6057545d006d23cae4b25aa66c9f16eb6a4c
parent6c5627bb24dcd68c997857a8b671617333b1289f
spapr: Add NVDIMM device support

Add support for NVDIMM devices for sPAPR. Piggyback on existing nvdimm
device interface in QEMU to support virtual NVDIMM devices for Power.
Create the required DT entries for the device (some entries have
dummy values right now).

The patch creates the required DT node and sends a hotplug
interrupt to the guest. Guest is expected to undertake the normal
DR resource add path in response and start issuing PAPR SCM hcalls.

The device support is verified based on the machine version unlike x86.

This is how it can be used ..
Ex :
For coldplug, the device to be added in qemu command line as shown below
-object memory-backend-file,id=memnvdimm0,prealloc=yes,mem-path=/tmp/nvdimm0,share=yes,size=1073872896
-device nvdimm,label-size=128k,uuid=75a3cdd7-6a2f-4791-8d15-fe0a920e8e9e,memdev=memnvdimm0,id=nvdimm0,slot=0

For hotplug, the device to be added from monitor as below
object_add memory-backend-file,id=memnvdimm0,prealloc=yes,mem-path=/tmp/nvdimm0,share=yes,size=1073872896
device_add nvdimm,label-size=128k,uuid=75a3cdd7-6a2f-4791-8d15-fe0a920e8e9e,memdev=memnvdimm0,id=nvdimm0,slot=0

Signed-off-by: Shivaprasad G Bhat <sbhat@linux.ibm.com>
Signed-off-by: Bharata B Rao <bharata@linux.ibm.com>
               [Early implementation]
Message-Id: <158131058078.2897.12767731856697459923.stgit@lep8c.aus.stglabs.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
default-configs/ppc64-softmmu.mak
hw/mem/Kconfig
hw/ppc/Makefile.objs
hw/ppc/spapr.c
hw/ppc/spapr_drc.c
hw/ppc/spapr_events.c
hw/ppc/spapr_nvdimm.c [new file with mode: 0644]
include/hw/ppc/spapr_drc.h
include/hw/ppc/spapr_nvdimm.h [new file with mode: 0644]