From nobody Tue Feb 10 09:59:18 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 9B2232BE029 for ; Tue, 27 Jan 2026 08:39:40 +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=1769503182; cv=none; b=q2dpDubdiglPkSYlYWGYp0p9JBvetFTSzQodXi/sAcTxm1j68tn2ozGVcNbSRR949U1IVvNPeyIY3TsdHT293phJ+9+mcWZy7zebiFHIYBzrow3sqokhNeCdcmdN1CQbElEVExZhHOB//gQjilqShrbEOLueAQ9pxB6wQaCCuo8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769503182; c=relaxed/simple; bh=FWQl+ThD6FfnU8sAPTGh3+UCUS6+i6Rts9l/UHPRygg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EiyekwMpxwcbkppYjGGk6lEzXkaG22fSiOTV8Lb5+RsGfs8wx8QVbXYCcPM3koFLsDh6Duf9hIojd6BtY2+WnkOt+olYVTiZsNSAlTlSq4raGjcl5OMF6ltdQfMPsV+VDs0hlQ5m5PW60kpDjmYBwj8kQh90j+fPH1jcjpA7MQ4= 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=cz+eMWrB; 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="cz+eMWrB" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1769503180; x=1801039180; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FWQl+ThD6FfnU8sAPTGh3+UCUS6+i6Rts9l/UHPRygg=; b=cz+eMWrBz6u8sye4ra5hHm8mFUr4q2zLd2jquAR8IydoB4XEH3Pi2Mhn e29+HEuQ+D3++9cqkk02mhg9j7a24RoMyKEkGCOuOLFMbBSURjNh0AGEa YPigi7u9fzz6ViB53YvXElIrB9OurTDSV6TE4xyp8qEeGqcY/IZfkQYcL O+x+ns2VaPnoGnvLy79qQDOSNokodQhrbbJGRtIh3PR9TnQNVwQYlDNLe EIOnZ9LZ3Ou7gu+JZGB+CMv/KsZ7XaY3aDZDIAPGhx43Qpp+pSkXO2c25 bHsHemRBUAvqOQuUZdhKjQ6nCJaoE6VGNtHDZUBKCTcd4+E9r+dzSEb0v Q==; X-CSE-ConnectionGUID: 92dLaJNcSPe6IFgkKcfR+A== X-CSE-MsgGUID: Lu0ZUCezRjGVU6z9tCTKBg== X-IronPort-AV: E=Sophos;i="6.21,256,1763395200"; d="scan'208";a="136124514" 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:38 +0800 IronPort-SDR: 697879ca_0WKidgG0mRv3VahY6Zluvp/vl+cp2MDbbSII9x2dTCzoi7v Sw87yszzGM9XrRJo51S0NSxffH1hLPPe9NtsNYA== 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:39 -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:36 -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 3/3] virtio: silence KCSAN warning in vring_interrupt Date: Tue, 27 Jan 2026 09:39:26 +0100 Message-ID: <20260127083926.865555-4-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 vring_interrupt(). =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 vring_interrupt+0x125/0x1f0 race at unknown origin, with read to 0xffff88810218d942 of 2 bytes by inte= rrupt on cpu 7: vring_interrupt+0x125/0x1f0 __handle_irq_event_percpu+0xaf/0x310 handle_irq_event+0x76/0xf0 handle_edge_irq+0x1fc/0x3e0 __common_interrupt+0x79/0x160 common_interrupt+0xa6/0xe0 asm_common_interrupt+0x26/0x40 pv_native_safe_halt+0x17/0x20 default_idle+0x9/0x10 default_idle_call+0x3c/0x110 do_idle+0x166/0x190 cpu_startup_entry+0x29/0x30 start_secondary+0x114/0x140 common_startup_64+0x129/0x138 value changed: 0x3a3a -> 0x3a3b Reported by Kernel Concurrency Sanitizer on: CPU: 7 UID: 0 PID: 0 Comm: swapper/7 Not tainted 6.19.0-rc7+ #223 PREEMPT(= 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 more_used() with data_race() to silence the warning. Signed-off-by: Johannes Thumshirn --- drivers/virtio/virtio_ring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index d1033768b6cd..7fa8f2ebe94e 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -2695,7 +2695,7 @@ irqreturn_t vring_interrupt(int irq, void *_vq) { struct vring_virtqueue *vq =3D to_vvq(_vq); =20 - if (!more_used(vq)) { + if (data_race(!more_used(vq))) { pr_debug("virtqueue interrupt with no work for %p\n", vq); return IRQ_NONE; } --=20 2.52.0