Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp205019iog; Wed, 15 Jun 2022 00:02:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwOEmJTtXeox65xM5sZZleiZm1ptkPwTi7eZzptxcjAg0C/m2emydkxSKJq1tykpUNLxzj X-Received: by 2002:a05:6402:3222:b0:435:da0:3039 with SMTP id g34-20020a056402322200b004350da03039mr4493276eda.201.1655276569925; Wed, 15 Jun 2022 00:02:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655276569; cv=none; d=google.com; s=arc-20160816; b=dGHs8AifaZjadW+Rb/yla39KBklTSl+voor9Nnfz5WT8EMq8tPcTDwwanZxQcQY9+T HCV0BYTm6HVeZxNyYnKeotYjsLmBEsovvMMaoJH0xVJJ7jC+nOd4M1c06gkPw0+rJc3i lBDEiyz1+Zurxhld1kQS0wpJOhX/qcSUPJEv997vurZVUUgWHEjeR0NFUnu3oSpwfxwb fyI/4W3galcJyud+JRFNLvfgY9jXSx3jMnvFlVBrQpNoBqmahyzhUXVl+LGfrmGH1z8d IRyzcfaQZjsxNsK9a3LQZnHY2L7IOeOnyWLcv8yYeXkUx5E1/XFA7bgSSljCv4yUEXSI 3zdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=9k2nSoHnhCILV5KIr2I7MHnUkX4w3Y4mSthC8dEvw5w=; b=sTCmY+QzH8cL4m70xiv1vVqbL7kEOHvxXGRw+0+34gRZTp83UkuzXkQRCjvRLyjIwg OrxUY+Cc8ciJ5e/l0uM+92rFaL/lRXMrfV4xJOB9P6X4F2dASdE262nTUuOPnizeURmy nfP/LV0TjW+nsnV48Hdkdbv6gneCGshRCZEgBCbBaDnuWX0OZdzqu9EqJPeZvwfCxQxs /0hMjzso22h1aWDqyIzB2WnchQkurnJArIhFjgvN6fHowoEoRckzz6ZAbmqITFnq+WLV it4FhwLvvBx6ZHsL5sv7XrbrHR2IzZtihiG8xZuw3tNbW0cTS5GSfpZ6tnrN+a+JwVHw /oow== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s1-20020a17090699c100b007122fe7f49csi14536287ejn.424.2022.06.15.00.02.22; Wed, 15 Jun 2022 00:02:49 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346030AbiFOGhU (ORCPT + 99 others); Wed, 15 Jun 2022 02:37:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241616AbiFOGhT (ORCPT ); Wed, 15 Jun 2022 02:37:19 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78BDD42EFD; Tue, 14 Jun 2022 23:37:16 -0700 (PDT) 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" Cc: "Edgecombe, Rick P" , "hch@lst.de" , "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: <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-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,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 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.