From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A1B2CCA47D for ; Wed, 15 Jun 2022 21:31:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349941AbiFOVba (ORCPT ); Wed, 15 Jun 2022 17:31:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239542AbiFOVb3 (ORCPT ); Wed, 15 Jun 2022 17:31:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 902744924D; Wed, 15 Jun 2022 14:31:28 -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 268F6617C1; Wed, 15 Jun 2022 21:31:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA8F8C3411A; Wed, 15 Jun 2022 21:31:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655328687; bh=h/A3iOsL+jSiXeun+GclseG7VDKI7T9E6iC83VBXQmc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jRcv7OdG8w6WZvKDmpHu4ZTNDPKNmUeNwkF/5kyOU3kogbTfbnziKBi4Jemy89mPK VB9ZLSW8Ef+8WhlhpERgKh3C4AwlLVT0YSGP+NZY7Y8aQQnRCCTfxkla/ct4P4xzOS m384ySKBIIAd638YYDqCOcxaXX3uj/4hJTyxkYvLHgkuIFRDDkI8+xZ2gKK6GJvocM p6WIsw8yQJAavGl0gEUO2R8b7panqmJ9rBrYblYA0mmSsjYt6gOUgcj3KHSNIx9Iq4 CevdQYGBbuq+VVg9ZAfGZt1g9BYutIbzx1PyMaX9HpjQg/PQYxJc+gN2u0EeJbcuw0 5w3ycwJy5spww== Date: Thu, 16 Jun 2022 00:29:18 +0300 From: "jarkko@kernel.org" To: "hch@lst.de" Cc: "Edgecombe, Rick P" , "christophe.leroy@csgroup.eu" , "mcgrof@kernel.org" , "svens@linux.ibm.com" , "palmer@dabbelt.com" , "jpoimboe@kernel.org" , "paulus@samba.org" , "zepan@sipeed.com" , "iii@linux.ibm.com" , "deller@gmx.de" , "aou@eecs.berkeley.edu" , "joey.gouly@arm.com" , "anemo@mba.ocn.ne.jp" , "egorenar@linux.ibm.com" , "ast@kernel.org" , "ardb@kernel.org" , "mpe@ellerman.id.au" , "linux-kernel@vger.kernel.org" , "linux-mips@vger.kernel.org" , "npiggin@gmail.com" , "thomas.lendacky@amd.com" , "bp@alien8.de" , "davem@davemloft.net" , "x86@kernel.org" , "luis.machado@linaro.org" , "ebiederm@xmission.com" , "mbenes@suse.cz" , "mingo@redhat.com" , "jniethe5@gmail.com" , "mark.rutland@arm.com" , "linux@armlinux.org.uk" , "paul.walmsley@sifive.com" , "andreyknvl@gmail.com" , "dja@axtens.net" , "liaochang1@huawei.com" , "linux-modules@vger.kernel.org" , "huschle@linux.ibm.com" , "will@kernel.org" , "akpm@linux-foundation.org" , "James.Bottomley@hansenpartnership.com" , "song@kernel.org" , "guoren@kernel.org" , "nathan@kernel.org" , "dave.anglin@bell.net" , "rostedt@goodmis.org" , "atomlin@redhat.com" , "bristot@redhat.com" , "naveen.n.rao@linux.ibm.com" , "anup@brainfault.org" , "javierm@redhat.com" , "linux@roeck-us.net" , "linus.walleij@linaro.org" , "philipp.tomsich@vrull.eu" , "linux-arm-kernel@lists.infradead.org" , "ndesaulniers@google.com" , "samitolvanen@google.com" , "yangtiezhu@loongson.cn" , "aneesh.kumar@linux.ibm.com" , "geert@linux-m68k.org" , "hpa@zytor.com" , "heiko@sntech.de" , "nathaniel@profian.com" , "michael.roth@amd.com" , "rmk+kernel@armlinux.org.uk" , "Sakkinen, Jarkko" , "catalin.marinas@arm.com" , "borntraeger@linux.ibm.com" , "dave.hansen@linux.intel.com" , "wangkefeng.wang@huawei.com" , "tmricht@linux.ibm.com" , "hca@linux.ibm.com" , "linux-parisc@vger.kernel.org" , "gor@linux.ibm.com" , "atishp@atishpatra.org" , "linuxppc-dev@lists.ozlabs.org" , "dmitry.torokhov@gmail.com" , "tglx@linutronix.de" , "kirill.shutemov@linux.intel.com" , "sparclinux@vger.kernel.org" , "broonie@kernel.org" , "tsbogend@alpha.franken.de" , "nico@fluxnic.net" , "masahiroy@kernel.org" , "agordeev@linux.ibm.com" , "kernel@esmil.dk" , "ashimida@linux.alibaba.com" , "elver@google.com" , "keescook@chromium.org" , "peterz@infradead.org" , "mhiramat@kernel.org" , "Keshavamurthy, Anil S" , "linux-riscv@lists.infradead.org" , "chenzhongjin@huawei.com" , "andrealmeid@igalia.com" , "changbin.du@intel.com" , "benh@kernel.crashing.org" , "linux-s390@vger.kernel.org" Subject: Re: [PATCH] kprobes: Enable tracing for mololithic kernel images Message-ID: References: <20220608232115.ccd4399f4a1d133e9b65c2a9@kernel.org> <20220609034852.GA30873@lst.de> <20220615063707.GA22930@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220615063707.GA22930@lst.de> Precedence: bulk List-ID: On Wed, Jun 15, 2022 at 08:37:07AM +0200, hch@lst.de wrote: > On Tue, Jun 14, 2022 at 03:32:38PM +0300, jarkko@kernel.org wrote: > > > Like say for a next step we moved prog pack out of bpf into core code, > > > gave it it's own copy of module_alloc(), and then made kprobes use it. > > > Then we would have something with improved W^X guard rails, and kprobes > > > would not depend on modules anymore. I think maybe it's a step in the > > > right direction, even if it's not perfect. > > > > So you're saying that I should (as a first step) basically clone > > module_alloc() implementation for kprobes, and future for BPF > > use, in order to get a clean starting point? > > I don't think cloning the code helps anyone. The fact that except > for the eBPF mess everyone uses module_alloc and the related > infrastructure is a feature and not a bug. The interface should > become better than what we have right now, but there is few enough > users that this can be done in one go. > > So assuming we really care deeply enough about fancy tracing without > modules (and I'm not sure we do, even if you don't use modules it > doesn't hurt to just build the modules code, I do that all the time > for my test machines), the general approach in your series is the > right one. OK, thanks for the elaboration! However I bake it, I doubt that next version is going to be the final version, given all the angles. Therefore, I mostly Christophe's suggestions on compilation flags, and also split this into per-arch patches. That should be at least to the right direction. BR, Jarkko From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BA96CC433EF for ; Wed, 15 Jun 2022 21:31:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+W9qgB7VZ/XZTVOBpDpeM4z+GiszRk0ypS673KF6q+c=; b=TWVuBOvvPFaqJl XX/k3+AfPVsc2aRQNkZqGnP/etl/eZeQjHje/ywfPCFF+CBDdoL4z1qajwX8o5utYR6caBzS6S6zn tCTL7ApzOdFUa9/WOwYrox97O0YmmBREI8nzS/NavKCF/HQMHrcozYbatDBENyqAPbgAazRgtdbcS sex2uSgyM5PJpBj0W9ziYShzaUiUW0Ay+jwqE3YxmI4rOmYT/wIXojep0tGfAR6PF5JI5SgsIDRDK 4TMEfD3DOyVtfmmEOSZ9lO5cmINzj1H559JxvjvQqOcUGzWwiIObHQbHihU0a0MTfswI8JklBMsQd Ds27EPNgdXaCBcGZaa2g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1abt-00GSYu-OB; Wed, 15 Jun 2022 21:31:33 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1abo-00GSW5-Ju; Wed, 15 Jun 2022 21:31:30 +0000 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 206FF617C0; Wed, 15 Jun 2022 21:31:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA8F8C3411A; Wed, 15 Jun 2022 21:31:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655328687; bh=h/A3iOsL+jSiXeun+GclseG7VDKI7T9E6iC83VBXQmc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jRcv7OdG8w6WZvKDmpHu4ZTNDPKNmUeNwkF/5kyOU3kogbTfbnziKBi4Jemy89mPK VB9ZLSW8Ef+8WhlhpERgKh3C4AwlLVT0YSGP+NZY7Y8aQQnRCCTfxkla/ct4P4xzOS m384ySKBIIAd638YYDqCOcxaXX3uj/4hJTyxkYvLHgkuIFRDDkI8+xZ2gKK6GJvocM p6WIsw8yQJAavGl0gEUO2R8b7panqmJ9rBrYblYA0mmSsjYt6gOUgcj3KHSNIx9Iq4 CevdQYGBbuq+VVg9ZAfGZt1g9BYutIbzx1PyMaX9HpjQg/PQYxJc+gN2u0EeJbcuw0 5w3ycwJy5spww== Date: Thu, 16 Jun 2022 00:29:18 +0300 From: "jarkko@kernel.org" To: "hch@lst.de" Cc: "Edgecombe, Rick P" , "christophe.leroy@csgroup.eu" , "mcgrof@kernel.org" , "svens@linux.ibm.com" , "palmer@dabbelt.com" , "jpoimboe@kernel.org" , "paulus@samba.org" , "zepan@sipeed.com" , "iii@linux.ibm.com" , "deller@gmx.de" , "aou@eecs.berkeley.edu" , "joey.gouly@arm.com" , "anemo@mba.ocn.ne.jp" , "egorenar@linux.ibm.com" , "ast@kernel.org" , "ardb@kernel.org" , "mpe@ellerman.id.au" , "linux-kernel@vger.kernel.org" , "linux-mips@vger.kernel.org" , "npiggin@gmail.com" , "thomas.lendacky@amd.com" , "bp@alien8.de" , "davem@davemloft.net" , "x86@kernel.org" , "luis.machado@linaro.org" , "ebiederm@xmission.com" , "mbenes@suse.cz" , "mingo@redhat.com" , "jniethe5@gmail.com" , "mark.rutland@arm.com" , "linux@armlinux.org.uk" , "paul.walmsley@sifive.com" , "andreyknvl@gmail.com" , "dja@axtens.net" , "liaochang1@huawei.com" , "linux-modules@vger.kernel.org" , "huschle@linux.ibm.com" , "will@kernel.org" , "akpm@linux-foundation.org" , "James.Bottomley@hansenpartnership.com" , "song@kernel.org" , "guoren@kernel.org" , "nathan@kernel.org" , "dave.anglin@bell.net" , "rostedt@goodmis.org" , "atomlin@redhat.com" , "bristot@redhat.com" , "naveen.n.rao@linux.ibm.com" , "anup@brainfault.org" , "javierm@redhat.com" , "linux@roeck-us.net" , "linus.walleij@linaro.org" , "philipp.tomsich@vrull.eu" , "linux-arm-kernel@lists.infradead.org" , "ndesaulniers@google.com" , "samitolvanen@google.com" , "yangtiezhu@loongson.cn" , "aneesh.kumar@linux.ibm.com" , "geert@linux-m68k.org" , "hpa@zytor.com" , "heiko@sntech.de" , "nathaniel@profian.com" , "michael.roth@amd.com" , "rmk+kernel@armlinux.org.uk" , "Sakkinen, Jarkko" , "catalin.marinas@arm.com" , "borntraeger@linux.ibm.com" , "dave.hansen@linux.intel.com" , "wangkefeng.wang@huawei.com" , "tmricht@linux.ibm.com" , "hca@linux.ibm.com" , "linux-parisc@vger.kernel.org" , "gor@linux.ibm.com" , "atishp@atishpatra.org" , "linuxppc-dev@lists.ozlabs.org" , "dmitry.torokhov@gmail.com" , "tglx@linutronix.de" , "kirill.shutemov@linux.intel.com" , "sparclinux@vger.kernel.org" , "broonie@kernel.org" , "tsbogend@alpha.franken.de" , "nico@fluxnic.net" , "masahiroy@kernel.org" , "agordeev@linux.ibm.com" , "kernel@esmil.dk" , "ashimida@linux.alibaba.com" , "elver@google.com" , "keescook@chromium.org" , "peterz@infradead.org" , "mhiramat@kernel.org" , "Keshavamurthy, Anil S" , "linux-riscv@lists.infradead.org" , "chenzhongjin@huawei.com" , "andrealmeid@igalia.com" , "changbin.du@intel.com" , "benh@kernel.crashing.org" , "linux-s390@vger.kernel.org" Subject: Re: [PATCH] kprobes: Enable tracing for mololithic kernel images Message-ID: References: <20220608232115.ccd4399f4a1d133e9b65c2a9@kernel.org> <20220609034852.GA30873@lst.de> <20220615063707.GA22930@lst.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220615063707.GA22930@lst.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220615_143128_777646_B6686B61 X-CRM114-Status: GOOD ( 24.27 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Wed, Jun 15, 2022 at 08:37:07AM +0200, hch@lst.de wrote: > On Tue, Jun 14, 2022 at 03:32:38PM +0300, jarkko@kernel.org wrote: > > > Like say for a next step we moved prog pack out of bpf into core code, > > > gave it it's own copy of module_alloc(), and then made kprobes use it. > > > Then we would have something with improved W^X guard rails, and kprobes > > > would not depend on modules anymore. I think maybe it's a step in the > > > right direction, even if it's not perfect. > > > > So you're saying that I should (as a first step) basically clone > > module_alloc() implementation for kprobes, and future for BPF > > use, in order to get a clean starting point? > > I don't think cloning the code helps anyone. The fact that except > for the eBPF mess everyone uses module_alloc and the related > infrastructure is a feature and not a bug. The interface should > become better than what we have right now, but there is few enough > users that this can be done in one go. > > So assuming we really care deeply enough about fancy tracing without > modules (and I'm not sure we do, even if you don't use modules it > doesn't hurt to just build the modules code, I do that all the time > for my test machines), the general approach in your series is the > right one. OK, thanks for the elaboration! However I bake it, I doubt that next version is going to be the final version, given all the angles. Therefore, I mostly Christophe's suggestions on compilation flags, and also split this into per-arch patches. That should be at least to the right direction. BR, Jarkko _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 02417C43334 for ; Thu, 16 Jun 2022 02:00:29 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4LNlkN3W6nz3dpG for ; Thu, 16 Jun 2022 12:00:28 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=jRcv7OdG; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=139.178.84.217; helo=dfw.source.kernel.org; envelope-from=jarkko@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=jRcv7OdG; dkim-atps=neutral Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4LNdm22XGGz3bp3 for ; Thu, 16 Jun 2022 07:31:30 +1000 (AEST) 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 206FF617C0; Wed, 15 Jun 2022 21:31:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA8F8C3411A; Wed, 15 Jun 2022 21:31:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655328687; bh=h/A3iOsL+jSiXeun+GclseG7VDKI7T9E6iC83VBXQmc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jRcv7OdG8w6WZvKDmpHu4ZTNDPKNmUeNwkF/5kyOU3kogbTfbnziKBi4Jemy89mPK VB9ZLSW8Ef+8WhlhpERgKh3C4AwlLVT0YSGP+NZY7Y8aQQnRCCTfxkla/ct4P4xzOS m384ySKBIIAd638YYDqCOcxaXX3uj/4hJTyxkYvLHgkuIFRDDkI8+xZ2gKK6GJvocM p6WIsw8yQJAavGl0gEUO2R8b7panqmJ9rBrYblYA0mmSsjYt6gOUgcj3KHSNIx9Iq4 CevdQYGBbuq+VVg9ZAfGZt1g9BYutIbzx1PyMaX9HpjQg/PQYxJc+gN2u0EeJbcuw0 5w3ycwJy5spww== Date: Thu, 16 Jun 2022 00:29:18 +0300 From: "jarkko@kernel.org" To: "hch@lst.de" Subject: Re: [PATCH] kprobes: Enable tracing for mololithic kernel images Message-ID: References: <20220608232115.ccd4399f4a1d133e9b65c2a9@kernel.org> <20220609034852.GA30873@lst.de> <20220615063707.GA22930@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220615063707.GA22930@lst.de> X-Mailman-Approved-At: Thu, 16 Jun 2022 11:54:30 +1000 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "ashimida@linux.alibaba.com" , "heiko@sntech.de" , "catalin.marinas@arm.com" , "linus.walleij@linaro.org" , "paulus@samba.org" , "agordeev@linux.ibm.com" , "javierm@redhat.com" , "geert@linux-m68k.org" , "borntraeger@linux.ibm.com" , "linux@roeck-us.net" , "andrealmeid@igalia.com" , "michael.roth@amd.com" , "npiggin@gmail.com" , "tglx@linutronix.de" , "andreyknvl@gmail.com" , "ndesaulniers@google.com" , "linux-kernel@vger.kernel.org" , "mcgrof@kernel.org" , "svens@linux.ibm.com" , "zepan@sipeed.com" , "guoren@kernel.org" , "akpm@linux-foundation.org" , "mark.rutland@arm.com" , "luis.machado@linaro.org" , "anemo@mba.ocn.ne.jp" , "dave.hansen@linux.intel.com" , "joey.gouly@arm.com" , "James.Bottomley@hansenpartnership.com" , "song@kernel.org" , "linux-s390@vger.kernel.org" , "iii@linux.ibm.com" , "anup@brainfault.org" , "deller@gmx.de" , "Keshavamurthy, Anil S" , "mhiramat@kernel.org" , "thomas.lendacky@amd.com" , "gor@linux.ibm.com" , "philipp.tomsich@vrull.eu" , "dave.anglin@bell.net" , "linux-arm-kernel@lists.infradead.org" , "dja@axtens.net" , "nico@fluxnic.net" , "ebiederm@xmission.com" , "aneesh.kumar@linux.ibm.com" , "Edgecombe, Rick P" , "bristot@redhat.com" , "wangkefeng.wang@huawei.com" , "kernel@esmil.dk" , "jniethe5@gmail.com" , "paul.walmsley@sifive.com" , "ast@kernel.org" , "will@kernel.org" , "masahiroy@kernel.org" , "Sakkinen, Jarkko" , "samitolvanen@google.com" , "naveen.n.rao@linux.ibm.com" , "elver@google.com" , "keescook@chromium.org" , "rostedt@goodmis.org" , "nathan@kernel.org" , "rmk+kernel@armlinux.org.uk" , "broonie@kernel.org" , "bp@alien8.de" , "egorenar@linux.ibm .com" , "tsbogend@alpha.franken.de" , "linux-parisc@vger.kernel.org" , "nathaniel@profian.com" , "dmitry.torokhov@gmail.com" , "davem@davemloft.net" , "kirill.shutemov@linux.intel.com" , "huschle@linux.ibm.com" , "peterz@infradead.org" , "hpa@zytor.com" , "sparclinux@vger.kernel.org" , "yangtiezhu@loongson.cn" , "mbenes@suse.cz" , "chenzhongjin@huawei.com" , "ardb@kernel.org" , "x86@kernel.org" , "linux@armlinux.org.uk" , "linux-riscv@lists.infradead.org" , "mingo@redhat.com" , "atomlin@redhat.com" , "aou@eecs.berkeley.edu" , "hca@linux.ibm.com" , "liaochang1@huawei.com" , "atishp@atishpatra.org" , "jpoimboe@kernel.org" , "tmricht@linux.ibm.com" , "linux-mips@vger.kernel.org" , "changbin.du@intel.com" , "palmer@dabbelt.com" , "linuxppc-dev@lists.ozlabs.org" , "linux-modules@vger.kernel.org" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Wed, Jun 15, 2022 at 08:37:07AM +0200, hch@lst.de wrote: > On Tue, Jun 14, 2022 at 03:32:38PM +0300, jarkko@kernel.org wrote: > > > Like say for a next step we moved prog pack out of bpf into core code, > > > gave it it's own copy of module_alloc(), and then made kprobes use it. > > > Then we would have something with improved W^X guard rails, and kprobes > > > would not depend on modules anymore. I think maybe it's a step in the > > > right direction, even if it's not perfect. > > > > So you're saying that I should (as a first step) basically clone > > module_alloc() implementation for kprobes, and future for BPF > > use, in order to get a clean starting point? > > I don't think cloning the code helps anyone. The fact that except > for the eBPF mess everyone uses module_alloc and the related > infrastructure is a feature and not a bug. The interface should > become better than what we have right now, but there is few enough > users that this can be done in one go. > > So assuming we really care deeply enough about fancy tracing without > modules (and I'm not sure we do, even if you don't use modules it > doesn't hurt to just build the modules code, I do that all the time > for my test machines), the general approach in your series is the > right one. OK, thanks for the elaboration! However I bake it, I doubt that next version is going to be the final version, given all the angles. Therefore, I mostly Christophe's suggestions on compilation flags, and also split this into per-arch patches. That should be at least to the right direction. BR, Jarkko