linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Menglong Dong <menglong.dong@linux.dev>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Mark Brown <broonie@kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Menglong Dong <menglong8.dong@gmail.com>,
	Thorsten Blum <thorsten.blum@linux.dev>,
	linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org
Subject: Re: [for-next PATCH v2] tracing: wprobe: Fix to use IS_ERR_PCPU() for per-cpu pointer
Date: Tue, 7 Oct 2025 22:57:46 +0900	[thread overview]
Message-ID: <20251007225746.ad26cec6b6fa71b47033a7d7@kernel.org> (raw)
In-Reply-To: <6198553.lOV4Wx5bFT@7950hx>

On Tue, 07 Oct 2025 11:12:18 +0800
Menglong Dong <menglong.dong@linux.dev> wrote:

> On 2025/10/7 09:03, Masami Hiramatsu (Google) wrote:
> > From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> > 
> > Since wprobe uses IS_ERR() for per-cpu pointer, it failed to build.
> > 
> > /tmp/next/build/kernel/trace/trace_wprobe.c: In function '__register_trace_wprobe':
> > /tmp/next/build/kernel/trace/trace_wprobe.c:176:20: error: cast to generic address space pointer from disjoint '__seg_gs' address space pointer [-Werror]
> >   176 |         if (IS_ERR((void * __force)tw->bp_event)) {
> >       |                    ^
> > /tmp/next/build/kernel/trace/trace_wprobe.c:177:35: error: cast to generic address space pointer from disjoint '__seg_gs' address space pointer [-Werror]
> >   177 |                 int ret = PTR_ERR((void * __force)tw->bp_event);
> >       |                                   ^
> > 
> > Use IS_ERR_PCPU() instead.
> > 
> > Reported-by: Mark Brown <broonie@kernel.org>
> > Closes: https://lore.kernel.org/all/aN6fTmAjD7-SJsw2@sirena.org.uk/
> > Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
> > Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> > ---
> >  - Confirmed that `make allmodconfig && make` passed on x86_64 and arm64.
> >  Changes in v2:
> >  - Remove unneeded casting.
> >  - Use PTR_ERR_PCPU() too.
> > ---
> >  kernel/trace/trace_wprobe.c |    4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/kernel/trace/trace_wprobe.c b/kernel/trace/trace_wprobe.c
> > index 4b00a8e917c1..98605b207f43 100644
> > --- a/kernel/trace/trace_wprobe.c
> > +++ b/kernel/trace/trace_wprobe.c
> > @@ -173,8 +173,8 @@ static int __register_trace_wprobe(struct trace_wprobe *tw)
> >  	attr.bp_type = tw->type;
> >  
> >  	tw->bp_event = register_wide_hw_breakpoint(&attr, wprobe_perf_handler, tw);
> > -	if (IS_ERR((void * __force)tw->bp_event)) {
> > -		int ret = PTR_ERR((void * __force)tw->bp_event);
> > +	if (IS_ERR_PCPU(tw->bp_event)) {
> > +		int ret = PTR_ERR_PCPU(tw->bp_event);
> 
> This version LGTM.
> 
> Reviewed-by: Menglong Dong <menglong8.dong@gmail.com>

Thank you! Let me push it in probes/for-next.

> 
> >  
> >  		tw->bp_event = NULL;
> >  		return ret;
> > 
> > 
> > 
> 
> 
> 
> 


-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>

      reply	other threads:[~2025-10-07 13:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-07  1:03 [for-next PATCH v2] tracing: wprobe: Fix to use IS_ERR_PCPU() for per-cpu pointer Masami Hiramatsu (Google)
2025-10-07  3:12 ` Menglong Dong
2025-10-07 13:57   ` Masami Hiramatsu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251007225746.ad26cec6b6fa71b47033a7d7@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=menglong.dong@linux.dev \
    --cc=menglong8.dong@gmail.com \
    --cc=rostedt@goodmis.org \
    --cc=thorsten.blum@linux.dev \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).