virtio-pmem: Add virtio pmem driver

This patch adds virtio-pmem driver for KVM guest.

Guest reads the persistent memory range information from
Qemu over VIRTIO and registers it on nvdimm_bus. It also
creates a nd_region object with the persistent memory
range information so that existing 'nvdimm/pmem' driver
can reserve this into system memory map. This way
'virtio-pmem' driver uses existing functionality of pmem
driver to register persistent memory compatible for DAX
capable filesystems.

This also provides function to perform guest flush over
VIRTIO from 'pmem' driver when userspace performs flush
on DAX memory range.

Signed-off-by: Pankaj Gupta <[email protected]>
Reviewed-by: Yuval Shaia <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Acked-by: Jakub Staron <[email protected]>
Tested-by: Jakub Staron <[email protected]>
Reviewed-by: Cornelia Huck <[email protected]>
Signed-off-by: Dan Williams <[email protected]>
This commit is contained in:
Pankaj Gupta 2019-07-05 19:33:23 +05:30 • committed by Dan Williams
commit 6e84200c0a
7 changed files with 349 additions and 0 deletions

View file

@ -43,6 +43,17 @@ config VIRTIO_PCI_LEGACY
If unsure, say Y.
config VIRTIO_PMEM
tristate "Support for virtio pmem driver"
depends on VIRTIO
depends on LIBNVDIMM
help
This driver provides access to virtio-pmem devices, storage devices
that are mapped into the physical address space - similar to NVDIMMs
- with a virtio-based flushing interface.
If unsure, say Y.
config VIRTIO_BALLOON
tristate "Virtio balloon driver"
depends on VIRTIO