vdpa/vdpa_sim: Use the negotiated features when calling vringh_init_iotlb
PATCH 1/1 vdpa/vdpa_sim: Use the negotiated features when calling vringh_init_iotlb
When calling vringh_init_iotlb(), use the negotiated features which might be different than the supported features.
--- drivers/vdpa/vdpa_sim/vdpa_sim.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/vdpa/vdpa_sim/vdpa_sim.c +2 -2
@@ -66,7 +66,7 @@ static void vdpasim_queue_ready(struct vdpasim *vdpasim, unsigned int idx) {struct vdpasim_virtqueue *vq = &vdpasim->vqs[idx]; - vringh_init_iotlb(&vq->vring, vdpasim->dev_attr.supported_features, + vringh_init_iotlb(&vq->vring, vdpasim->features, VDPASIM_QUEUE_MAX, false, (struct vring_desc *)(uintptr_t)vq->desc_addr, (struct vring_avail *)
@@ -86,7 +86,7 @@ static void vdpasim_vq_reset(struct vdpasim *vdpasim, vq->device_addr =0 ; vq->cb =NULL ; vq->private =NULL ; -vringh_init_iotlb (&vq->vring, vdpasim->dev_attr.supported_features, +vringh_init_iotlb (&vq->vring, vdpasim->features,VDPASIM_QUEUE_MAX , false,NULL ,NULL ,NULL ); vq->vring.notify =NULL ;
Signature · 1 line
2.30.1
Quoted 4 lines · Eli Cohen
When calling
vringh_init_iotlb(), use the negotiated features which might be different than the supported features.Fixes 011c35bac5ef ("vdpa_sim: add supported_features field in vdpasim_dev_attr)
As Stefano said.
It should be 2c53d0f64c06f ("vdpasim: vDPA device simulator")
Other than this
Quoted 19 lines
Signed-off-by Eli Cohen <[email protected]>--- drivers/vdpa/vdpa_sim/vdpa_sim.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/vdpa/vdpa_sim/vdpa_sim.c +1
-1@@ -66,7 +66,7 @@ static void vdpasim_queue_ready(struct vdpasim *vdpasim, unsigned int idx) {struct vdpasim_virtqueue *vq = &vdpasim->vqs[idx]; - vringh_init_iotlb(&vq->vring, vdpasim->dev_attr.supported_features, + vringh_init_iotlb(&vq->vring, vdpasim->features, VDPASIM_QUEUE_MAX, false, (struct vring_desc *)(uintptr_t)vq->desc_addr, (struct vring_avail *)
drivers/vdpa/vdpa_sim/vdpa_sim.c static void vdpasim_vq_reset(struct vdpasim *vdpasim, · line 92
Quoted 8 lines
drivers/vdpa/vdpa_sim/vdpa_sim.c +1
-1@@ -86,7 +86,7 @@ static void vdpasim_vq_reset(struct vdpasim *vdpasim, vq->device_addr =0 ; vq->cb =NULL ; vq->private =NULL ; -vringh_init_iotlb (&vq->vring, vdpasim->dev_attr.supported_features, +vringh_init_iotlb (&vq->vring, vdpasim->features,VDPASIM_QUEUE_MAX , false,NULL ,NULL ,NULL ); vq->vring.notify =NULL ;
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Quoted 11 lines · Jason Wang
Quoted 4 lines · Eli Cohen
When calling
vringh_init_iotlb(), use the negotiated features which might be different than the supported features.Fixes 011c35bac5ef ("vdpa_sim: add supported_features field in vdpasim_dev_attr)As Stefano said.
It should be
2c53d0f64c06f("vdpasim: vDPA device simulator")
Makes sense. Though I haven't got Stefano's message. I will post another one.
Quoted 32 lines
Other than this
Acked-by Jason Wang <[email protected]>Quoted 25 lines
Signed-off-by Eli Cohen <[email protected]>--- drivers/vdpa/vdpa_sim/vdpa_sim.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/vdpa/vdpa_sim/vdpa_sim.c +2
-2@@ -66,7 +66,7 @@ static void vdpasim_queue_ready(struct vdpasim *vdpasim, unsigned int idx) {struct vdpasim_virtqueue *vq = &vdpasim->vqs[idx]; - vringh_init_iotlb(&vq->vring, vdpasim->dev_attr.supported_features, + vringh_init_iotlb(&vq->vring, vdpasim->features, VDPASIM_QUEUE_MAX, false, (struct vring_desc *)(uintptr_t)vq->desc_addr, (struct vring_avail *)@@ -86,7 +86,7 @@ static void vdpasim_vq_reset(struct vdpasim *vdpasim, vq->device_addr =0 ; vq->cb =NULL ; vq->private =NULL ; -vringh_init_iotlb (&vq->vring, vdpasim->dev_attr.supported_features, +vringh_init_iotlb (&vq->vring, vdpasim->features,VDPASIM_QUEUE_MAX , false,NULL ,NULL ,NULL ); vq->vring.notify =NULL ;