[<prev] [next>] [day] [month] [year] [list]
Message-ID: <YqpN9NAkAKhgiunQ@iki.fi>
Date: Thu, 16 Jun 2022 00:24:04 +0300
From: Jarkko Sakkinen <jarkko@...nel.org>
To: Christophe Leroy <christophe.leroy@...roup.eu>
Cc: Luis Chamberlain <mcgrof@...nel.org>,
"Russell King (Oracle)" <linux@...linux.org.uk>,
"Edgecombe, Rick P" <rick.p.edgecombe@...el.com>,
Christoph Hellwig <hch@...radead.org>,
Jarkko Sakkinen <jarkko@...fian.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Nathaniel McCallum <nathaniel@...fian.com>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
"James E.J. Bottomley" <James.Bottomley@...senpartnership.com>,
Helge Deller <deller@....de>,
Michael Ellerman <mpe@...erman.id.au>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
Paul Walmsley <paul.walmsley@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>,
Heiko Carstens <hca@...ux.ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>,
Alexander Gordeev <agordeev@...ux.ibm.com>,
Christian Borntraeger <borntraeger@...ux.ibm.com>,
Sven Schnelle <svens@...ux.ibm.com>,
"David S. Miller" <davem@...emloft.net>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"x86@...nel.org" <x86@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>,
"Naveen N. Rao" <naveen.n.rao@...ux.ibm.com>,
Anil S Keshavamurthy <anil.s.keshavamurthy@...el.com>,
Masami Hiramatsu <mhiramat@...nel.org>,
Steven Rostedt <rostedt@...dmis.org>,
Kees Cook <keescook@...omium.org>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
Nathan Chancellor <nathan@...nel.org>,
Josh Poimboeuf <jpoimboe@...nel.org>,
Mark Rutland <mark.rutland@....com>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Marco Elver <elver@...gle.com>,
Dan Li <ashimida@...ux.alibaba.com>,
Sami Tolvanen <samitolvanen@...gle.com>,
Song Liu <song@...nel.org>, Ard Biesheuvel <ardb@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Linus Walleij <linus.walleij@...aro.org>,
Chen Zhongjin <chenzhongjin@...wei.com>,
Nicolas Pitre <nico@...xnic.net>,
Mark Brown <broonie@...nel.org>,
Luis Machado <luis.machado@...aro.org>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Joey Gouly <joey.gouly@....com>,
Masahiro Yamada <masahiroy@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Andrey Konovalov <andreyknvl@...il.com>,
Kefeng Wang <wangkefeng.wang@...wei.com>,
Atsushi Nemoto <anemo@....ocn.ne.jp>,
Guenter Roeck <linux@...ck-us.net>,
Dave Anglin <dave.anglin@...l.net>,
Alexei Starovoitov <ast@...nel.org>,
Nicholas Piggin <npiggin@...il.com>,
Daniel Axtens <dja@...ens.net>,
"Aneesh Kumar K.V" <aneesh.kumar@...ux.ibm.com>,
Jordan Niethe <jniethe5@...il.com>,
Guo Ren <guoren@...nel.org>, Anup Patel <anup@...infault.org>,
Atish Patra <atishp@...shpatra.org>,
Changbin Du <changbin.du@...el.com>,
Heiko Stuebner <heiko@...ech.de>,
Liao Chang <liaochang1@...wei.com>,
Philipp Tomsich <philipp.tomsich@...ll.eu>,
Wu Caize <zepan@...eed.com>,
Emil Renner Berthing <kernel@...il.dk>,
Alexander Egorenkov <egorenar@...ux.ibm.com>,
Thomas Richter <tmricht@...ux.ibm.com>,
Tobias Huschle <huschle@...ux.ibm.com>,
Ilya Leoshkevich <iii@...ux.ibm.com>,
Tom Lendacky <thomas.lendacky@....com>,
Daniel Bristot de Oliveira <bristot@...hat.com>,
Michael Roth <michael.roth@....com>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Javier Martinez Canillas <javierm@...hat.com>,
Miroslav Benes <mbenes@...e.cz>,
André Almeida <andrealmeid@...lia.com>,
Tiezhu Yang <yangtiezhu@...ngson.cn>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Aaron Tomlin <atomlin@...hat.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-mips@...r.kernel.org" <linux-mips@...r.kernel.org>,
"linux-parisc@...r.kernel.org" <linux-parisc@...r.kernel.org>,
"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
"linux-riscv@...ts.infradead.org" <linux-riscv@...ts.infradead.org>,
"linux-s390@...r.kernel.org" <linux-s390@...r.kernel.org>,
"sparclinux@...r.kernel.org" <sparclinux@...r.kernel.org>,
"linux-modules@...r.kernel.org" <linux-modules@...r.kernel.org>
Subject: Re: [PATCH] kprobes: Enable tracing for mololithic kernel images
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
Powered by blists - more mailing lists