On Wed, Apr 21, 2021 at 03:41:36PM +0800, Jason Wang wrote:
在 2021/4/12 下午5:23, Jason Wang 写道:I think we need a way to support legacy with no data path overhead. qemu
在 2021/4/12 下午5:09, Michael S. Tsirkin 写道:
On Mon, Apr 12, 2021 at 02:35:07PM +0800, Jason Wang wrote:
在 2021/4/10 上午12:04, Michael S. Tsirkin 写道:My point is this patch does not drop legacy support. It merely mandates
On Fri, Apr 09, 2021 at 12:47:55PM +0800, Jason Wang wrote:Right.
在 2021/4/8 下午11:59, Michael S. Tsirkin 写道:My point is this neither fixes or prevents this.
On Thu, Apr 08, 2021 at 04:26:48PM +0800, Jason Wang wrote:Yes, but it's not something that is introduced in this
This patch mandates 1.0 for vDPA devices. The goal is to have theHmm. If we do this, don't we still have a problem with
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@xxxxxxxxxx>
legacy drivers which don't ack 1.0?
commit. The legacy
driver never work ...
So my suggestion is to finally add ioctls along the lines
of PROTOCOL_FEATURES of vhost-user.
Then that one can have bits for legacy le, legacy be and modern.
BTW I looked at vhost-user and it does not look like that
has a solution for this problem either, right?
So the problem still. This can only work when the hardware can supportI frankly think we'll need PROTOCOL_FEATURES anyway, it'sNote 1.0 affects ring endianness which is not mediated in QEMURight, I plan to send patches to do mediation in the
so QEMU can't pretend to device guest is 1.0.
Qemu to unbreak legacy
too useful ...
so why not teach drivers about it and be done with it? You
legacy on modern in a cross endian situation because of vring
legacy vring endian-ness.
1) the leagcy driver support is non-normative in the spec
2) support a transitional device in the kenrel may requires the
support and a burden of kernel codes
I'd rather simply drop the legacy driver support
I am not sure I get here. This patch fails the set_feature if VERSION_1
is not negotiated. This means:
1) vDPA presents a modern device instead of transitonal device
2) legacy driver can't be probed
What I'm missing?
Do you agree to find the way to present modern device? We need a conclusion
to make the netlink API work to move forward.
setting VERSION_1 for a legacy guest affects the ring format so it does
not really work. This seems to rule out emulating config space entirely
So I think we should add an ioctl along the lines of
protocol features. Then I think we can reserve feature bits
for config space format: legacy LE, legacy BE, modern.
Querying the feature bits will provide us with info about
what does the device support. Acking them will tell device
what does guest need.
to have a simple and easyI'd like to avoid shadow virtqueue hacks if at all possible.
abstarction in the kenrel. For legacy driver in the guest,
hypervisor is in
charge of the mediation:
1) config space access endian conversion
2) using shadow virtqueue to change the endian in the vring
Last I checked performance wasn't much better than just emulating
virtio in software.
I think the legacy driver support is just a nice to have. Or do you see
any value to that? I guess for mellanox and intel, only modern device is
supported in the hardware.
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
@@ -6,6 +6,7 @@
* vDPA callback definition.
@@ -317,6 +318,11 @@ static inline int
vdpa_set_features(struct vdpa_device *vdev, u64
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);