qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

docs/nvdimm: add example on persistent backend setup

Persistent backend setup requires some knowledge about nvdimm and ndctl
tool. Some users report they may struggle to gather these knowledge and
have difficulty to setup it properly.

Here we provide two examples for persistent backend and gives the link
to ndctl. By doing so, user could try it directly and do more
investigation on persistent backend setup with ndctl.

Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
Reviewed-by: Pankaj Gupta <pagupta@redhat.com>

Message-Id: <20190801004053.7021-1-richardw.yang@linux.intel.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

authored by

Wei Yang and committed by
Michael S. Tsirkin
d8b92bd4 2501db70

+31
+31
docs/nvdimm.txt
··· 171 171 accept persistent writes. In result, for example, the guest Linux 172 172 NVDIMM driver, marks such vNVDIMM device as read-only. 173 173 174 + Backend File Setup Example 175 + -------------------------- 176 + 177 + Here are two examples showing how to setup these persistent backends on 178 + linux using the tool ndctl [3]. 179 + 180 + A. DAX device 181 + 182 + Use the following command to set up /dev/dax0.0 so that the entirety of 183 + namespace0.0 can be exposed as an emulated NVDIMM to the guest: 184 + 185 + ndctl create-namespace -f -e namespace0.0 -m devdax 186 + 187 + The /dev/dax0.0 could be used directly in "mem-path" option. 188 + 189 + B. DAX file 190 + 191 + Individual files on a DAX host file system can be exposed as emulated 192 + NVDIMMS. First an fsdax block device is created, partitioned, and then 193 + mounted with the "dax" mount option: 194 + 195 + ndctl create-namespace -f -e namespace0.0 -m fsdax 196 + (partition /dev/pmem0 with name pmem0p1) 197 + mount -o dax /dev/pmem0p1 /mnt 198 + (create or copy a disk image file with qemu-img(1), cp(1), or dd(1) 199 + in /mnt) 200 + 201 + Then the new file in /mnt could be used in "mem-path" option. 202 + 174 203 NVDIMM Persistence 175 204 ------------------ 176 205 ··· 212 241 https://www.snia.org/sites/default/files/technical_work/final/NVMProgrammingModel_v1.2.pdf 213 242 [2] Persistent Memory Development Kit (PMDK), formerly known as NVML project, home page: 214 243 http://pmem.io/pmdk/ 244 + [3] ndctl-create-namespace - provision or reconfigure a namespace 245 + http://pmem.io/ndctl/ndctl-create-namespace.html