mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stian Halseth <stian@itx.no>
To: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>,
	Andreas Larsson <andreas@gaisler.com>,
	Naveen N Rao <naveen@kernel.org>,
	 sparclinux@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/4] sparc64: kprobes: Single-step from an executable instruction slot
Date: Fri, 13 Nov 2026 12:09:15 +0100	[thread overview]
Message-ID: <8f50f1b1bcbb1e1ebeb97e23e0896bfdf92b47a7.camel@itx.no> (raw)
In-Reply-To: <undine-1794562347340141345-b03249069e19e203@undined.local>

[-- Attachment #1: Type: text/plain, Size: 1095 bytes --]

Hi Masami,

On Fri, 2026-11-13 at 18:32 +0900, Masami Hiramatsu (Google) wrote:
> 
> With this change, the p->ainsn.insn becomes NULL here when kill_kprobe()
> calls this function because (1) init.text is removed or (2) probed module
> is unloaded.
> 
> If another module is loaded at the same region and another kprobe
> is registered at the same address, register_aggr_kprobe() ->
> init_aggr_kprobe() -> flush_insn_slot(NULL) is called. This can
> cause a problem because it is defined as:
> 
> #define flush_insn_slot(p)		\
> do { 	flushi(&(p)->ainsn.insn[0]);	\
> 	flushi(&(p)->ainsn.insn[1]);	\
> 	flushi(&(p)->ainsn.insn[2]);	\
> } while (0)
> 
> Since the flush_insn_slot() is only needed if p->ainsn.insn is
> embedded in the struct kprobe, as this changed it to insn_slot,
> we don't need this macro anymore.
> So you should update it as same as other arch like:
> 
> #define flush_insn_slot(p) do { } while (0)

Thanks for the review, I'll test and adopt that change in v2.

I'll check for any other feedback, then prepare the v2 later today.

/Stian


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2026-11-13 11:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-09 18:03 [PATCH 0/4] sparc64: kprobes: Make kprobes work on sun4v Stian Halseth
2026-10-09 18:03 ` [PATCH 1/4] sparc64: kprobes: Single-step from an executable instruction slot Stian Halseth
2026-11-13  9:32   ` Masami Hiramatsu (Google)
2026-11-13 11:09     ` Stian Halseth [this message]
2026-10-09 18:03 ` [PATCH 2/4] sparc64: kprobes: Fix up register and FP branches after single-step Stian Halseth
2026-10-09 18:03 ` [PATCH 3/4] sparc64: kprobes: Resume after a delay slot at the saved next PC Stian Halseth
2026-10-09 18:03 ` [PATCH 4/4] sparc64: kprobes: Handle annulled branches Stian Halseth

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=8f50f1b1bcbb1e1ebeb97e23e0896bfdf92b47a7.camel@itx.no \
    --to=stian@itx.no \
    --cc=andreas@gaisler.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=naveen@kernel.org \
    --cc=sparclinux@vger.kernel.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

all inboxes | Powered by JetHome®