Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp861244iol; Thu, 9 Jun 2022 16:05:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXWIu7I7AzeaI/1vfSxymSwHOxPqReFZMotqi7jbVNTfi51g0/UZfnIDHa9ra7GMIe3KmC X-Received: by 2002:a17:906:ca91:b0:70d:52ca:7e7d with SMTP id js17-20020a170906ca9100b0070d52ca7e7dmr32853415ejb.552.1654815921170; Thu, 09 Jun 2022 16:05:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654815921; cv=none; d=google.com; s=arc-20160816; b=DSZMXBGpUNLHJEzgA9VmJ1c1AftEJk5YL7XcMnnkpd8G4ApZ+Hx+p1CVz2uRy7KzRl GbK9mLL8jRLh9rKYOHHgsn0qDuhpGYGratvZN53COSWKsICmotR3lGGrJpKlmESPKOn/ WlTniS9CgGha06jcxlbv99BwaUBQO5e6KOuqw+dkIB772W6JPQnsrZb8BehBNFGsQOOC UdotIeWltxG8YMhelh1Q6kZAOSqgGYFQ6rJNf1zXYAdY8dYVFSDBD6U8o3VkHFDUES60 ycVBLRB/C0LVa9UPdLot8xTuaDVIphrHf+y3F/i/N0DsPk1DpNyxHvfoIwncl4TWvuIw JltA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=HuDy9dG9ly2Xzz0wYdCgiECkcRvV7azZdFL1VuKogHE=; b=zzrZMGnPwAMnz0rrzIyOoi8lQD1Av8nKBb2quNMsyo6aDlBz029CefF+Gr+FUhO0u1 aT835qRu7UFW1Hf/wTCZ1U2hu7h+j3w77WPpFks72W86JpwlyHmf+8lOYOSO/uFS/FYu WjvQkkjRnkZpa5CEZDGOkqZm0r9l/o5DTZdO2WRxbGQo0OXFoieY7FvdpPZznBasa09/ ti3u8UHbFARz9P/bBs9Su8maSWX7Y6PYC2rk4SQ0av/8Uu4dVEgcN9VI1XsIBsD+7lim fRKcGtWgWeIle6CXzq6U4yofX/b5RjSwyUZHH27Stm5/sIGQjoJlxYA3xMKuV+ZShCT2 Wx2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rbv9z7Qe; 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 b6-20020a056402278600b0042b756321f5si5047772ede.104.2022.06.09.16.04.51; Thu, 09 Jun 2022 16:05:21 -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=rbv9z7Qe; 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 S1344481AbiFIWsh (ORCPT + 99 others); Thu, 9 Jun 2022 18:48:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229830AbiFIWsf (ORCPT ); Thu, 9 Jun 2022 18:48:35 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2874EA45D; Thu, 9 Jun 2022 15:48:33 -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 sin.source.kernel.org (Postfix) with ESMTPS id 4399ECE317A; Thu, 9 Jun 2022 22:48:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84D3BC36AFF; Thu, 9 Jun 2022 22:48:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654814909; bh=fXQHcxnj09/NTw2WTFOlO+YMcNuPa2JywCYJxs8h+OI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=rbv9z7QeT/QQKBgEuJO5H6O/pF2I3A5hVtn+qNA4aWH96FTU6yVTEQwHQGjqaoYkT tFPL3zBi5AVCAkOoC2eoAi0xj+emtB7yPU39cgTU3RScBvLEpnCwZQqYQ8sLffVfQ8 Sx8qjpReQ0YkIwWrENf5Q0+QiPCd0A+cMbePFKYcfvT1TxMgB++pQoN4KkNxaqlLbw 9HBuekMBTr0Sf4IFP0xEd650ha3tmpj+fTktT3OylX/fHTt7m1VpHFcnD+AKYIqrH3 JmEUaeHvP+BNUIuP94Iqjo+6JRsKgf6ujoTYj4eO+d0UL22utEkOROjGi3GlR6kseU Ldl3iwq16Jcbw== Received: by mail-yb1-f180.google.com with SMTP id y188so14709363ybe.11; Thu, 09 Jun 2022 15:48:29 -0700 (PDT) X-Gm-Message-State: AOAM530xFRfgRJ3qRdVmUqP21HqcSPX/NrqYfXddDqdA165zUT8PNFGT HOY2zwXJCafTyzHLA/eacP9xc48fGvPt1pC/z6o= X-Received: by 2002:a25:3b49:0:b0:664:5a43:5895 with SMTP id i70-20020a253b49000000b006645a435895mr1766286yba.9.1654814908410; Thu, 09 Jun 2022 15:48:28 -0700 (PDT) MIME-Version: 1.0 References: <20220608000014.3054333-1-jarkko@profian.com> <20220608232115.ccd4399f4a1d133e9b65c2a9@kernel.org> <20220609034852.GA30873@lst.de> In-Reply-To: From: Song Liu Date: Thu, 9 Jun 2022 15:48:17 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] kprobes: Enable tracing for mololithic kernel images To: "Edgecombe, Rick P" Cc: "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" , "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" , "jarkko@kernel.org" , "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" Content-Type: text/plain; charset="UTF-8" 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 9, 2022 at 11:41 AM Edgecombe, Rick P wrote: > > On Thu, 2022-06-09 at 06:24 -0700, Luis Chamberlain 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. I was also thinking about where to put the prog pack allocator eventually. Shall it be part of mm code or module code? Btw, prog pack has more challenges with W^X requirement: 1. The arch need to have text poke mechanism; 2. Some users of prog pack need to learn to use the ROXbuffer with text poke, for example, how to calculate relative address differently. Thanks, Song