From: Alexander Graf <graf@amazon.com>
To: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
"Jason Wang" <jasowang@redhat.com>,
"Xuan Zhuo" <xuanzhuo@linux.alibaba.com>,
"Eugenio Pérez" <eperezma@redhat.com>,
"open list:VIRTIO CORE" <virtualization@lists.linux.dev>,
"open list" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] virtio_ring: Add READ_ONCE annotations for device-writable fields
Date: Thu, 29 Jan 2026 17:39:17 +0100 [thread overview]
Message-ID: <3df69121-b4ac-48ce-a26c-5dd3035a3b78@amazon.com> (raw)
In-Reply-To: <20260129121604.745681-1-johannes.thumshirn@wdc.com>
On 29.01.26 13:15, Johannes Thumshirn wrote:
> From: Alexander Graf <graf@amazon.com>
>
> KCSAN reports data races when accessing virtio ring fields that are
> concurrently written by the device (host). These are legitimate
> concurrent accesses where the CPU reads fields that the device updates
> via DMA-like mechanisms.
>
> Add accessor functions that use READ_ONCE() to properly annotate these
> device-writable fields and prevent compiler optimizations that could in
> theory break the code. This also serves as documentation showing which
> fields are shared with the device.
>
> The affected fields are:
> - Split ring: used->idx, used->ring[].id, used->ring[].len
> - Packed ring: desc[].flags, desc[].id, desc[].len
Please add "This patch was partially written using the help of Kiro, an
AI coding assistent, to automate the mechanical work of generating the
inline function definition."
Otherwise LGTM!
Reviewed-by: Alexander Graf <graf@amazon.com>
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
next prev parent reply other threads:[~2026-01-29 16:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-29 12:15 [PATCH v2] virtio_ring: Add READ_ONCE annotations for device-writable fields Johannes Thumshirn
2026-01-29 16:39 ` Alexander Graf [this message]
2026-01-29 18:11 ` Michael S. Tsirkin
2026-01-30 2:03 ` Jason Wang
2026-01-30 7:42 ` Michael S. Tsirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3df69121-b4ac-48ce-a26c-5dd3035a3b78@amazon.com \
--to=graf@amazon.com \
--cc=eperezma@redhat.com \
--cc=jasowang@redhat.com \
--cc=johannes.thumshirn@wdc.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=virtualization@lists.linux.dev \
--cc=xuanzhuo@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox