From nobody Mon Feb 9 15:47:34 2026 Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 83F623382C4 for ; Wed, 28 Jan 2026 08:46:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.154.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769589975; cv=none; b=RXuUGe70zVH9Zhb8IMCCrqE//qWr+tw5AUYGa/USX89Yiamdy09yu1unaURHoluNjBMCSa50J9o6BpFdhULAhKB9qZJd52/Q5+J5d0ekDHWX/kRHgQDS3oDuqWX1NuiRSszBgfSSBowRvv0bqSHCS50Ub49qKwxOGDbVr5YoFAI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769589975; c=relaxed/simple; bh=NYPgB44pc7Pok9nzrR7OebNtleH8cRs70K3euGX68L8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=NbJZBGLn7OFiNcMI+TUvrKSmBNxrNogf2n7eIlfbL346rSwt88bkI9YC4If/Kj160fumnB8AOcl6r1UxWVzdUF29pEeg27AzyRX88FDsHAOM72udnOq5UnXYJuzxDNRxMbs6VfyV/34ciypRSloksMVyi4ppcnnPufZpnauLmTU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com; spf=pass smtp.mailfrom=wdc.com; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b=GU3NE0/B; arc=none smtp.client-ip=216.71.154.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wdc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="GU3NE0/B" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1769589972; x=1801125972; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=NYPgB44pc7Pok9nzrR7OebNtleH8cRs70K3euGX68L8=; b=GU3NE0/BS0bR02uOZy+tXYzmn4lxDPT55u6SCzD/+++LWl5W1BcTeaAY z8IRgfTKwXXPM8o1ENKbRhsCgeqiW+Js5dLi+8XYaLq0poZ7cFbaKoZWT KthsnMWQ7RAh5tWj0aAq6P4JWojj9cOb+2nmmNfO+F8meI9k2/U+3p7+q GNO3TVscVJ9QRR/+QH4qdTHB4+ey401RQZj5XWf1gJQn4+GtAJZAgqSq2 sAE/c2yRmovP8C/2TJQunrQOjIuHZ77s8iFSawRPBAEiGB0ehIMUnZMWs GyPFnwLHTuAYd1khZVIMAgKNjsL4u1uGOW4DaZz7SNVU7k9Fyp5gBQUiF w==; X-CSE-ConnectionGUID: J/tK8KvGTYOk92ZbgqxiOg== X-CSE-MsgGUID: zewZcVHfT16i8NzVJWaiZg== X-IronPort-AV: E=Sophos;i="6.21,258,1763395200"; d="scan'208";a="136192526" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 28 Jan 2026 16:46:06 +0800 IronPort-SDR: 6979ccd0_EXZWXlzG4wMYQnx5afVNKxUeoH6C7bShgJf44k2Q21sUXcq OxfVUMpxImkrrYqJWlKTFeu37KfCBW0y5DyfNTw== Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 28 Jan 2026 00:46:08 -0800 WDCIronportException: Internal Received: from c02cd2rwlvdl.ad.shared (HELO neo.fritz.box) ([10.224.28.86]) by uls-op-cesaip01.wdc.com with ESMTP; 28 Jan 2026 00:46:06 -0800 From: Johannes Thumshirn To: virtualization@lists.linux.dev Cc: "Michael S . Tsirkin" , Jason Wang , Xuan Zhuo , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Alexander Graf , linux-kernel@vger.kernel.org, Johannes Thumshirn , kernel test robot Subject: [PATCH] virtio: fix compilation error in __vringh_notify_enable Date: Wed, 28 Jan 2026 09:45:59 +0100 Message-ID: <20260128084559.256235-1-johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.52.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Commit d43eaf1d749b ("virtio: silence KCSAN warning in virtqueue_kick_prepare") introduced a compile error in __vringh_notify_enable() because __vringh_notify_enable dereferences the return of the vring_avail_event() macro making it incompatible with the data_race() annotation added in d43eaf1d749b. Remove the data_race() annotation in vring_avail_event() and move it into it's callers instead. Fixes: d43eaf1d749b ("virtio: silence KCSAN warning in virtqueue_kick_prepa= re") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202601280148.8Z2rFqjo-lkp@int= el.com/ Signed-off-by: Johannes Thumshirn --- Michael: I wasn't sure if you want a patch on top (what I did) or a new version of the broken patch to replace it. Just drop me a note if I should take the other way. drivers/vhost/vringh.c | 4 ++-- drivers/virtio/virtio_ring.c | 2 +- include/uapi/linux/virtio_ring.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c index 925858cc6096..47d3a8bb9c52 100644 --- a/drivers/vhost/vringh.c +++ b/drivers/vhost/vringh.c @@ -556,10 +556,10 @@ static inline bool __vringh_notify_enable(struct vrin= gh *vrh, return true; } } else { - if (putu16(vrh, &vring_avail_event(&vrh->vring), + if (putu16(vrh, data_race(&vring_avail_event(&vrh->vring)), vrh->last_avail_idx) !=3D 0) { vringh_bad("Updating avail event index %p", - &vring_avail_event(&vrh->vring)); + data_race(&vring_avail_event(&vrh->vring))); return true; } } diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 1db27ee2d89f..95744d03b284 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -737,7 +737,7 @@ static bool virtqueue_kick_prepare_split(struct virtque= ue *_vq) =20 if (vq->event) { needs_kick =3D vring_need_event(virtio16_to_cpu(_vq->vdev, - vring_avail_event(&vq->split.vring)), + data_race(vring_avail_event(&vq->split.vring))), new, old); } else { needs_kick =3D !(vq->split.vring.used->flags & diff --git a/include/uapi/linux/virtio_ring.h b/include/uapi/linux/virtio_r= ing.h index 32568cfa1c63..f8c20d3de8da 100644 --- a/include/uapi/linux/virtio_ring.h +++ b/include/uapi/linux/virtio_ring.h @@ -194,7 +194,7 @@ struct vring { /* We publish the used event index at the end of the available ring, and v= ice * versa. They are at the end for backwards compatibility. */ #define vring_used_event(vr) ((vr)->avail->ring[(vr)->num]) -#define vring_avail_event(vr) (data_race(*(__virtio16 *)&(vr)->used->ring[= (vr)->num])) +#define vring_avail_event(vr) (*(__virtio16 *)&(vr)->used->ring[(vr)->num]) =20 static inline void vring_init(struct vring *vr, unsigned int num, void *p, unsigned long align) --=20 2.52.0