From nobody Wed Feb 11 04:06:05 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 26FB22C029D for ; Tue, 27 Jan 2026 08:39:38 +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=1769503180; cv=none; b=mWheNb5zrr7nlQGuNRGIEBz6/Iu99YNCRcnuJJbjSqnsomOpJnvxnvE4/yuU93MD845vjBrEBapwFRHM3GiF9U86/bJDSMo1fR8JO2Uqm7ZcapvRACxagVg2IqXW4gAeT9wDaJcw7s+FIYpayxN1YFe7+OWr18JpBXSiJcUulg0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769503180; c=relaxed/simple; bh=XBzWm4v6PSi/oXWq52MxC83lY+5UYxtqQ1gZlDpzeuE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XHI1rpkBySKmCj/AHx7FNFHsrxujcCIYcY6hxdpSXOjkQ8YH1oLVcW5BJckv/mDFtvutq+DtMhNabK/ewfnzMm5omjWgz4e8oz90oSMm6vlEisMkcvjkTkqBka1JAq6+muK21LdB518zQ4kAlyq1TsBASwTtFtx6C+NX3zmJRu0= 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=kFuKkJzp; 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="kFuKkJzp" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1769503179; x=1801039179; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XBzWm4v6PSi/oXWq52MxC83lY+5UYxtqQ1gZlDpzeuE=; b=kFuKkJzpt6sWcih3KLsnZOyRLC9eKP1pjbs7k9HRUybWsahwCUfjf3f6 j8h0kvJkqarxH+C/XBwW9Ii6fJWyMrBNYyW1pRLnF20ymXuCOFjWPcKTS KmYrCbOC8ORU6LQrRRUEN6NU7Ens7wXD0deKnxK4AKL+PsFRN6R3D30xg A252qY5zsV2O5R32Cn/bbO9Lh42f+LJQOWOlekOF27f+4OJ+ZnthPb0Ht erwKTjbDDyfO2tmrdBxbkOIkXOXMOQR4K7OP5S+hrrUvOVoMBW71HTPvJ IT/eRTCA08CQeEYIbv1OLBjpSGS8vmITfxiv57vZXOO+atudtqg5iADCk w==; X-CSE-ConnectionGUID: DSdA8EJ6RHWqe4CNXKekPg== X-CSE-MsgGUID: QiAAewAARx6RyDPcr5EtHw== X-IronPort-AV: E=Sophos;i="6.21,256,1763395200"; d="scan'208";a="136124509" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 27 Jan 2026 16:39:33 +0800 IronPort-SDR: 697879c5_sk9lWJzc5H9kGE9bCXd26F6wHv0n8QnJfyQ5FDjMA0wUdf0 TyvRDDJ4Q3lyh0KeH/DdC/3hhEpg3r9ruaIerYA== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 27 Jan 2026 00:39:34 -0800 WDCIronportException: Internal Received: from 5cg02580n2.ad.shared (HELO neo.wdc.com) ([10.224.28.78]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jan 2026 00:39:31 -0800 From: Johannes Thumshirn To: virtualization@lists.linux.dev Cc: Alexander Graf , mst@redhat.com, jasowang@redhat.com, xuanzhuo@linux.alibaba.com, eperezma@redhat.com, linux-kernel@vger.kernel.org, Johannes Thumshirn Subject: [PATCH RFC 1/3] virtio: silence KCSAN warning in virtqueue_kick_prepare Date: Tue, 27 Jan 2026 09:39:24 +0100 Message-ID: <20260127083926.865555-2-johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260127083926.865555-1-johannes.thumshirn@wdc.com> References: <20260127083926.865555-1-johannes.thumshirn@wdc.com> 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" When booting a Qemu VM with virtio-blk and KCSAN enabled, KCSAN emits the following warning about a data-race in virtqueue_kick_prepare(). =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D BUG: KCSAN: data-race in virtqueue_kick_prepare+0x14d/0x200 race at unknown origin, with read to 0xffff888101cd6d44 of 2 bytes by task= 162 on cpu 0: virtqueue_kick_prepare+0x14d/0x200 virtio_fs_enqueue_req+0x664/0x7d0 virtio_fs_send_req+0xac/0x230 __fuse_simple_request+0x1e1/0x580 fuse_readlink_folio+0x1dc/0x2a0 fuse_get_link+0xd6/0x190 vfs_get_link+0x70/0x80 ovl_get_link+0x4d/0x90 pick_link+0x2c6/0x6a0 step_into_slowpath+0x2ea/0x590 path_openat+0x5bf/0x1b30 do_filp_open+0x177/0x260 do_sys_openat2+0x69/0xc0 __x64_sys_openat+0x7a/0xc0 x64_sys_call+0x10cf/0x1c30 do_syscall_64+0x5d/0x240 entry_SYSCALL_64_after_hwframe+0x76/0x7e value changed: 0x0e63 -> 0x0e65 Reported by Kernel Concurrency Sanitizer on: CPU: 0 UID: 0 PID: 162 Comm: systemctl Not tainted 6.19.0-rc7+ #220 PREEMP= T(none) Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.17.0-9.fc43 = 06/10/2025 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D This warning is likely a false positive as the change happens on the virtio vring. Annotate the return of vring_avail_event() with data_race() to silence the warning. Signed-off-by: Johannes Thumshirn --- drivers/virtio/virtio_ring.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index ddab68959671..5f8c8254bb6c 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -736,9 +736,10 @@ static bool virtqueue_kick_prepare_split(struct virtqu= eue *_vq) LAST_ADD_TIME_INVALID(vq); =20 if (vq->event) { - needs_kick =3D vring_need_event(virtio16_to_cpu(_vq->vdev, - vring_avail_event(&vq->split.vring)), - new, old); + needs_kick =3D vring_need_event( + virtio16_to_cpu(_vq->vdev, data_race(vring_avail_event( + &vq->split.vring))), + new, old); } else { needs_kick =3D !(vq->split.vring.used->flags & cpu_to_virtio16(_vq->vdev, --=20 2.52.0