Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp897822iog; Wed, 15 Jun 2022 15:06:42 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sTcat35fn6MWzqTi5yNIFM4jLJkLZBA6pvkiwi9gebDoSagfCfKASenxPqs6obsSdY+zGS X-Received: by 2002:a17:903:1208:b0:168:e42f:acf9 with SMTP id l8-20020a170903120800b00168e42facf9mr1723748plh.165.1655330802004; Wed, 15 Jun 2022 15:06:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655330801; cv=none; d=google.com; s=arc-20160816; b=OnhWD2K7a/2fB5rDWXr8VNSMgbnzZVEqKg8pX321pzYWH+mEyvxXMCwSYLw+2liCvx IjUUAcVJOL5dHcYJzF/AfVucWFxnuENH86YXSE04+0sn8FntF6l/80+GyjcBbUyT1LDg 6r68pGrz0Ci0gG+TN7B7PWUW9JwvpIiuQNdiCs/U3HPbxLbQWZVrMXl1wrRK8mxEqkG8 vUaPue6pmp58wVGKX9K21Zk8LA2OQfF30fH9Hg+3kDVSAUvkt0WfAjru3CC/DRgXk9Sk iFRDbIIm2AzM3l5C73NyAtGUiwfGi7LxyHeBAKuVzlZdDJELbhCPgap9VBLPTSOcQiyi HfWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=XA/zbhzD1vatTN07ChE3tvKTZAew60QT1M+TM1JEU6U=; b=jqUtcmQGq1NfTUvAUpsydtMsuDFnSl4DKKj7fcc42yEX0qkOS65qyYaBjfSb6xBP2i 6uOmoDKPbJC/xmCEs+sEKS1Gul7kswm7MGHWk9zHhuQMXSF4FEXo4tAey7zL/9bAqffZ iwu3bw1ClnNG4PDL5PKal/2Wr5gvnWNv2HMpFxmDhHO/NbiZj82sh+58aXcYtZGBA+NM 94h50RsXa0Nwve54gVEorVezbUwzCNoPHN4xsQXwB5VHqVar9avllgQuFUuqDhceCfcX HPqyn94nNVnzzu/NrcpjSDxYeam1hXhs35t7Z9EIdaRTGGTbOdKeBngiN0fDgI20rCIJ hY0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rcYBdB9v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s12-20020a632c0c000000b003fe0466ea39si138721pgs.868.2022.06.15.15.06.16; Wed, 15 Jun 2022 15:06:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rcYBdB9v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349490AbiFOV0S (ORCPT + 99 others); Wed, 15 Jun 2022 17:26:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346775AbiFOV0P (ORCPT ); Wed, 15 Jun 2022 17:26:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 856445621C; Wed, 15 Jun 2022 14:26:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2155361778; Wed, 15 Jun 2022 21:26:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E0651C3411A; Wed, 15 Jun 2022 21:26:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655328373; bh=C7SBMi7ghKBLQo7MHmIHsy7eWtSdXq8eTAqAwVvVPfw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rcYBdB9v2iJolM6fd27OAYzgDAh4Cy36Z7LWBpda/a/SgPCwn9xHu/xsTl0o0PoAY SDWwvGa6oWW820UDU6Jc02SuNLbRnkJFOQVwHgARir+e+zZY2YYmSygPZks1a6y3Ds URcIAW8dSzvf2PvwOefgZcSyVjUseugdFY03G/WaZrjHpsue9BMdMgV/6QSVfrrb8T HBYs8Z1/kOPfZU6aIUJtdFd1gH4nSJbil/mnEhsnjRnWKGFlJqJnnCZ5QjEvuHpB9f WFwZw2bJeWIQ2/RB+5zvSIptEsCuVnGlMNxUSbksXDmUo/nUflwAwou4zwqCvuobWa 8/YxoqDiXQD1Q== Date: Thu, 16 Jun 2022 00:24:04 +0300 From: Jarkko Sakkinen To: Christophe Leroy Cc: Luis Chamberlain , "Russell King (Oracle)" , "Edgecombe, Rick P" , Christoph Hellwig , Jarkko Sakkinen , "linux-kernel@vger.kernel.org" , Nathaniel McCallum , Catalin Marinas , Will Deacon , Thomas Bogendoerfer , "James E.J. Bottomley" , Helge Deller , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Paul Walmsley , Palmer Dabbelt , Albert Ou , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , "David S. Miller" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "x86@kernel.org" , "H. Peter Anvin" , "Naveen N. Rao" , Anil S Keshavamurthy , Masami Hiramatsu , Steven Rostedt , Kees Cook , "Peter Zijlstra (Intel)" , Nathan Chancellor , Josh Poimboeuf , Mark Rutland , "Eric W. Biederman" , Marco Elver , Dan Li , Sami Tolvanen , Song Liu , Ard Biesheuvel , Nick Desaulniers , Linus Walleij , Chen Zhongjin , Nicolas Pitre , Mark Brown , Luis Machado , Geert Uytterhoeven , Joey Gouly , Masahiro Yamada , Andrew Morton , Andrey Konovalov , Kefeng Wang , Atsushi Nemoto , Guenter Roeck , Dave Anglin , Alexei Starovoitov , Nicholas Piggin , Daniel Axtens , "Aneesh Kumar K.V" , Jordan Niethe , Guo Ren , Anup Patel , Atish Patra , Changbin Du , Heiko Stuebner , Liao Chang , Philipp Tomsich , Wu Caize , Emil Renner Berthing , Alexander Egorenkov , Thomas Richter , Tobias Huschle , Ilya Leoshkevich , Tom Lendacky , Daniel Bristot de Oliveira , Michael Roth , "Kirill A. Shutemov" , Javier Martinez Canillas , Miroslav Benes , =?iso-8859-1?Q?Andr=E9?= Almeida , Tiezhu Yang , Dmitry Torokhov , Aaron Tomlin , "linux-arm-kernel@lists.infradead.org" , "linux-mips@vger.kernel.org" , "linux-parisc@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "linux-riscv@lists.infradead.org" , "linux-s390@vger.kernel.org" , "sparclinux@vger.kernel.org" , "linux-modules@vger.kernel.org" Subject: Re: [PATCH] kprobes: Enable tracing for mololithic kernel images Message-ID: References: <20220608000014.3054333-1-jarkko@profian.com> <144b7e90-5d75-7e2c-4e54-8a73f914dfdf@csgroup.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <144b7e90-5d75-7e2c-4e54-8a73f914dfdf@csgroup.eu> X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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