lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210720065740.56udn3ndebzvu26o@steredhat>
Date:   Tue, 20 Jul 2021 08:57:40 +0200
From:   Stefano Garzarella <sgarzare@...hat.com>
To:     Eli Cohen <elic@...dia.com>
Cc:     mst@...hat.com, jasowang@...hat.com,
        virtualization@...ts.linux-foundation.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] vdpa/vdpa_sim: Use the negotiated features when
 calling vringh_init_iotlb

On Tue, Jul 20, 2021 at 08:25:33AM +0300, Eli Cohen wrote:
>When calling vringh_init_iotlb(), use the negotiated features which
>might be different than the supported features.
>
>Fixes: 2c53d0f64c06f ("vdpasim: vDPA device simulator")
>Signed-off-by: Eli Cohen <elic@...dia.com>
>---
>v0 --> v1:
>Update "Fixes" line
>
> drivers/vdpa/vdpa_sim/vdpa_sim.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c
>index 14e024de5cbf..89a474c7a096 100644
>--- a/drivers/vdpa/vdpa_sim/vdpa_sim.c
>+++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
>@@ -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_vq_reset() is called while resetting the device in 
vdpasim_reset() where we also set `vdpasim->features = 0` after 
resetting the vqs, so maybe it's better to use the supported features 
here, since the negotiated ones are related to the previous instance.

Thanks,
Stefano

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ