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=1796161735; b=EzLG78nlm90UskftoPZkS/nURRFd8rYqsXOtRKbwZfkh1Xn7oSY1A6TO20j4QZb723ul y9KDZKH/SCwgzMhTInRWm/iMMTb8N0mtnKzP2QrnbLIaxwPRjF8G8jVoUiGZ715hb39kN kIF1X2urO2PdWCJ3U3XIzwjR9zORbexkH18IryRc8bVE0k8EcJX7CLFNh2YGDdPb4Bk8o 14dzwoaDHMkhXEVsYVSJp+glhHP1fjcvWUIlrwV255+uKuCMGljKdsVM6ub3Wkbt3Yu68 d6SbBJiO3sYOCwvKPsKvL6QOYTdUeqYxRXqxvJQDAN30HSAgbzTA/oNIr1fDSSI3qPg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796161735; h=Received:DKIM-Signature:Content-Type:MIME-Version:Message-Id: In-Reply-To:References:Subject:From:To:Cc:Date; bh=tmH60Fyb9fscUCSflJKG9znLW42gnpsj+2jdIsoKi6E=; b=BBeGnmglM6jdEMXwo+3BYcQnBHp8SWTfeFcKripSFaW5PS8vY+Y5OVRX/pKBSQJmrG/B PdjvBqD/qEg+D8dDFeGtDOluUSGn7H8YjiZKvfSAzLoLhInje3JX1Vox1dm8s6ItTG/v0 gV+8LZe5AMbmdPGWGYe18Dlf10PH2j9FgC1MkNu43RHqcrYj9eFrIbdtYRqjhZpl09h5K iu3AAXTzT1W7ALgbpy0zRxNwRbO1MxCSvKREu67BOIRvJnJtkNOhAxxSTkkvhaWhu3n6X DzOehZKeQ9G/qJfL31aUb2uENB2MG1Alrkhbmotd/wkXJglhNH8LtlhP3Du4hND9/Wg== 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=LIEkPE1v; 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 CAAF5606A325; Tue, 1 Dec 2026 21:48:55 +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=LIEkPE1v Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2181C1F00898; Tue, 1 Dec 2026 21:48:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796161735; bh=tmH60Fyb9fscUCSflJKG9znLW42gnpsj+2jdIsoKi6E=; h=In-Reply-To:References:Subject:From:To:Cc:Date; b=LIEkPE1vGgjBb2ex7S7h25fdqzUHwiR4e53EIDbJ7OFYRwmQTW4qpQm0MvkxJSnHd eRvXu1g2OsKu6LlOUg+EAGg/H5WPlwNzFkHuo2EZ8ivk5c9cCokv3U3uxfvzsk9MR+ UFCyLP82O9ENPxah4l+CYuN73nGr/XhAXgd+Zd1SvL1vhDQf9Xy+vTuiq02nPt3pn4 AeV040vRzh9b6P5J+FVjZi7fbzbwaOgPtiUDvSZBFXGXsyPb5NSUESSYZRMO+6B2iN zGJgNcdsZLcd0HHvfkglGpOFWj16NlId7bLyA8gDQy2O8N/6lzKh59mUN/wwcYjDQT 4TT5bAo4UJInw== Content-Type: multipart/mixed; boundary="===============3227720252816238364==" X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Message-Id: In-Reply-To: <20261201042201.3199928-22-song@kernel.org> References: <20261201042201.3199928-22-song@kernel.org> Subject: Re: [PATCH v3 21/22] riscv: Mark helpers called from noinstr code notrace From: bot+bpf-ci@kernel.org To: song@kernel.org,linux-kernel@vger.kernel.org,linux-trace-kernel@vger.kernel.org,live-patching@vger.kernel.org,linux-arch@vger.kernel.org,linux-arm-kernel@lists.infradead.org,linuxppc-dev@lists.ozlabs.org,linux-riscv@lists.infradead.org,bpf@vger.kernel.org Cc: rostedt@goodmis.org,mhiramat@kernel.org,mark.rutland@arm.com,peterz@infradead.org,tglx@kernel.org,frederic@kernel.org,paulmck@kernel.org,catalin.marinas@arm.com,will@kernel.org,maddy@linux.ibm.com,mpe@ellerman.id.au,npiggin@gmail.com,chleroy@kernel.org,pjw@kernel.org,palmer@dabbelt.com,aou@eecs.berkeley.edu,alex@ghiti.fr,ast@kernel.org,daniel@iogearbox.net,andrii@kernel.org,ojeda@kernel.org,kernel-team@meta.com,song@kernel.org,ast@kernel.org,andrii@kernel.org,daniel@iogearbox.net,martin.lau@kernel.org,eddyz87@gmail.com,yonghong.song@linux.dev,mason@kernel.org,ihor.solodrai@linux.dev Date: Tue, 1 Dec 2026 21:48:52 +0000 (UTC) --===============3227720252816238364== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit > riscv: Mark helpers called from noinstr code notrace TL;DR: Possible incomplete fix: two plain inline helpers in cpuidle-riscv-sbi.c, run while RCU isn't watching, may become traceable by ftrace/BPF fentry once inline stops implying notrace. > diff --git a/arch/riscv/include/asm/cpuidle.h b/arch/riscv/include/asm/cpuidle.h > --- a/arch/riscv/include/asm/cpuidle.h > +++ b/arch/riscv/include/asm/cpuidle.h > @@ -10,7 +10,7 @@ > #include > #include > > -static inline void cpu_do_idle(void) > +static inline void notrace cpu_do_idle(void) > { The same cpuidle code has two more plain inline helpers that run while RCU is not watching and are not covered. In drivers/cpuidle/cpuidle-riscv-sbi.c, __sbi_enter_domain_idle_state() is __cpuidle and calls: ct_cpuidle_enter(); if (sbi_is_domain_state_available()) state = sbi_get_domain_state(); else state = states[idx]; ret = riscv_sbi_hart_suspend(state) ? -1 : idx; ct_cpuidle_exit(); Both sbi_is_domain_state_available() and sbi_get_domain_state() are plain "static inline", for example: static inline u32 sbi_get_domain_state(void) { struct sbi_domain_state *data = this_cpu_ptr(&domain_state); return data->state; } Their out-of-line copies are untraced only because inline implies notrace, which is the situation the commit message describes for cpu_do_idle(). The compiler can emit out-of-line copies here as well, since __cpuidle callers carry __no_profile and __no_sanitize_* attributes (for example with clang or KASAN). Once 3c5bdbf65e31 ("compiler_types: Move notrace from inline to __always_inline") removes notrace from inline, could those copies be traced with ftrace or BPF fentry while RCU is not watching? That commit does not touch cpuidle-riscv-sbi.c, and no later commit in the range seems to fix it. Should these two helpers be marked notrace (or __always_inline) along with cpu_do_idle()? --- AI reviewed your patch. Please fix the bug or email reply why it's not a bug. See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md CI run summary: https://github.com/kernel-patches/bpf/actions/runs/46748297297 --===============3227720252816238364==--