All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: "Luis Chamberlain" <mcgrof@kernel.org>,
	"Russell King (Oracle)" <linux@armlinux.org.uk>,
	"Edgecombe, Rick P" <rick.p.edgecombe@intel.com>,
	"Christoph Hellwig" <hch@infradead.org>,
	"Jarkko Sakkinen" <jarkko@profian.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Nathaniel McCallum" <nathaniel@profian.com>,
	"Catalin Marinas" <catalin.marinas@arm.com>,
	"Will Deacon" <will@kernel.org>,
	"Thomas Bogendoerfer" <tsbogend@alpha.franken.de>,
	"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
	"Helge Deller" <deller@gmx.de>,
	"Michael Ellerman" <mpe@ellerman.id.au>,
	"Benjamin Herrenschmidt" <benh@kernel.crashing.org>,
	"Paul Mackerras" <paulus@samba.org>,
	"Paul Walmsley" <paul.walmsley@sifive.com>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Albert Ou" <aou@eecs.berkeley.edu>,
	"Heiko Carstens" <hca@linux.ibm.com>,
	"Vasily Gorbik" <gor@linux.ibm.com>,
	"Alexander Gordeev" <agordeev@linux.ibm.com>,
	"Christian Borntraeger" <borntraeger@linux.ibm.com>,
	"Sven Schnelle" <svens@linux.ibm.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Borislav Petkov" <bp@alien8.de>,
	"Dave Hansen" <dave.hansen@linux.intel.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Naveen N. Rao" <naveen.n.rao@linux.ibm.com>,
	"Anil S Keshavamurthy" <anil.s.keshavamurthy@intel.com>,
	"Masami Hiramatsu" <mhiramat@kernel.org>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Kees Cook" <keescook@chromium.org>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Josh Poimboeuf" <jpoimboe@kernel.org>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"Marco Elver" <elver@google.com>,
	"Dan Li" <ashimida@linux.alibaba.com>,
	"Sami Tolvanen" <samitolvanen@google.com>,
	"Song Liu" <song@kernel.org>, "Ard Biesheuvel" <ardb@kernel.org>,
	"Nick Desaulniers" <ndesaulniers@google.com>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Chen Zhongjin" <chenzhongjin@huawei.com>,
	"Nicolas Pitre" <nico@fluxnic.net>,
	"Mark Brown" <broonie@kernel.org>,
	"Luis Machado" <luis.machado@linaro.org>,
	"Geert Uytterhoeven" <geert@linux-m68k.org>,
	"Joey Gouly" <joey.gouly@arm.com>,
	"Masahiro Yamada" <masahiroy@kernel.org>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Andrey Konovalov" <andreyknvl@gmail.com>,
	"Kefeng Wang" <wangkefeng.wang@huawei.com>,
	"Atsushi Nemoto" <anemo@mba.ocn.ne.jp>,
	"Guenter Roeck" <linux@roeck-us.net>,
	"Dave Anglin" <dave.anglin@bell.net>,
	"Alexei Starovoitov" <ast@kernel.org>,
	"Nicholas Piggin" <npiggin@gmail.com>,
	"Daniel Axtens" <dja@axtens.net>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>,
	"Jordan Niethe" <jniethe5@gmail.com>,
	"Guo Ren" <guoren@kernel.org>, "Anup Patel" <anup@brainfault.org>,
	"Atish Patra" <atishp@atishpatra.org>,
	"Changbin Du" <changbin.du@intel.com>,
	"Heiko Stuebner" <heiko@sntech.de>,
	"Liao Chang" <liaochang1@huawei.com>,
	"Philipp Tomsich" <philipp.tomsich@vrull.eu>,
	"Wu Caize" <zepan@sipeed.com>,
	"Emil Renner Berthing" <kernel@esmil.dk>,
	"Alexander Egorenkov" <egorenar@linux.ibm.com>,
	"Thomas Richter" <tmricht@linux.ibm.com>,
	"Tobias Huschle" <huschle@linux.ibm.com>,
	"Ilya Leoshkevich" <iii@linux.ibm.com>,
	"Tom Lendacky" <thomas.lendacky@amd.com>,
	"Daniel Bristot de Oliveira" <bristot@redhat.com>,
	"Michael Roth" <michael.roth@amd.com>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	"Javier Martinez Canillas" <javierm@redhat.com>,
	"Miroslav Benes" <mbenes@suse.cz>,
	"André Almeida" <andrealmeid@igalia.com>,
	"Tiezhu Yang" <yangtiezhu@loongson.cn>,
	"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
	"Aaron Tomlin" <atomlin@redhat.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-mips@vger.kernel.org" <linux-mips@vger.kernel.org>,
	"linux-parisc@vger.kernel.org" <linux-parisc@vger.kernel.org>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"linux-riscv@lists.infradead.org"
	<linux-riscv@lists.infradead.org>,
	"linux-s390@vger.kernel.org" <linux-s390@vger.kernel.org>,
	"sparclinux@vger.kernel.org" <sparclinux@vger.kernel.org>,
	"linux-modules@vger.kernel.org" <linux-modules@vger.kernel.org>
Subject: Re: [PATCH] kprobes: Enable tracing for mololithic kernel images
Date: Thu, 16 Jun 2022 00:24:04 +0300	[thread overview]
Message-ID: <YqpN9NAkAKhgiunQ@iki.fi> (raw)
In-Reply-To: <144b7e90-5d75-7e2c-4e54-8a73f914dfdf@csgroup.eu>

On Tue, Jun 14, 2022 at 12:36:25PM +0000, Christophe Leroy wrote:
> 
> 
> Le 14/06/2022 à 14:26, Jarkko Sakkinen a écrit :
> > On Thu, Jun 09, 2022 at 06:44:45AM -0700, Luis Chamberlain wrote:
> >> On Thu, Jun 09, 2022 at 08:47:38AM +0100, Russell King (Oracle) wrote:
> >>> On Wed, Jun 08, 2022 at 02:59:27AM +0300, Jarkko Sakkinen wrote:
> >>>> diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
> >>>> index 553866751e1a..d2bb954cd54f 100644
> >>>> --- a/arch/arm/kernel/Makefile
> >>>> +++ b/arch/arm/kernel/Makefile
> >>>> @@ -44,6 +44,11 @@ obj-$(CONFIG_CPU_IDLE)		+= cpuidle.o
> >>>>   obj-$(CONFIG_ISA_DMA_API)	+= dma.o
> >>>>   obj-$(CONFIG_FIQ)		+= fiq.o fiqasm.o
> >>>>   obj-$(CONFIG_MODULES)		+= armksyms.o module.o
> >>>> +ifeq ($(CONFIG_MODULES),y)
> >>>> +obj-y				+= module_alloc.o
> >>>> +else
> >>>> +obj-$(CONFIG_KPROBES)		+= module_alloc.o
> >>>> +endif
> >>>
> >>> Doesn't:
> >>>
> >>> obj-$(CONFIG_MODULES)		+= module_alloc.o
> >>> obj-$(CONFIG_KPROBES)		+= module_alloc.o
> >>
> >> That just begs for a new kconfig symbol for the object, and for
> >> the object then to be built with it.
> >>
> >> The archs which override the default can use ARCH_HAS_VM_ALLOC_EXEC.
> >> Please note that the respective free is important as well and its
> >> not clear if we need an another define for the free. Someone has
> >> to do that work. We want to ensure to noexec the code on free and
> >> this can vary on each arch.
> > 
> > Let me check if I understand this (not 100% sure).
> > 
> > So if arch define ARCH_HAS_VMALLOC_EXEC, then this would set
> > config flag CONFIG_VMALLOC_EXEC, which would be used to include
> > the compilation unit?
> > 
> 
> I guess you have two possible approaches.
> 
> Either architectures select CONFIG_ARCH_HAS_VMALLOC_EXEC at all time and 
> then you add a CONFIG_VMALLOC_EXEC which depends on 
> CONFIG_ARCH_HAS_VMALLOC_EXEC and CONFIG_MODULES or CONFIG_KPROBES,
> 
> Or architectures select CONFIG_ARCH_HAS_VMALLOC_EXEC only when either 
> CONFIG_MODULES or CONFIG_KPROBES is selected, in that case there is no 
> need for a CONFIG_VMALLOC_EXEC.

Right, got it now. Thanks for the elaboration.

> Christophe

BR, Jarkko

WARNING: multiple messages have this Message-ID (diff)
From: Jarkko Sakkinen <jarkko@kernel.org>
To: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: "Luis Chamberlain" <mcgrof@kernel.org>,
	"Russell King (Oracle)" <linux@armlinux.org.uk>,
	"Edgecombe, Rick P" <rick.p.edgecombe@intel.com>,
	"Christoph Hellwig" <hch@infradead.org>,
	"Jarkko Sakkinen" <jarkko@profian.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Nathaniel McCallum" <nathaniel@profian.com>,
	"Catalin Marinas" <catalin.marinas@arm.com>,
	"Will Deacon" <will@kernel.org>,
	"Thomas Bogendoerfer" <tsbogend@alpha.franken.de>,
	"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
	"Helge Deller" <deller@gmx.de>,
	"Michael Ellerman" <mpe@ellerman.id.au>,
	"Benjamin Herrenschmidt" <benh@kernel.crashing.org>,
	"Paul Mackerras" <paulus@samba.org>,
	"Paul Walmsley" <paul.walmsley@sifive.com>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Albert Ou" <aou@eecs.berkeley.edu>,
	"Heiko Carstens" <hca@linux.ibm.com>,
	"Vasily Gorbik" <gor@linux.ibm.com>,
	"Alexander Gordeev" <agordeev@linux.ibm.com>,
	"Christian Borntraeger" <borntraeger@linux.ibm.com>,
	"Sven Schnelle" <svens@linux.ibm.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Borislav Petkov" <bp@alien8.de>,
	"Dave Hansen" <dave.hansen@linux.intel.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Naveen N. Rao" <naveen.n.rao@linux.ibm.com>,
	"Anil S Keshavamurthy" <anil.s.keshavamurthy@intel.com>,
	"Masami Hiramatsu" <mhiramat@kernel.org>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Kees Cook" <keescook@chromium.org>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Josh Poimboeuf" <jpoimboe@kernel.org>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"Marco Elver" <elver@google.com>,
	"Dan Li" <ashimida@linux.alibaba.com>,
	"Sami Tolvanen" <samitolvanen@google.com>,
	"Song Liu" <song@kernel.org>, "Ard Biesheuvel" <ardb@kernel.org>,
	"Nick Desaulniers" <ndesaulniers@google.com>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Chen Zhongjin" <chenzhongjin@huawei.com>,
	"Nicolas Pitre" <nico@fluxnic.net>,
	"Mark Brown" <broonie@kernel.org>,
	"Luis Machado" <luis.machado@linaro.org>,
	"Geert Uytterhoeven" <geert@linux-m68k.org>,
	"Joey Gouly" <joey.gouly@arm.com>,
	"Masahiro Yamada" <masahiroy@kernel.org>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Andrey Konovalov" <andreyknvl@gmail.com>,
	"Kefeng Wang" <wangkefeng.wang@huawei.com>,
	"Atsushi Nemoto" <anemo@mba.ocn.ne.jp>,
	"Guenter Roeck" <linux@roeck-us.net>,
	"Dave Anglin" <dave.anglin@bell.net>,
	"Alexei Starovoitov" <ast@kernel.org>,
	"Nicholas Piggin" <npiggin@gmail.com>,
	"Daniel Axtens" <dja@axtens.net>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>,
	"Jordan Niethe" <jniethe5@gmail.com>,
	"Guo Ren" <guoren@kernel.org>, "Anup Patel" <anup@brainfault.org>,
	"Atish Patra" <atishp@atishpatra.org>,
	"Changbin Du" <changbin.du@intel.com>,
	"Heiko Stuebner" <heiko@sntech.de>,
	"Liao Chang" <liaochang1@huawei.com>,
	"Philipp Tomsich" <philipp.tomsich@vrull.eu>,
	"Wu Caize" <zepan@sipeed.com>,
	"Emil Renner Berthing" <kernel@esmil.dk>,
	"Alexander Egorenkov" <egorenar@linux.ibm.com>,
	"Thomas Richter" <tmricht@linux.ibm.com>,
	"Tobias Huschle" <huschle@linux.ibm.com>,
	"Ilya Leoshkevich" <iii@linux.ibm.com>,
	"Tom Lendacky" <thomas.lendacky@amd.com>,
	"Daniel Bristot de Oliveira" <bristot@redhat.com>,
	"Michael Roth" <michael.roth@amd.com>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	"Javier Martinez Canillas" <javierm@redhat.com>,
	"Miroslav Benes" <mbenes@suse.cz>,
	"André Almeida" <andrealmeid@igalia.com>,
	"Tiezhu Yang" <yangtiezhu@loongson.cn>,
	"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
	"Aaron Tomlin" <atomlin@redhat.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-mips@vger.kernel.org" <linux-mips@vger.kernel.org>,
	"linux-parisc@vger.kernel.org" <linux-parisc@vger.kernel.org>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"linux-riscv@lists.infradead.org"
	<linux-riscv@lists.infradead.org>,
	"linux-s390@vger.kernel.org" <linux-s390@vger.kernel.org>,
	"sparclinux@vger.kernel.org" <sparclinux@vger.kernel.org>,
	"linux-modules@vger.kernel.org" <linux-modules@vger.kernel.org>
Subject: Re: [PATCH] kprobes: Enable tracing for mololithic kernel images
Date: Thu, 16 Jun 2022 00:24:04 +0300	[thread overview]
Message-ID: <YqpN9NAkAKhgiunQ@iki.fi> (raw)
In-Reply-To: <144b7e90-5d75-7e2c-4e54-8a73f914dfdf@csgroup.eu>

On Tue, Jun 14, 2022 at 12:36:25PM +0000, Christophe Leroy wrote:
> 
> 
> Le 14/06/2022 à 14:26, Jarkko Sakkinen a écrit :
> > On Thu, Jun 09, 2022 at 06:44:45AM -0700, Luis Chamberlain wrote:
> >> On Thu, Jun 09, 2022 at 08:47:38AM +0100, Russell King (Oracle) wrote:
> >>> On Wed, Jun 08, 2022 at 02:59:27AM +0300, Jarkko Sakkinen wrote:
> >>>> diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
> >>>> index 553866751e1a..d2bb954cd54f 100644
> >>>> --- a/arch/arm/kernel/Makefile
> >>>> +++ b/arch/arm/kernel/Makefile
> >>>> @@ -44,6 +44,11 @@ obj-$(CONFIG_CPU_IDLE)		+= cpuidle.o
> >>>>   obj-$(CONFIG_ISA_DMA_API)	+= dma.o
> >>>>   obj-$(CONFIG_FIQ)		+= fiq.o fiqasm.o
> >>>>   obj-$(CONFIG_MODULES)		+= armksyms.o module.o
> >>>> +ifeq ($(CONFIG_MODULES),y)
> >>>> +obj-y				+= module_alloc.o
> >>>> +else
> >>>> +obj-$(CONFIG_KPROBES)		+= module_alloc.o
> >>>> +endif
> >>>
> >>> Doesn't:
> >>>
> >>> obj-$(CONFIG_MODULES)		+= module_alloc.o
> >>> obj-$(CONFIG_KPROBES)		+= module_alloc.o
> >>
> >> That just begs for a new kconfig symbol for the object, and for
> >> the object then to be built with it.
> >>
> >> The archs which override the default can use ARCH_HAS_VM_ALLOC_EXEC.
> >> Please note that the respective free is important as well and its
> >> not clear if we need an another define for the free. Someone has
> >> to do that work. We want to ensure to noexec the code on free and
> >> this can vary on each arch.
> > 
> > Let me check if I understand this (not 100% sure).
> > 
> > So if arch define ARCH_HAS_VMALLOC_EXEC, then this would set
> > config flag CONFIG_VMALLOC_EXEC, which would be used to include
> > the compilation unit?
> > 
> 
> I guess you have two possible approaches.
> 
> Either architectures select CONFIG_ARCH_HAS_VMALLOC_EXEC at all time and 
> then you add a CONFIG_VMALLOC_EXEC which depends on 
> CONFIG_ARCH_HAS_VMALLOC_EXEC and CONFIG_MODULES or CONFIG_KPROBES,
> 
> Or architectures select CONFIG_ARCH_HAS_VMALLOC_EXEC only when either 
> CONFIG_MODULES or CONFIG_KPROBES is selected, in that case there is no 
> need for a CONFIG_VMALLOC_EXEC.

Right, got it now. Thanks for the elaboration.

> Christophe

BR, Jarkko

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

WARNING: multiple messages have this Message-ID (diff)
From: Jarkko Sakkinen <jarkko@kernel.org>
To: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: "Dan Li" <ashimida@linux.alibaba.com>,
	"Heiko Stuebner" <heiko@sntech.de>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Paul Mackerras" <paulus@samba.org>,
	"Alexander Gordeev" <agordeev@linux.ibm.com>,
	"Javier Martinez Canillas" <javierm@redhat.com>,
	"Christoph Hellwig" <hch@infradead.org>,
	"Geert Uytterhoeven" <geert@linux-m68k.org>,
	"Catalin Marinas" <catalin.marinas@arm.com>,
	"Christian Borntraeger" <borntraeger@linux.ibm.com>,
	"Guenter Roeck" <linux@roeck-us.net>,
	"André Almeida" <andrealmeid@igalia.com>,
	"Michael Roth" <michael.roth@amd.com>,
	"Nicholas Piggin" <npiggin@gmail.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Andrey Konovalov" <andreyknvl@gmail.com>,
	"Nick Desaulniers" <ndesaulniers@google.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Luis Chamberlain" <mcgrof@kernel.org>,
	"Masami Hiramatsu" <mhiramat@kernel.org>,
	"Wu Caize" <zepan@sipeed.com>, "Guo Ren" <guoren@kernel.org>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Luis Mac hado" <luis.machado@linaro.org>,
	"Atsushi Nemoto" <anemo@mba.ocn.ne.jp>,
	"Dave Hansen" <dave.hansen@linux.intel.com>,
	"Joey Gouly" <joey.gouly@arm.com>,
	"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
	"Song Liu" <song@kernel.org>,
	"linux-s390@vger.kernel.org" <linux-s390@vger.kernel.org>,
	"Ilya Leoshkevich" <iii@linux.ibm.com>,
	"Anup Patel" <anup@brainfault.org>,
	"Helge Deller" <deller@gmx.de>,
	"Anil S Keshavamurthy" <anil.s.keshavamurthy@intel.com>,
	"Sven Schnelle" <svens@linux.ibm.com>,
	"Tom Lendacky" <thomas.lendacky@amd.com>,
	"Vasily Gorbik" <gor@linux.ibm.com>,
	"Philipp Tomsich" <philipp.tomsich@vrull.eu>,
	"Dave Anglin" <dave.anglin@bell.net>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"Daniel Axtens" <dja@axtens.net>,
	"Nicolas Pitre" <nico@fluxnic.net>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>,
	"Edgecombe, Rick P" <rick.p.edgecombe@intel.com>,
	"Daniel Bristot de Oliveira" <bristot@redhat.com>,
	"Kefeng Wang" <wangkefeng.wang@huawei.com>
Subject: Re: [PATCH] kprobes: Enable tracing for mololithic kernel images
Date: Thu, 16 Jun 2022 00:24:04 +0300	[thread overview]
Message-ID: <YqpN9NAkAKhgiunQ@iki.fi> (raw)
In-Reply-To: <144b7e90-5d75-7e2c-4e54-8a73f914dfdf@csgroup.eu>

rnel@esmil.dk>, Jordan Niethe <jniethe5@gmail.com>, Atish Patra <atishp@atishpatra.org>, Alexei Starovoitov <ast@kernel.org>, Will Deacon <will@kernel.org>, Masahiro Yamada <masahiroy@kernel.org>, Jarkko Sakkinen <jarkko@profian.com>, Sami Tolvanen <samitolvanen@google.com>, "Naveen N. Rao" <naveen.n.rao@linux.ibm.com>, Marco Elver <elver@google.com>, Kees Cook <keescook@chromium.org>, Steven Rostedt <rostedt@goodmis.org>, Nathan Chancellor <nathan@kernel.org>, Mark Brown <broonie@kernel.org>, Borislav Petkov <bp@alien8.de>, Alexander Egorenkov <egorenar@linux.ibm.com>, Thomas Bogendoerfer <tsbogend@alpha.franken.de>, "linux-parisc@vger.kernel.org" <linux-parisc@vger.kernel.org>, Nathaniel McCallum <nathaniel@profian.com>, Dmitry Torokhov <dmitry.torokhov@gmail.com>, "David S. Miller" <davem@davemloft.net>, "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>, Tobias Huschle <huschle@linux.ibm.com>, "Peter Zijlstra \(Intel\)" <peterz@infradead.org>, "H. Peter Anvin" <hpa@zytor.com>
 , "sparclinux@vger.kernel.org" <sparclinux@vger.kernel.org>, Tiezhu Yang <yangtiezhu@loongson.cn>, Miroslav Benes <mbenes@suse.cz>, Chen Zhongjin <chenzhongjin@huawei.com>, Ard Biesheuvel <ardb@kernel.org>, "x86@kernel.org" <x86@kernel.org>, "Russell King \(Oracle\)" <linux@armlinux.org.uk>, "linux-riscv@lists.infradead.org" <linux-riscv@lists.infradead.org>, Ingo Molnar <mingo@redhat.com>, Aaron Tomlin <atomlin@redhat.com>, Albert Ou <aou@eecs.berkeley.edu>, Heiko Carstens <hca@linux.ibm.com>, Liao Chang <liaochang1@huawei.com>, Paul Walmsley <paul.walmsley@sifive.com>, Josh Poimboeuf <jpoimboe@kernel.org>, Thomas Richter <tmricht@linux.ibm.com>, "linux-mips@vger.kernel.org" <linux-mips@vger.kernel.org>, Changbin Du <changbin.du@intel.com>, Palmer Dabbelt <palmer@dabbelt.com>, "linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>, "linux-modules@vger.kernel.org" <linux-modules@vger.kernel.org>
Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org
Sender: "Linuxppc-dev" <linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org>

On Tue, Jun 14, 2022 at 12:36:25PM +0000, Christophe Leroy wrote:
> 
> 
> Le 14/06/2022 à 14:26, Jarkko Sakkinen a écrit :
> > On Thu, Jun 09, 2022 at 06:44:45AM -0700, Luis Chamberlain wrote:
> >> On Thu, Jun 09, 2022 at 08:47:38AM +0100, Russell King (Oracle) wrote:
> >>> On Wed, Jun 08, 2022 at 02:59:27AM +0300, Jarkko Sakkinen wrote:
> >>>> diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
> >>>> index 553866751e1a..d2bb954cd54f 100644
> >>>> --- a/arch/arm/kernel/Makefile
> >>>> +++ b/arch/arm/kernel/Makefile
> >>>> @@ -44,6 +44,11 @@ obj-$(CONFIG_CPU_IDLE)		+= cpuidle.o
> >>>>   obj-$(CONFIG_ISA_DMA_API)	+= dma.o
> >>>>   obj-$(CONFIG_FIQ)		+= fiq.o fiqasm.o
> >>>>   obj-$(CONFIG_MODULES)		+= armksyms.o module.o
> >>>> +ifeq ($(CONFIG_MODULES),y)
> >>>> +obj-y				+= module_alloc.o
> >>>> +else
> >>>> +obj-$(CONFIG_KPROBES)		+= module_alloc.o
> >>>> +endif
> >>>
> >>> Doesn't:
> >>>
> >>> obj-$(CONFIG_MODULES)		+= module_alloc.o
> >>> obj-$(CONFIG_KPROBES)		+= module_alloc.o
> >>
> >> That just begs for a new kconfig symbol for the object, and for
> >> the object then to be built with it.
> >>
> >> The archs which override the default can use ARCH_HAS_VM_ALLOC_EXEC.
> >> Please note that the respective free is important as well and its
> >> not clear if we need an another define for the free. Someone has
> >> to do that work. We want to ensure to noexec the code on free and
> >> this can vary on each arch.
> > 
> > Let me check if I understand this (not 100% sure).
> > 
> > So if arch define ARCH_HAS_VMALLOC_EXEC, then this would set
> > config flag CONFIG_VMALLOC_EXEC, which would be used to include
> > the compilation unit?
> > 
> 
> I guess you have two possible approaches.
> 
> Either architectures select CONFIG_ARCH_HAS_VMALLOC_EXEC at all time and 
> then you add a CONFIG_VMALLOC_EXEC which depends on 
> CONFIG_ARCH_HAS_VMALLOC_EXEC and CONFIG_MODULES or CONFIG_KPROBES,
> 
> Or architectures select CONFIG_ARCH_HAS_VMALLOC_EXEC only when either 
> CONFIG_MODULES or CONFIG_KPROBES is selected, in that case there is no 
> need for a CONFIG_VMALLOC_EXEC.

Right, got it now. Thanks for the elaboration.

> Christophe

BR, Jarkko

  reply	other threads:[~2022-06-15 21:26 UTC|newest]

Thread overview: 105+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-07 23:59 [PATCH] kprobes: Enable tracing for mololithic kernel images Jarkko Sakkinen
2022-06-07 23:59 ` Jarkko Sakkinen
2022-06-07 23:59 ` Jarkko Sakkinen
2022-06-08  2:35 ` Guo Ren
2022-06-08  2:35   ` Guo Ren
2022-06-08  2:35   ` Guo Ren
2022-06-08  5:25   ` Jarkko Sakkinen
2022-06-08  5:25     ` Jarkko Sakkinen
2022-06-08  5:25     ` Jarkko Sakkinen
2022-06-08 14:21     ` Masami Hiramatsu
2022-06-08 14:21       ` Masami Hiramatsu
2022-06-08 14:21       ` Masami Hiramatsu
2022-06-08 16:12       ` Song Liu
2022-06-08 16:12         ` Song Liu
2022-06-08 16:12         ` Song Liu
2022-06-08 18:20         ` Song Liu
2022-06-08 18:20           ` Song Liu
2022-06-08 18:20           ` Song Liu
2022-06-08 20:26           ` Luis Chamberlain
2022-06-08 20:26             ` Luis Chamberlain
2022-06-08 20:26             ` Luis Chamberlain
2022-06-09  3:48             ` Christoph Hellwig
2022-06-09  3:48               ` Christoph Hellwig
2022-06-09  3:48               ` Christoph Hellwig
2022-06-09 13:24               ` Luis Chamberlain
2022-06-09 13:24                 ` Luis Chamberlain
2022-06-09 13:24                 ` Luis Chamberlain
2022-06-09 18:41                 ` Edgecombe, Rick P
2022-06-09 18:41                   ` Edgecombe, Rick P
2022-06-09 18:41                   ` Edgecombe, Rick P
2022-06-09 22:48                   ` Song Liu
2022-06-09 22:48                     ` Song Liu
2022-06-09 22:48                     ` Song Liu
2022-06-14 12:32                   ` jarkko
2022-06-14 12:32                     ` jarkko
2022-06-14 12:32                     ` jarkko
2022-06-15  6:37                     ` hch
2022-06-15  6:37                       ` hch
2022-06-15  6:37                       ` hch
2022-06-15 21:29                       ` jarkko
2022-06-15 21:29                         ` jarkko
2022-06-15 21:29                         ` jarkko
2022-06-09  8:33         ` Christophe Leroy
2022-06-09  8:33           ` Christophe Leroy
2022-06-09 22:23           ` Song Liu
2022-06-09 22:23             ` Song Liu
2022-06-09 22:23             ` Song Liu
2022-06-09 13:12         ` Jarkko Sakkinen
2022-06-09 13:12           ` Jarkko Sakkinen
2022-06-09 13:12           ` Jarkko Sakkinen
2022-06-09 13:23           ` Ard Biesheuvel
2022-06-09 13:23             ` Ard Biesheuvel
2022-06-09 13:23             ` Ard Biesheuvel
2022-06-12 12:18             ` Masami Hiramatsu
2022-06-12 12:18               ` Masami Hiramatsu
2022-06-12 12:18               ` Masami Hiramatsu
2022-06-12 15:59               ` Christophe Leroy
2022-06-12 15:59                 ` Christophe Leroy
2022-06-13  0:01                 ` Masami Hiramatsu
2022-06-13  0:01                   ` Masami Hiramatsu
2022-06-14 10:54             ` Jarkko Sakkinen
2022-06-14 10:54               ` Jarkko Sakkinen
2022-06-14 10:54               ` Jarkko Sakkinen
2022-06-09 12:59       ` Jarkko Sakkinen
2022-06-09 12:59         ` Jarkko Sakkinen
2022-06-09 12:59         ` Jarkko Sakkinen
2022-06-08 16:27 ` Ard Biesheuvel
2022-06-08 16:27   ` Ard Biesheuvel
2022-06-08 16:27   ` Ard Biesheuvel
2022-06-08 18:19   ` Song Liu
2022-06-08 18:19     ` Song Liu
2022-06-08 18:19     ` Song Liu
2022-06-12 12:30     ` Masami Hiramatsu
2022-06-12 12:30       ` Masami Hiramatsu
2022-06-12 12:30       ` Masami Hiramatsu
2022-06-14 12:30       ` Jarkko Sakkinen
2022-06-14 12:30         ` Jarkko Sakkinen
2022-06-14 12:30         ` Jarkko Sakkinen
2022-06-09  5:37   ` Jarkko Sakkinen
2022-06-09  5:37     ` Jarkko Sakkinen
2022-06-09  5:37     ` Jarkko Sakkinen
2022-06-09  7:47 ` Russell King (Oracle)
2022-06-09  7:47   ` Russell King (Oracle)
2022-06-09  7:47   ` Russell King (Oracle)
2022-06-09 11:48   ` Jarkko Sakkinen
2022-06-09 11:48     ` Jarkko Sakkinen
2022-06-09 11:48     ` Jarkko Sakkinen
2022-06-09 13:44   ` Luis Chamberlain
2022-06-09 13:44     ` Luis Chamberlain
2022-06-09 13:44     ` Luis Chamberlain
2022-06-14 12:26     ` Jarkko Sakkinen
2022-06-14 12:26       ` Jarkko Sakkinen
2022-06-14 12:26       ` Jarkko Sakkinen
2022-06-14 12:36       ` Christophe Leroy
2022-06-14 12:36         ` Christophe Leroy
2022-06-15 21:24         ` Jarkko Sakkinen [this message]
2022-06-15 21:24           ` Jarkko Sakkinen
2022-06-15 21:24           ` Jarkko Sakkinen
2022-06-09  8:30 ` Christophe Leroy
2022-06-09  8:30   ` Christophe Leroy
2022-06-09 12:57   ` Jarkko Sakkinen
2022-06-09 12:57     ` Jarkko Sakkinen
2022-06-09 12:57     ` Jarkko Sakkinen
2022-06-09 13:42     ` Christophe Leroy
2022-06-09 13:42       ` Christophe Leroy

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=YqpN9NAkAKhgiunQ@iki.fi \
    --to=jarkko@kernel.org \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=agordeev@linux.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=andrealmeid@igalia.com \
    --cc=andreyknvl@gmail.com \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=anemo@mba.ocn.ne.jp \
    --cc=anil.s.keshavamurthy@intel.com \
    --cc=anup@brainfault.org \
    --cc=aou@eecs.berkeley.edu \
    --cc=ardb@kernel.org \
    --cc=ashimida@linux.alibaba.com \
    --cc=ast@kernel.org \
    --cc=atishp@atishpatra.org \
    --cc=atomlin@redhat.com \
    --cc=benh@kernel.crashing.org \
    --cc=borntraeger@linux.ibm.com \
    --cc=bp@alien8.de \
    --cc=bristot@redhat.com \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=changbin.du@intel.com \
    --cc=chenzhongjin@huawei.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=dave.anglin@bell.net \
    --cc=dave.hansen@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=deller@gmx.de \
    --cc=dja@axtens.net \
    --cc=dmitry.torokhov@gmail.com \
    --cc=ebiederm@xmission.com \
    --cc=egorenar@linux.ibm.com \
    --cc=elver@google.com \
    --cc=geert@linux-m68k.org \
    --cc=gor@linux.ibm.com \
    --cc=guoren@kernel.org \
    --cc=hca@linux.ibm.com \
    --cc=hch@infradead.org \
    --cc=heiko@sntech.de \
    --cc=hpa@zytor.com \
    --cc=huschle@linux.ibm.com \
    --cc=iii@linux.ibm.com \
    --cc=jarkko@profian.com \
    --cc=javierm@redhat.com \
    --cc=jniethe5@gmail.com \
    --cc=joey.gouly@arm.com \
    --cc=jpoimboe@kernel.org \
    --cc=keescook@chromium.org \
    --cc=kernel@esmil.dk \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=liaochang1@huawei.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=linux@roeck-us.net \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=luis.machado@linaro.org \
    --cc=mark.rutland@arm.com \
    --cc=masahiroy@kernel.org \
    --cc=mbenes@suse.cz \
    --cc=mcgrof@kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=michael.roth@amd.com \
    --cc=mingo@redhat.com \
    --cc=mpe@ellerman.id.au \
    --cc=nathan@kernel.org \
    --cc=nathaniel@profian.com \
    --cc=naveen.n.rao@linux.ibm.com \
    --cc=ndesaulniers@google.com \
    --cc=nico@fluxnic.net \
    --cc=npiggin@gmail.com \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=philipp.tomsich@vrull.eu \
    --cc=rick.p.edgecombe@intel.com \
    --cc=rostedt@goodmis.org \
    --cc=samitolvanen@google.com \
    --cc=song@kernel.org \
    --cc=sparclinux@vger.kernel.org \
    --cc=svens@linux.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --cc=tmricht@linux.ibm.com \
    --cc=tsbogend@alpha.franken.de \
    --cc=wangkefeng.wang@huawei.com \
    --cc=will@kernel.org \
    --cc=x86@kernel.org \
    --cc=yangtiezhu@loongson.cn \
    --cc=zepan@sipeed.com \
    /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.