[PATCH RFC 0/3] virtio: silence KCSAN warnings

Johannes Thumshirn posted 3 patches 1 week, 5 days ago
There is a newer version of this series
drivers/virtio/virtio_ring.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
[PATCH RFC 0/3] virtio: silence KCSAN warnings
Posted by Johannes Thumshirn 1 week, 5 days ago
When booting a Qemu VM whith KCSAN to debug filesystem races I
encountered a bunch of KCSAN splats in virtio.

I suspect them to be false positives.

I decided to send this as an RFC patchset, as I have no prior knowledge
of virtio.

Johannes Thumshirn (3):
  virtio: silence KCSAN warning in virtqueue_kick_prepare
  virtio: silence KCSAN warning in virtqueue_get_buf_ctx_split
  virtio: silence KCSAN warning in vring_interrupt

 drivers/virtio/virtio_ring.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

-- 
2.52.0
Re: [PATCH RFC 0/3] virtio: silence KCSAN warnings
Posted by Alexander Graf 1 week, 5 days ago
On 27.01.26 09:39, Johannes Thumshirn wrote:
> When booting a Qemu VM whith KCSAN to debug filesystem races I
> encountered a bunch of KCSAN splats in virtio.
>
> I suspect them to be false positives.
>
> I decided to send this as an RFC patchset, as I have no prior knowledge
> of virtio.


All of these looks like KCSAN was just detecting the hypervisor writing 
data. Is there a more generic way we can capture that in the virtio 
helpers? So instead of patching the consumers of functions such as 
vring_interrupt(), can we annotate the whole vring struct as "ignore for 
KCSAN"?


Alex





Amazon Web Services Development Center Germany GmbH
Tamara-Danz-Str. 13
10243 Berlin
Geschaeftsfuehrung: Christof Hellmis, Andreas Stieger
Eingetragen am Amtsgericht Charlottenburg unter HRB 257764 B
Sitz: Berlin
Ust-ID: DE 365 538 597
Re: [PATCH RFC 0/3] virtio: silence KCSAN warnings
Posted by Johannes Thumshirn 1 week, 5 days ago
On 1/27/26 9:48 AM, Alexander Graf wrote:
> On 27.01.26 09:39, Johannes Thumshirn wrote:
>> When booting a Qemu VM whith KCSAN to debug filesystem races I
>> encountered a bunch of KCSAN splats in virtio.
>>
>> I suspect them to be false positives.
>>
>> I decided to send this as an RFC patchset, as I have no prior knowledge
>> of virtio.
>
> All of these looks like KCSAN was just detecting the hypervisor writing
> data. Is there a more generic way we can capture that in the virtio
> helpers? So instead of patching the consumers of functions such as
> vring_interrupt(), can we annotate the whole vring struct as "ignore for
> KCSAN"?
>
Oh indeed, there is a __data_racy annotation. Let me try it!