Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp435643iol; Thu, 9 Jun 2022 06:50:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFjZpmXbbmPdBYZQeh8Bqn3fIbnrPJydka1iEZp3NQhxGTzZ2ZA92F/Nq/7x+OGvWBhdKZ X-Received: by 2002:a63:83c2:0:b0:3fe:4da6:d32f with SMTP id h185-20020a6383c2000000b003fe4da6d32fmr4904021pge.387.1654782642922; Thu, 09 Jun 2022 06:50:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654782642; cv=none; d=google.com; s=arc-20160816; b=Bm5myFRXbqDS66KC9OGkotsqfuVlHHwX67th8Jm3QEfnT5aQpIq3dsoVRxU/8skOhK lqzdXTPbgUUmX/NZJuDPhpwC+vHjCJOb0Bq+5q7gmJgj/YAAFQjsojI4caYMNpVr7Gbn +tlNJpWAP2gcsc1L1Hv0+dkEWZBbRRfqorEC3N2rcMz6Ob1lvk/BZ31IeElZdql2Szd3 h2Dz5f9/XtPf6ijOo2BGfZhJcryLloEU8MDUByDNdW0Z1RpiwrhB2RMIHOjdnL/Qd5+B Ni/56xAhu1LoxybzlKdw5FxhCiRr7X9kGgAOnFdlWtBCqT31rn0Sm1ktz0ewuPb0JgBb GjmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=NHIPvBaPp5ezFE0h6AYG9aEftcsm+tTZkR/4v4e/RO8=; b=oo5VPrnaCCn90D899d+k1yh97rqr8n8hSJHZS5jVvAeiUBQMRXPzs/xJWRJfciTEZ8 woU5Ubam3dRettHDPkaeD5STjUQJMTdMK/tFDTnvkFwxJbNCLJt/lHaKzn3JgjE/Mbnx ikNrOIkYfU40HVok0ITq5ArcmYLfcwj8b8Qf7NG1a1Gy6i9A184y4RUT7LdBREosEW51 uzDWcbu9MP/BnxWOP6ef3ynN3Fd38oBL7pRmORKjKHJGpc6k3CiwsofDvKWKBK2VfkgS ihBEqV6eaR8lB/7U9Hpay/PPOHCfylVHuaeIMUIduZlvQX3f67qDHqczyo1PCJO7tkcF iEiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=ZkTA3OQR; 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 j186-20020a638bc3000000b003fb882c85fasi25123569pge.64.2022.06.09.06.50.28; Thu, 09 Jun 2022 06:50:42 -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=@infradead.org header.s=bombadil.20210309 header.b=ZkTA3OQR; 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 S243540AbiFINo7 (ORCPT + 99 others); Thu, 9 Jun 2022 09:44:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235379AbiFINo5 (ORCPT ); Thu, 9 Jun 2022 09:44:57 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37DF21A07A; Thu, 9 Jun 2022 06:44:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=NHIPvBaPp5ezFE0h6AYG9aEftcsm+tTZkR/4v4e/RO8=; b=ZkTA3OQR9tQAPfsN8i3VT0+tcQ VkNiVG4DvxfE7u93S0pqGwdWhkGV1NcSm080rrE6ZN6PZmE/7MFiC0p5O9k7EowRl1BGbyDIZ+diS F67SHfIxA8A3HlLNF161DlTI7MBt5iWAICHfCzPAzIbG6AP+mVcrMDj+Im//qlKEsfJfMnBJJw/45 OjKfECOlFuzeBrcqR7UfXnNNFMXEyuIFinDBu5p08c3Ss/zhmk6MA3OiEBmqbxjLL6u6EgrsmqZ4L XnIHH4EiskReSnyaDTw0LFwUML/2XUIT+CdASkQ7cnHXlptF3Y20dvcpLoetViskFTqFGvKcey9zH sQ8iTAFg==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nzISr-002FYc-3e; Thu, 09 Jun 2022 13:44:45 +0000 Date: Thu, 9 Jun 2022 06:44:45 -0700 From: Luis Chamberlain To: "Russell King (Oracle)" , "Edgecombe, Rick P" , Christoph Hellwig Cc: Jarkko Sakkinen , linux-kernel@vger.kernel.org, Nathaniel McCallum , Jarkko Sakkinen , 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 , Christophe Leroy , 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Luis Chamberlain X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=no 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 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. > work just as well? The kbuild modules.rst documentation says: > > The order of files in $(obj-y) is significant. Duplicates in > the lists are allowed: the first instance will be linked into > built-in.a and succeeding instances will be ignored. > > so you should be fine... or the documentation is wrong! Agreed, but this is just sloppy, better to use a new kconfig symbol to represent what is actually being required. Luis