All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jarkko Sakkinen" <jarkko@kernel.org>
To: "Mark Rutland" <mark.rutland@arm.com>, <linux-kernel@vger.kernel.org>
Cc: <agordeev@linux.ibm.com>, <anil.s.keshavamurthy@intel.com>,
	<aou@eecs.berkeley.edu>, <bp@alien8.de>,
	<catalin.marinas@arm.com>, <dave.hansen@linux.intel.com>,
	<davem@davemloft.net>, <gor@linux.ibm.com>, <hca@linux.ibm.com>,
	<jcalvinowens@gmail.com>, <linux-arm-kernel@lists.infradead.org>,
	<mhiramat@kernel.org>, <mingo@redhat.com>, <mpe@ellerman.id.au>,
	<naveen.n.rao@linux.ibm.com>, <palmer@dabbelt.com>,
	<paul.walmsley@sifive.com>, <tglx@linutronix.de>,
	<will@kernel.org>
Subject: Re: [PATCH 4/4] kprobes: Remove core dependency on modules
Date: Wed, 03 Apr 2024 19:10:58 +0300	[thread overview]
Message-ID: <D0AMARUFBCNN.21GJ0PXUDK0F6@kernel.org> (raw)
In-Reply-To: <Zg07hrb_RMUu2tq7@FVFF77S0Q05N>

On Wed Apr 3, 2024 at 2:20 PM EEST, Mark Rutland wrote:
> On Tue, Mar 26, 2024 at 04:36:24PM +0000, Mark Rutland wrote:
> > From: Jarkko Sakkinen <jarkko@kernel.org>
> > 
> > Tracing with kprobes while running a monolithic kernel is currently
> > impossible because KPROBES depends on MODULES. While this dependency is
> > necessary when KPROBES_USE_MODULE_ALLOC=y, all the other module-specific
> > code only exist to handle the case when MODULES=y, and can be hidden
> > behind ifdeffery.
> > 
> > Add the necessary ifdeffery, and remove the dependency on MODULES=N when
> > KPROBES_USE_MODULE_ALLOC=n.
> > 
> > Currently this allows kprobes to be used when CONFIG_MODULES=n on arm64
> > and riscv, and other architectures can enable support by implementing
> > their own kprobes_alloc_insn_page() and kprobes_free_insn_page() which
> > do not depend on MODULES.
> > 
> > Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
> > Link: https://lore.kernel.org/all/20240326012102.27438-1-jarkko@kernel.org/
> > [Mark: Remove execmem changes, depend on !KPROBES_USE_MODULE_ALLOC]
> > Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> > Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
> > Cc: David S. Miller <davem@davemloft.net>
> > Cc: Jarkko Sakkinen <jarkko@kernel.org>
> > Cc: Masami Hiramatsu <mhiramat@kernel.org>
> > Cc: Naveen N. Rao <naveen.n.rao@linux.ibm.com>
> > ---
> >  arch/Kconfig                |  2 +-
> >  kernel/kprobes.c            | 12 +++++++++++-
> >  kernel/trace/trace_kprobe.c | 15 +++++++++++++--
> >  3 files changed, 25 insertions(+), 4 deletions(-)
> > 
> > diff --git a/arch/Kconfig b/arch/Kconfig
> > index 85bb59f7b8c07..cf43de9ffb5b9 100644
> > --- a/arch/Kconfig
> > +++ b/arch/Kconfig
> > @@ -52,7 +52,7 @@ config GENERIC_ENTRY
> >  
> >  config KPROBES
> >  	bool "Kprobes"
> > -	depends on MODULES
> > +	depends on MODULES || !KPROBES_USE_MODULE_ALLOC
>
> Whoops; that should be:
>
> 	depends on MODULES || HAVE_KPROBES_ALLOC
>
> ... with similar fixups in the commit message to describe HAVE_KPROBES_ALLOC
> rather than KPROBES_USE_MODULE_ALLOC (which does not exist in any version of
> the series that got sent to the list).
>
> I'll send a v2 with that fixed (and the other changes from Jarkko's v7 base
> patch) once I've locally tested that for architectures with and without
> HAVE_KPROBES_ALLOC.

OK, please put to me to the CC list as I'm not ATM subscribed
to the tracing list.

BR, Jarkko

WARNING: multiple messages have this Message-ID (diff)
From: "Jarkko Sakkinen" <jarkko@kernel.org>
To: "Mark Rutland" <mark.rutland@arm.com>, <linux-kernel@vger.kernel.org>
Cc: <agordeev@linux.ibm.com>, <anil.s.keshavamurthy@intel.com>,
	<aou@eecs.berkeley.edu>, <bp@alien8.de>,
	<catalin.marinas@arm.com>, <dave.hansen@linux.intel.com>,
	<davem@davemloft.net>, <gor@linux.ibm.com>, <hca@linux.ibm.com>,
	<jcalvinowens@gmail.com>, <linux-arm-kernel@lists.infradead.org>,
	<mhiramat@kernel.org>, <mingo@redhat.com>, <mpe@ellerman.id.au>,
	<naveen.n.rao@linux.ibm.com>, <palmer@dabbelt.com>,
	<paul.walmsley@sifive.com>, <tglx@linutronix.de>,
	<will@kernel.org>
Subject: Re: [PATCH 4/4] kprobes: Remove core dependency on modules
Date: Wed, 03 Apr 2024 19:10:58 +0300	[thread overview]
Message-ID: <D0AMARUFBCNN.21GJ0PXUDK0F6@kernel.org> (raw)
In-Reply-To: <Zg07hrb_RMUu2tq7@FVFF77S0Q05N>

On Wed Apr 3, 2024 at 2:20 PM EEST, Mark Rutland wrote:
> On Tue, Mar 26, 2024 at 04:36:24PM +0000, Mark Rutland wrote:
> > From: Jarkko Sakkinen <jarkko@kernel.org>
> > 
> > Tracing with kprobes while running a monolithic kernel is currently
> > impossible because KPROBES depends on MODULES. While this dependency is
> > necessary when KPROBES_USE_MODULE_ALLOC=y, all the other module-specific
> > code only exist to handle the case when MODULES=y, and can be hidden
> > behind ifdeffery.
> > 
> > Add the necessary ifdeffery, and remove the dependency on MODULES=N when
> > KPROBES_USE_MODULE_ALLOC=n.
> > 
> > Currently this allows kprobes to be used when CONFIG_MODULES=n on arm64
> > and riscv, and other architectures can enable support by implementing
> > their own kprobes_alloc_insn_page() and kprobes_free_insn_page() which
> > do not depend on MODULES.
> > 
> > Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
> > Link: https://lore.kernel.org/all/20240326012102.27438-1-jarkko@kernel.org/
> > [Mark: Remove execmem changes, depend on !KPROBES_USE_MODULE_ALLOC]
> > Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> > Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
> > Cc: David S. Miller <davem@davemloft.net>
> > Cc: Jarkko Sakkinen <jarkko@kernel.org>
> > Cc: Masami Hiramatsu <mhiramat@kernel.org>
> > Cc: Naveen N. Rao <naveen.n.rao@linux.ibm.com>
> > ---
> >  arch/Kconfig                |  2 +-
> >  kernel/kprobes.c            | 12 +++++++++++-
> >  kernel/trace/trace_kprobe.c | 15 +++++++++++++--
> >  3 files changed, 25 insertions(+), 4 deletions(-)
> > 
> > diff --git a/arch/Kconfig b/arch/Kconfig
> > index 85bb59f7b8c07..cf43de9ffb5b9 100644
> > --- a/arch/Kconfig
> > +++ b/arch/Kconfig
> > @@ -52,7 +52,7 @@ config GENERIC_ENTRY
> >  
> >  config KPROBES
> >  	bool "Kprobes"
> > -	depends on MODULES
> > +	depends on MODULES || !KPROBES_USE_MODULE_ALLOC
>
> Whoops; that should be:
>
> 	depends on MODULES || HAVE_KPROBES_ALLOC
>
> ... with similar fixups in the commit message to describe HAVE_KPROBES_ALLOC
> rather than KPROBES_USE_MODULE_ALLOC (which does not exist in any version of
> the series that got sent to the list).
>
> I'll send a v2 with that fixed (and the other changes from Jarkko's v7 base
> patch) once I've locally tested that for architectures with and without
> HAVE_KPROBES_ALLOC.

OK, please put to me to the CC list as I'm not ATM subscribed
to the tracing list.

BR, Jarkko

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2024-04-03 16:11 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-26 16:36 [PATCH 0/4] kprobes: permit use without modules Mark Rutland
2024-03-26 16:36 ` Mark Rutland
2024-03-26 16:36 ` [PATCH 1/4] arm64: patching: always use fixmap Mark Rutland
2024-03-26 16:36   ` Mark Rutland
2024-03-26 16:36 ` [PATCH 2/4] kprobes/treewide: Add kprobes_ prefix to insn alloc/free functions Mark Rutland
2024-03-26 16:36   ` Mark Rutland
2024-03-26 17:11   ` Jarkko Sakkinen
2024-03-26 17:11     ` Jarkko Sakkinen
2024-03-26 16:36 ` [PATCH 3/4] kprobes/treewide: Explicitly override " Mark Rutland
2024-03-26 16:36   ` Mark Rutland
2024-04-13  7:22   ` Alexander Gordeev
2024-04-13  7:22     ` Alexander Gordeev
2024-03-26 16:36 ` [PATCH 4/4] kprobes: Remove core dependency on modules Mark Rutland
2024-03-26 16:36   ` Mark Rutland
2024-03-26 17:13   ` Jarkko Sakkinen
2024-03-26 17:13     ` Jarkko Sakkinen
2024-03-26 17:38     ` Mark Rutland
2024-03-26 17:38       ` Mark Rutland
2024-03-27  0:01       ` Masami Hiramatsu
2024-03-27  0:01         ` Masami Hiramatsu
2024-03-27 13:23         ` Jarkko Sakkinen
2024-03-27 13:23           ` Jarkko Sakkinen
2024-03-27 17:46         ` Jarkko Sakkinen
2024-03-27 17:46           ` Jarkko Sakkinen
2024-03-27 23:47           ` Masami Hiramatsu
2024-03-27 23:47             ` Masami Hiramatsu
2024-03-30 11:32             ` Jarkko Sakkinen
2024-03-30 11:32               ` Jarkko Sakkinen
2024-04-03 11:20   ` Mark Rutland
2024-04-03 11:20     ` Mark Rutland
2024-04-03 16:10     ` Jarkko Sakkinen [this message]
2024-04-03 16:10       ` Jarkko Sakkinen

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=D0AMARUFBCNN.21GJ0PXUDK0F6@kernel.org \
    --to=jarkko@kernel.org \
    --cc=agordeev@linux.ibm.com \
    --cc=anil.s.keshavamurthy@intel.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=bp@alien8.de \
    --cc=catalin.marinas@arm.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=jcalvinowens@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mhiramat@kernel.org \
    --cc=mingo@redhat.com \
    --cc=mpe@ellerman.id.au \
    --cc=naveen.n.rao@linux.ibm.com \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=tglx@linutronix.de \
    --cc=will@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.