summaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/virtio_pmem.h
diff options
context:
space:
mode:
authorPankaj Gupta <pagupta@redhat.com>2019-07-05 19:33:23 +0530
committerDan Williams <dan.j.williams@intel.com>2019-07-05 15:19:10 -0700
commit6e84200c0a2994b991259d19450eee561029bf70 (patch)
tree66e3cd2cb9bf896803e6012148731cb4ddeaf36f /include/uapi/linux/virtio_pmem.h
parentc5d4355d10d414a96ca870b731756b89d068d57a (diff)
downloadblackbird-op-linux-6e84200c0a2994b991259d19450eee561029bf70.tar.gz
blackbird-op-linux-6e84200c0a2994b991259d19450eee561029bf70.zip
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 <pagupta@redhat.com> Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Jakub Staron <jstaron@google.com> Tested-by: Jakub Staron <jstaron@google.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'include/uapi/linux/virtio_pmem.h')
-rw-r--r--include/uapi/linux/virtio_pmem.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/include/uapi/linux/virtio_pmem.h b/include/uapi/linux/virtio_pmem.h
new file mode 100644
index 000000000000..efcd72f2d20d
--- /dev/null
+++ b/include/uapi/linux/virtio_pmem.h
@@ -0,0 +1,34 @@
+/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
+/*
+ * Definitions for virtio-pmem devices.
+ *
+ * Copyright (C) 2019 Red Hat, Inc.
+ *
+ * Author(s): Pankaj Gupta <pagupta@redhat.com>
+ */
+
+#ifndef _UAPI_LINUX_VIRTIO_PMEM_H
+#define _UAPI_LINUX_VIRTIO_PMEM_H
+
+#include <linux/types.h>
+#include <linux/virtio_ids.h>
+#include <linux/virtio_config.h>
+
+struct virtio_pmem_config {
+ __u64 start;
+ __u64 size;
+};
+
+#define VIRTIO_PMEM_REQ_TYPE_FLUSH 0
+
+struct virtio_pmem_resp {
+ /* Host return status corresponding to flush request */
+ __u32 ret;
+};
+
+struct virtio_pmem_req {
+ /* command type */
+ __u32 type;
+};
+
+#endif
OpenPOWER on IntegriCloud