All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] vdpa: mandate 1.0 device
@ 2021-04-08  8:26 ` Jason Wang
  0 siblings, 0 replies; 29+ messages in thread
From: Jason Wang @ 2021-04-08  8:26 UTC (permalink / raw)
  To: mst, jasowang, virtualization, linux-kernel; +Cc: parav, elic

This patch mandates 1.0 for vDPA devices. The goal is to have the
semantic of normative statement in the virtio spec and eliminate the
burden of transitional device for both vDPA bus and vDPA parent.

uAPI seems fine since all the vDPA parent mandates
VIRTIO_F_ACCESS_PLATFORM which implies 1.0 devices.

For legacy guests, it can still work since Qemu will mediate when
necessary (e.g doing the endian conversion).

Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 include/linux/vdpa.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
index 0fefeb976877..cfde4ec999b4 100644
--- a/include/linux/vdpa.h
+++ b/include/linux/vdpa.h
@@ -6,6 +6,7 @@
 #include <linux/device.h>
 #include <linux/interrupt.h>
 #include <linux/vhost_iotlb.h>
+#include <uapi/linux/virtio_config.h>
 
 /**
  * vDPA callback definition.
@@ -317,6 +318,11 @@ static inline int vdpa_set_features(struct vdpa_device *vdev, u64 features)
 {
         const struct vdpa_config_ops *ops = vdev->config;
 
+        /* Mandating 1.0 to have semantics of normative statements in
+         * the spec. */
+        if (!(features & BIT_ULL(VIRTIO_F_VERSION_1)))
+		return -EINVAL;
+
 	vdev->features_valid = true;
         return ops->set_features(vdev, features);
 }
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2021-06-03  7:15 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-08  8:26 [RFC PATCH] vdpa: mandate 1.0 device Jason Wang
2021-04-08  8:26 ` Jason Wang
2021-04-08 15:59 ` Michael S. Tsirkin
2021-04-08 15:59   ` Michael S. Tsirkin
2021-04-09  4:47   ` Jason Wang
2021-04-09  4:47     ` Jason Wang
2021-04-09 16:04     ` Michael S. Tsirkin
2021-04-09 16:04       ` Michael S. Tsirkin
2021-04-12  6:35       ` Jason Wang
2021-04-12  6:35         ` Jason Wang
2021-04-12  9:09         ` Michael S. Tsirkin
2021-04-12  9:09           ` Michael S. Tsirkin
2021-04-12  9:23           ` Jason Wang
2021-04-12  9:23             ` Jason Wang
2021-04-21  7:41             ` Jason Wang
2021-04-21  7:41               ` Jason Wang
2021-04-21  8:03               ` Michael S. Tsirkin
2021-04-21  8:03                 ` Michael S. Tsirkin
2021-04-21  8:17                 ` Jason Wang
2021-04-21  8:17                   ` Jason Wang
2021-05-11  8:43                   ` Jason Wang
2021-05-11  8:43                     ` Jason Wang
2021-05-12  7:53                     ` Michael S. Tsirkin
2021-05-12  7:53                       ` Michael S. Tsirkin
2021-05-12  9:24                       ` Jason Wang
2021-05-12  9:24                         ` Jason Wang
2021-06-02 10:30                         ` Eli Cohen
2021-06-03  7:14                           ` Jason Wang
2021-06-03  7:14                             ` Jason Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.