[PATCH v4 6/9] vhost: always take IOTLB lock

Maxime Coquelin maxime.coquelin at redhat.com
Tue Jan 31 17:59:25 CET 2023



On 1/19/23 19:46, David Marchand wrote:
> clang does not support conditionally held locks when statically analysing
> taken locks with thread safety checks.
> Always take iotlb locks regardless of VIRTIO_F_IOMMU_PLATFORM feature.
> 
> Signed-off-by: David Marchand <david.marchand at redhat.com>
> ---
>   lib/vhost/vhost.c      |  8 +++-----
>   lib/vhost/virtio_net.c | 24 ++++++++----------------
>   2 files changed, 11 insertions(+), 21 deletions(-)
> 

Since there will never be contention when VIRTIO_F_IOMMU_PLATFORM hasn't
been negotiated, there should not be noticeable overhead by taking it
unconditionally, especially since it is removing checking the feature
bit.

Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>

Thanks,
Maxime



More information about the dev mailing list