Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp7499iof; Wed, 8 Jun 2022 13:55:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyux4RcyzTK9nhy3c78mSglQpiI8xUUOsMQ7uQNrbOUfErAXOEbvGEIOsTTjx3PUul1cIId X-Received: by 2002:a17:906:9244:b0:70c:f626:944d with SMTP id c4-20020a170906924400b0070cf626944dmr28591073ejx.496.1654721709092; Wed, 08 Jun 2022 13:55:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654721709; cv=none; d=google.com; s=arc-20160816; b=CXBISRs1S2Xohzm7e4+DPhIxdnqVcgURUTUw0Tuyyi3sMLRBwkOY93G/5kUtke1YSm xH1VhoeQsoyqTrDwmrxCj3FBUyINZMppg53bEQtRWauMdvSBRo4UHvzVr0v5iW3+km6x Jq30QDmlgOCFUAiDXCjBaAv1QkXpmMiS0KmpnMdXbHkEoLoLJuWdzJkKKquGkw2MJL3y OLpX2bMeTN7EjA27D++Bq/VNDPnLdfc7S0TJ16ZVG6Wv1JknyKnVqRZkjNMffu9Qz8RD muvLr09LmVQaTTfo8aGu9vyO6mBzcYGvVH4wyDyEXr+OLxnrg5zymNmEGpdjqPEPwdma jvTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=UslqCti0qqUSvM7NSsuVph4LPbUHbcSI30SBdlOy048=; b=EPAvGjBvN1tqVzIWnCvKW19SvAr6BtXdCj7FeZfXsMsgvkCJtCRRg+x/aQWOtmY5i4 MiKiWlNcGhjnY10ykDkw/0Oo7IFtmH9Uqp0HIl3uM/MLi4CB93l6h4yZFi/ZQ4LBjFw6 OzxTaavDECnCbAEoqHI9vD1/m5uviUG9F0lfrOFUtHWaCZYIwESaT25KaDPJ/mk159eK h7Os+YHV9MwVca+ZXANrf+i+lVzZkkPUVXxjFHCaV/7eEXgOuFLYYKDYPBIWdmSAsgv6 pDmCgyWWk8d6CZY4WQ3l1Eq7XROYAvmepiBTm23HG9OL9uAsPdEbqdohI/j0R2Zit7Iw OI/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=oWSTSrJH; 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 b15-20020a056402084f00b0042e09f44f12si286036edz.373.2022.06.08.13.54.43; Wed, 08 Jun 2022 13:55:09 -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=@infradead.org header.s=bombadil.20210309 header.b=oWSTSrJH; 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 S231636AbiFHU0j (ORCPT + 99 others); Wed, 8 Jun 2022 16:26:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230254AbiFHU0g (ORCPT ); Wed, 8 Jun 2022 16:26:36 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CD5F3A4CC5; Wed, 8 Jun 2022 13:26:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=UslqCti0qqUSvM7NSsuVph4LPbUHbcSI30SBdlOy048=; b=oWSTSrJHo+c3AeKRudCHbJrEtu M/cVAkxCfYBh3bHZCR/E4oQsHb4DDQOzTw/YixFD0ZT8TsAkRDBxYP+aPzobRm2PTnwAZYXTaq6Fw rkqnKz7V8L7TMY53wRqi6bu8gCIJ0XsNNLAmA7KCu4po7dqsaRK6+nSArbM5p64scbG5ePLbhiUFt 2R5rf9M67rrdmynxd+nZ1qOmERF4P9uO/eVBCpmCJ8wbXSXFD9vh7/fDo6cWh4lxcqnQJ+zIkK/CM MiaBE+93YVXNM1muCECUywxQI9Ew8SQMp0oYGUwO2K5I3CKWGNdPTbrkh2R9aMT5wCg7d6jdj4+BM YCuRJatQ==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nz2Fv-00Es7U-II; Wed, 08 Jun 2022 20:26:19 +0000 Date: Wed, 8 Jun 2022 13:26:19 -0700 From: Luis Chamberlain To: Song Liu , Christoph Hellwig Cc: Masami Hiramatsu , Jarkko Sakkinen , Guo Ren , Jarkko Sakkinen , Linux Kernel Mailing List , Nathaniel McCallum , Russell King , 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 , the arch/x86 maintainers , "H. Peter Anvin" , "Naveen N. Rao" , Anil S Keshavamurthy , Steven Rostedt , Kees Cook , "Peter Zijlstra (Intel)" , Nathan Chancellor , Josh Poimboeuf , Mark Rutland , "Eric W. Biederman" , Marco Elver , Dan Li , Sami Tolvanen , Ard Biesheuvel , "Russell King (Oracle)" , 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 , 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 , "open list:BROADCOM NVRAM DRIVER" , Parisc List , linuxppc-dev , linux-riscv , linux-s390 , sparclinux , linux-modules@vger.kernel.org Subject: Re: [PATCH] kprobes: Enable tracing for mololithic kernel images Message-ID: References: <20220608000014.3054333-1-jarkko@profian.com> <20220608232115.ccd4399f4a1d133e9b65c2a9@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Luis Chamberlain X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Wed, Jun 08, 2022 at 11:20:53AM -0700, Song Liu wrote: > On Wed, Jun 8, 2022 at 9:12 AM Song Liu wrote: > > On Wed, Jun 8, 2022 at 7:21 AM Masami Hiramatsu wrote: > > > On Wed, 8 Jun 2022 08:25:38 +0300 > > > Jarkko Sakkinen wrote: > > > > On Wed, Jun 08, 2022 at 10:35:42AM +0800, Guo Ren wrote: > > > > > On Wed, Jun 8, 2022 at 8:02 AM Jarkko Sakkinen wrote: > > > > > > As the result, kprobes can be used with a monolithic kernel. > > > > > It's strange when MODULES is n, but vmlinux still obtains module_alloc. > > > > > > > > > > Maybe we need a kprobe_alloc, right? > > > > > > > > Perhaps not the best name but at least it documents the fact that > > > > they use the same allocator. > > > > > > > > Few years ago I carved up something "half-way there" for kprobes, > > > > and I used the name text_alloc() [*]. > > > > > > > > [*] https://lore.kernel.org/all/20200724050553.1724168-1-jarkko.sakkinen@linux.intel.com/ > > > > > > Yeah, I remember that. Thank you for updating your patch! > > > I think the idea (split module_alloc() from CONFIG_MODULE) is good to me. > > > If module support maintainers think this name is not good, you may be > > > able to rename it as text_alloc() and make the module_alloc() as a > > > wrapper of it. > > > > IIUC, most users of module_alloc() use it to allocate memory for text, except > > that module code uses it for both text and data. Therefore, I guess calling it > > text_alloc() is not 100% accurate until we change the module code (to use > > a different API to allocate memory for data). > > Git history showed me > > 7a0e27b2a0ce mm: remove vmalloc_exec > > I guess we are somehow going back in time... No, that was removed because it has only one user. The real hard work to generalize vmalloc_exec() with all the arch special sauce was not done. To do this properly architectures must be able to override it. We can use the old vmalloc_exec() or text_alloc(). I think vmalloc_exec() is more in line with mm stuff, but it would be our first __weak mm call from what I can tell. Anyway patches welcomed. Luis