Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1404821iog; Tue, 14 Jun 2022 05:33:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxe5sDgOBjOUonAUi6t1We8VxmOa1/hkcrXz6thg+7KLJBM0sy7lpvhnF1rlBa3i2c1+U0 X-Received: by 2002:a17:906:216:b0:711:f623:8bb0 with SMTP id 22-20020a170906021600b00711f6238bb0mr4183541ejd.174.1655209990164; Tue, 14 Jun 2022 05:33:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655209990; cv=none; d=google.com; s=arc-20160816; b=JqNiCX/OBP6GK/FK7Fk5spyaXanSGyqSP1D7zQrgczcP5i+T8RpIGf1bn0dlMOfhF0 ujeyliLDr/eFkzU4Y2SJuqs14j0aeFmm5OiUWWrgXpYd+cgFkZiWet6hBtTAk+Gj5eMc tpbEmnyn8mTvPYKlNUzhhGxZ5iIih65+hCkt68uaUUk1ucHopwwfE6MBTc73z6SRJylI rz4vsdizRLXKpYHUgPava9/O44mtkYS6FIcZb79VE9QvwVYh7RkWjZw3Xu3le7yW1pnC eEqSldo+VRPMRqH/BP83brFmwvGPdbyZKChTWQ98l/s6r4sZvMTYtdtMQZ0vVy1iZoGS Q5Pg== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=/LwiI64ud04R9BUNM1dwUe3B/E37c25g11LMEo4ZkcI=; b=NhR0HzUrAa8IeASDk6RUAcjGr6VEocPHSxyV00bJb82ae8WwftPVMk+0Hr48pl2RQh T1u5e0cGI38FlNqNFImlC5VfgEPVSTUrzeE6roq8PrZ/RvyIVFy7OS4JkKtYYebTYOBu P8yZJgV7dLbXJShmktvo2Dm7OGLxoHRKM8QnHbxKcFr2t8DHgM+Z6pCjGO42H1o71P7S oOKE9/Sj2t0GBr7Cf+JFFC5Z9lkExvtJnwt5HFpv8OfaidTIU5X6syqQVU3KgVcNFF1w K8AcSTh2r1Z1k1quiX+nQsPtJsv0t9YUluJg8nUgjkTj626zST95zxm23Fe0Uojz+7PY opLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GmZZTh5A; 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 gz24-20020a170906f2d800b006ff16ec2fddsi9278540ejb.558.2022.06.14.05.32.38; Tue, 14 Jun 2022 05:33:10 -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=GmZZTh5A; 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 S243385AbiFNMaM (ORCPT + 99 others); Tue, 14 Jun 2022 08:30:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356489AbiFNM3L (ORCPT ); Tue, 14 Jun 2022 08:29:11 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC85937A1E; Tue, 14 Jun 2022 05:29:09 -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 ams.source.kernel.org (Postfix) with ESMTPS id AB27FB8186F; Tue, 14 Jun 2022 12:29:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD278C3411B; Tue, 14 Jun 2022 12:29:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655209746; bh=WwkV+wdhEGuk3aWMSKuKEvN2vXm13Pz6A3nxRaMWcYw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GmZZTh5AcjCClrHWs3VzPNS3NDB/fZYoF2wqNVQLdlvmWn9h0BDbVxVX3F04Uo3T8 eZyS1EnQ3QoAm3dhVIyUgjxTAre/c/32LTAFZXWs3tsKqr+GwjbmeRA9amxGaF8ufK 6OSafRU0IFiFK/L7SRc97y7385zCc3ibb6HHdRQipLSGFivEgrJ4udUTBdFWQ3oQLH 9AEopySQG40sZQUbz4wkez2DOEuhgPETohgRdoIUOq/KteuhQgDpSBf2ZK4CQUpA2z 3jydwp78L52Rsmb7dhGJLTuOBiU1Ge15Q/P7JnSLdFb3CUPVyd/Jwyi38eAm6G9BT/ bAYTFHxUI9fMQ== Date: Tue, 14 Jun 2022 15:26:59 +0300 From: Jarkko Sakkinen To: Luis Chamberlain Cc: "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 , 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: 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 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? BR, Jarkko