From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796307822; b=XiMMbuToc8/5beyjlgFK/oFP1mdvEBR9tWwX/rNT2BF3l5VMBT4+A583C4sDpdKtDG/Q YvGyOBxnHZ4OV3PrtMhBqA8IZZn0xnO5gOitVu0GqISkuu+Hz7Dmj4d1pAfkUp5lP/CeR X8RoPolWjq2UsPm+Da1POEJCla7MVQ2ofDqd6a2yLGomFKx5nK60EkWd3TeuP3+UZ4fQx b8uWZO36Cf+5bd8IpI6wgth4Yg8ogapUJfaSkgWzrFyyvZ34lPs1Dqovg84K8wN0nRFGS 0s9jseCsgkQuQmFq5CzMJNvLk2unnxmVTHQYmgf7QPAn+NhW3/Z/DsuYxj7BCc55ShQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796307822; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=I2q1255cZMmCC4sXzdG7ag/c1qyYGJNQz/0coal8svQ=; b=5BKYQuHZUeClYPr9ZECGrShX+H1l5br4krvPblOpAsFITqnjAtfffcLl5NXUNx6X9G4Z JhnCpAiizuPqaKU3peEx6gb7aU4jc9av4HYXx6IIJMiwESg0sAJMxKZIyS8dquDZdQaE/ 5GCD+h9WBWAVDwQi3rs1TL2cRYgtVCAUF4HDgfLTOvpuX0e1nFQtbIw7zVafyrG2/Qx8p uKWrkx6/BlRVig7a5VheX5EzTR4LMKT4y/EomKqvLA3j/FH6nXgHHWsQ6L8eH5vNesjPj lKKs3PtXNp12tPnMa13tyXpxuyh1ZBgua+WfoOsx+H6J7esDItnkNVblzamaLB+zVqw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=bn3BLjGX; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F465606A32C for ; Thu, 3 Dec 2026 14:23:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=bn3BLjGX Received: by smtp.kernel.org (Postfix) with ESMTPSA id 931FF1F00896; Thu, 3 Dec 2026 14:23:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796307821; bh=I2q1255cZMmCC4sXzdG7ag/c1qyYGJNQz/0coal8svQ=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=bn3BLjGXVbRayPyssbESNBiwuCeihdsx41zEnPrBX3W7lW3BhcCE9pjOnpusF2UVb /fh5XUpBH//H1oAhnQxacqkXgUOJiqSf3Ps74gNZNFtmJMVD4vGRgDpLvdmg0POBly PBOHq+QPTixcdmPchIqKZi2BI+dQUk6/7FKxOkv1lvJ9z4ygTGNLCCg917u5Q7lTih PaB7ARZJ58GJhQXPd6+GCvcTNB667giY914oCrvC8bhBcf/d8yMtfIHKpwkIdEEQUz cnwhMm/dAdq1FtEfkCPnU4Y/+hDLs5lGCZXP6DO9x/ddaR/LCSYmk6KuC/hfryOKXM 5OLNX+iZlPOeA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v11 04/10] riscv: implement preemptible this_cpu read and write operations Reply-To: sashiko-reviews@lists.linux.dev To: "Yunhui Cui" , pjw@kernel.org, palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr, dennis@kernel.org, tj@kernel.org, cl@gentwo.org, oleg@redhat.com, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, eddyz87@gmail.com, memxor@gmail.com, martin.lau@linux.dev, song@kernel.org, yonghong.song@linux.dev, jolsa@kernel.org, emil@etsalapatis.com, ihor.solodrai@linux.dev, bjorn@kernel.org, pulehui@huawei.com, puranjay@kernel.org, broonie@kernel.org, dave@stgolabs.net, david.laight.linux@gmail.com, jszhang@kernel.org, tglx@kernel.org, conor.dooley@microchip.com, thuth@redhat.com, ajones@ventanamicro.com, ben.dooks@codethink.co.uk, rkrcmar@ventanamicro.com, samuel.holland@sifive.com, zong.li@sifive.com, debug@rivosinc.com, seanwascoding@gmail.com, andybnac@gmail.com, menglong8.dong@gmail.com, cyrilbur@tenstorrent.com, wangruikang@iscas.ac.cn, atishp@rivosinc.com, apatel@ventanamicro.com, arnd@arndb.de, nathan@kernel.org, nick.desaulniers+lkml@gmail.com, morbo@google.com, justinstitt@google.com, qingfang.deng@siflower.com.cn, linux-mm@kvack.org, bpf@vger.kernel.org In-Reply-To: <20261203135328.32990-5-cuiyunhui@bytedance.com> References: <20261203135328.32990-1-cuiyunhui@bytedance.com> <20261203135328.32990-5-cuiyunhui@bytedance.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 14:23:39 +0000 X-Mailing-List: bpf@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] riscv: missing __force casts in percpu read/write cause sparse warnings -- commit 2b76c184196d497191f80e585d202ed8e0dcab37 Author: Yunhui Cui riscv: implement preemptible this_cpu read and write operations This commit implements preemptible RISC-V this_cpu_read_{1,2,4,8} and this_cpu_write_{1,2,4,8} operations using the recoverable per-CPU address handling instead of the generic fallbacks. > diff --git a/arch/riscv/include/asm/percpu.h b/arch/riscv/include/asm/per= cpu.h > index a5ceedc934b54..cd88618889494 100644 > --- a/arch/riscv/include/asm/percpu.h > +++ b/arch/riscv/include/asm/percpu.h > @@ -176,7 +176,73 @@ __percpu_##name##_amo_case_##sz(void __percpu *pcp, = unsigned long val) \ > (TYPEOF_UNQUAL(*__pcp_ptr))op(__pcp_ptr, ##args); \ > }) > =20 [ ... ] > +#define this_cpu_read_1(pcp) _pcp_wrap_return(__percpu_read_8, pcp) > +#define this_cpu_read_2(pcp) _pcp_wrap_return(__percpu_read_16, pcp) > +#define this_cpu_read_4(pcp) _pcp_wrap_return(__percpu_read_32, pcp) > + > +#ifdef CONFIG_64BIT > +#define this_cpu_read_8(pcp) _pcp_wrap_return(__percpu_read_64, pcp) > +#endif > + > +#define this_cpu_write_1(pcp, val) \ > + _pcp_wrap(__percpu_write_8, pcp, (unsigned long)(val)) > +#define this_cpu_write_2(pcp, val) \ > + _pcp_wrap(__percpu_write_16, pcp, (unsigned long)(val)) > +#define this_cpu_write_4(pcp, val) \ > + _pcp_wrap(__percpu_write_32, pcp, (unsigned long)(val)) > + > +#ifdef CONFIG_64BIT > +#define this_cpu_write_8(pcp, val) \ > + _pcp_wrap(__percpu_write_64, pcp, (unsigned long)(val)) > +#endif [Severity: Low] Do the casts in _pcp_wrap_return() and this_cpu_write_{1,2,4,8}() need __force to avoid sparse warnings? _pcp_wrap_return() casts the unsigned long from __percpu_read_*() to TYPEOF_UNQUAL(*__pcp_ptr) without __force. Under sparse, this warns on address-space or __bitwise per-CPU variables, such as this_cpu_read() on void __iomem * sswi_cpu_regs in aclint_sswi_ipi_clear(). Similarly, this_cpu_write_{1,2,4,8}() cast val to unsigned long without __force, stripping address-space or __bitwise qualifiers under sparse. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203135328.3299= 0-1-cuiyunhui@bytedance.com?part=3D4