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 27B0DC43334 for ; Thu, 16 Jun 2022 01:57:31 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4LNlfx5K7Nz3f33 for ; Thu, 16 Jun 2022 11:57:29 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lst.de (client-ip=213.95.11.211; helo=verein.lst.de; envelope-from=hch@lst.de; receiver=) Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (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 4LNFwG6dhVz3blJ for ; Wed, 15 Jun 2022 16:37:17 +1000 (AEST) Received: by verein.lst.de (Postfix, from userid 2407) id D469067373; Wed, 15 Jun 2022 08:37:07 +0200 (CEST) Date: Wed, 15 Jun 2022 08:37:07 +0200 From: "hch@lst.de" To: "jarkko@kernel.org" Subject: Re: [PATCH] kprobes: Enable tracing for mololithic kernel images Message-ID: <20220615063707.GA22930@lst.de> References: <20220608232115.ccd4399f4a1d133e9b65c2a9@kernel.org> <20220609034852.GA30873@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) 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" , "hch@lst.de" , "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@kerne l.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@f luxnic.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" , "hc a@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 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.