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 X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97820C433F2 for ; Tue, 14 Jul 2020 13:57:26 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6A0BA22510 for ; Tue, 14 Jul 2020 13:57:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ns/TmXkX"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="Oe+FoE7I" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6A0BA22510 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject: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=pH0U9H+GyY3R4kmsvApyGG38VmkTc63f7S1/cJSa1XI=; b=ns/TmXkXMV6HpygF1TTHEiQUO OrJbeB32VKndsSoBdyTgmSXAUhDLZI/4YfefgX8RWMZS/xpDz7VZ9zWMSgZDcw5tCFpbdViUK3OF5 b7jQ0zEmXDqcIsPreKvcsdtHzJSz+4gm08HADufVypNGxxMPV4YH7oMKAJzGGrNNWchmJux4KmfOK kL0RlWoGj+cs6LE5ilq9J0/wmAALq346CSHqMv9Do/yOWRtNXIhTsVmE9rQmowURQlslZsDqISCMy EwtdGOL54a6IDE+U1Vu0sHCQJVtjRAFC55mWEoeNa3d0KDwIUyzaJkscRahAYHtYMc6aOmcAO5KID IxY6sCoKA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jvLQs-0005s7-PC; Tue, 14 Jul 2020 13:57:18 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jvLQk-0005pL-Pl; Tue, 14 Jul 2020 13:57:11 +0000 Received: from linux-8ccs (p57a23121.dip0.t-ipconnect.de [87.162.49.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A41F1224D4; Tue, 14 Jul 2020 13:56:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594735029; bh=sDRgQsMNFsnk+NJi/EtVNvUVT0hprBsFpXSjZJCaOJc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Oe+FoE7Isbr/dh/NAspLLmiD6Tu2op4eOuaCmXfRG3S3hxL/mIwkxOm3MfoOkjhKw e8wl/c4JruCu/HnfbPp7yc1TKfS7YPN4vXnp8dv4EVogQ2I4GOEvgBi3gh4GRQo34O G+T1PsRBd5geocIES2N7Gmxw+TZ+3KnEqUPWoHXw= Date: Tue, 14 Jul 2020 15:56:52 +0200 From: Jessica Yu To: Jarkko Sakkinen Subject: Re: [PATCH v2 1/3] module: Rename module_alloc() to text_alloc() and move to kernel proper Message-ID: <20200714135651.GA27819@linux-8ccs> References: <20200714094625.1443261-1-jarkko.sakkinen@linux.intel.com> <20200714094625.1443261-2-jarkko.sakkinen@linux.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200714094625.1443261-2-jarkko.sakkinen@linux.intel.com> X-OS: Linux linux-8ccs 5.5.0-lp150.12.61-default x86_64 User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200714_095710_969133_371BBB99 X-CRM114-Status: GOOD ( 15.26 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Catalin Marinas , Kefeng Wang , Paul Mackerras , Zong Li , Andi Kleen , Paul Burton , Michael Ellerman , Vincent Whitchurch , Benjamin Herrenschmidt , Petr Mladek , Brian Gerst , Andy Lutomirski , Thomas Gleixner , Jiri Kosina , Anup Patel , linux-kernel@vger.kernel.org, Philipp Rudo , Torsten Duwe , Masami Hiramatsu , Andrew Morton , Mark Rutland , "James E.J. Bottomley" , Vincent Chen , Omar Sandoval , "open list:S390" , Joe Lawrence , Helge Deller , John Fastabend , Anil S Keshavamurthy , Yonghong Song , Iurii Zaikin , Andrii Nakryiko , Thomas Huth , Vasily Gorbik , "moderated list:ARM PORT" , Daniel Axtens , Damien Le Moal , Martin KaFai Lau , Song Liu , Paul Walmsley , Heiko Carstens , Alexei Starovoitov , Atish Patra , Will Deacon , Daniel Borkmann , Masahiro Yamada , Nayna Jain , Ley Foon Tan , Christian Borntraeger , Sami Tolvanen , "Naveen N. Rao" , Mao Han , Marco Elver , Steven Rostedt , Babu Moger , Borislav Petkov , Greentime Hu , Ben Dooks , Guan Xuetao , Thomas Bogendoerfer , "open list:PARISC ARCHITECTURE" , "open list:BPF JIT for MIPS \(32-BIT AND 64-BIT\)" , "David S. Miller" , Thiago Jung Bauermann , Peter Zijlstra , David Howells , "open list:SPARC + UltraSPARC \(sparc/sparc64\)" , Sandipan Das , "H. Peter Anvin" , Amit Daniel Kachhap , Tiezhu Yang , Miroslav Benes , Jiri Olsa , Ard Biesheuvel , Vincenzo Frascino , Anders Roxell , Sven Schnelle , "maintainer:X86 ARCHITECTURE \(32-BIT AND 64-BIT\)" , Russell King , "open list:RISC-V ARCHITECTURE" , Mike Rapoport , Ingo Molnar , Albert Ou , "Paul E. McKenney" , Josh Poimboeuf , KP Singh , Dmitry Vyukov , Nick Hu , "open list:BPF JIT for MIPS \(32-BIT AND 64-BIT\)" , "open list:MIPS" , Palmer Dabbelt , "open list:LINUX FOR POWERPC \(32-BIT AND 64-BIT\)" Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org +++ Jarkko Sakkinen [14/07/20 12:45 +0300]: >Rename module_alloc() to text_alloc() and module_memfree() to >text_memfree(), and move them to kernel/text.c, which is unconditionally >compiled to the kernel proper. This allows kprobes, ftrace and bpf to >allocate space for executable code without requiring to compile the modules >support (CONFIG_MODULES=y) in. > >Cc: Andi Kleen >Suggested-by: Peter Zijlstra >Signed-off-by: Jarkko Sakkinen As Ard and Will have already explained, the major issue I'm having with this is that we're taking module_alloc(), an allocator that was originally specific to module loading, and turning it into a generic interface to be used by other subsystems. You're pulling in all the module loading semantics that vary by architecture and expecting it to work as a generic text allocator. I'm not against the existence of a generic text_alloc() but I would very much rather that module_alloc() be left alone to the module loader and instead work on introducing a *separate* generic text_alloc() interface that would work for its intended users (kprobes, bpf, etc) and have existing users of module_alloc() switch to that instead. Jessica _______________________________________________ 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 X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84C1FC433DF for ; Tue, 14 Jul 2020 19:23:09 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3479622282 for ; Tue, 14 Jul 2020 19:23:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="Oe+FoE7I" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3479622282 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4B5r5R2YfnzDqgZ for ; Wed, 15 Jul 2020 05:23:07 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=198.145.29.99; helo=mail.kernel.org; envelope-from=jeyu@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=default header.b=Oe+FoE7I; dkim-atps=neutral Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (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 4B5hsM5gPQzDqT1 for ; Tue, 14 Jul 2020 23:57:11 +1000 (AEST) Received: from linux-8ccs (p57a23121.dip0.t-ipconnect.de [87.162.49.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A41F1224D4; Tue, 14 Jul 2020 13:56:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594735029; bh=sDRgQsMNFsnk+NJi/EtVNvUVT0hprBsFpXSjZJCaOJc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Oe+FoE7Isbr/dh/NAspLLmiD6Tu2op4eOuaCmXfRG3S3hxL/mIwkxOm3MfoOkjhKw e8wl/c4JruCu/HnfbPp7yc1TKfS7YPN4vXnp8dv4EVogQ2I4GOEvgBi3gh4GRQo34O G+T1PsRBd5geocIES2N7Gmxw+TZ+3KnEqUPWoHXw= Date: Tue, 14 Jul 2020 15:56:52 +0200 From: Jessica Yu To: Jarkko Sakkinen Subject: Re: [PATCH v2 1/3] module: Rename module_alloc() to text_alloc() and move to kernel proper Message-ID: <20200714135651.GA27819@linux-8ccs> References: <20200714094625.1443261-1-jarkko.sakkinen@linux.intel.com> <20200714094625.1443261-2-jarkko.sakkinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20200714094625.1443261-2-jarkko.sakkinen@linux.intel.com> X-OS: Linux linux-8ccs 5.5.0-lp150.12.61-default x86_64 User-Agent: Mutt/1.10.1 (2018-07-13) X-Mailman-Approved-At: Wed, 15 Jul 2020 05:16:19 +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: Catalin Marinas , Kefeng Wang , Paul Mackerras , Zong Li , Andi Kleen , Paul Burton , Vincent Whitchurch , Petr Mladek , Brian Gerst , Andy Lutomirski , Thomas Gleixner , Jiri Kosina , Anup Patel , linux-kernel@vger.kernel.org, Philipp Rudo , Torsten Duwe , Masami Hiramatsu , Andrew Morton , Mark Rutland , "James E.J. Bottomley" , Vincent Chen , Omar Sandoval , "open list:S390" , Joe Lawrence , Helge Deller , John Fastabend , Anil S Keshavamurthy , Yonghong Song , Iurii Zaikin , Andrii Nakryiko , Thomas Huth , Vasily Gorbik , "moderated list:ARM PORT" , Daniel Axtens , Damien Le Moal , Martin KaFai Lau , Song Liu , Paul Walmsley , Heiko Carstens , Alexei Starovoitov , Atish Patra , Will Deacon , Daniel Borkmann , Masahiro Yamada , Nayna Jain , Ley Foon Tan , Christian Borntraeger , Sami Tolvanen , "Naveen N. Rao" , Mao Han , Marco Elver , Steven Rostedt , Babu Moger , Borislav Petkov , Greentime Hu , Ben Dooks , Guan Xuetao , Thomas Bogendoerfer , "open list:PARISC ARCHITECTURE" , "open list:BPF JIT for MIPS \(32-BIT AND 64-BIT\)" , "David S. Miller" , Thiago Jung Bauermann , Peter Zijlstra , David Howells , "open list:SPARC + UltraSPARC \(sparc/sparc64\)" , Sandipan Das , "H. Peter Anvin" , Amit Daniel Kachhap , Tiezhu Yang , Miroslav Benes , Jiri Olsa , Ard Biesheuvel , Vincenzo Frascino , Anders Roxell , Sven Schnelle , "maintainer:X86 ARCHITECTURE \(32-BIT AND 64-BIT\)" , Russell King , "open list:RISC-V ARCHITECTURE" , Mike Rapoport , Ingo Molnar , Albert Ou , "Paul E. McKenney" , Josh Poimboeuf , KP Singh , Dmitry Vyukov , Nick Hu , "open list:BPF JIT for MIPS \(32-BIT AND 64-BIT\)" , "open list:MIPS" , Palmer Dabbelt , "open list:LINUX FOR POWERPC \(32-BIT AND 64-BIT\)" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" +++ Jarkko Sakkinen [14/07/20 12:45 +0300]: >Rename module_alloc() to text_alloc() and module_memfree() to >text_memfree(), and move them to kernel/text.c, which is unconditionally >compiled to the kernel proper. This allows kprobes, ftrace and bpf to >allocate space for executable code without requiring to compile the modules >support (CONFIG_MODULES=y) in. > >Cc: Andi Kleen >Suggested-by: Peter Zijlstra >Signed-off-by: Jarkko Sakkinen As Ard and Will have already explained, the major issue I'm having with this is that we're taking module_alloc(), an allocator that was originally specific to module loading, and turning it into a generic interface to be used by other subsystems. You're pulling in all the module loading semantics that vary by architecture and expecting it to work as a generic text allocator. I'm not against the existence of a generic text_alloc() but I would very much rather that module_alloc() be left alone to the module loader and instead work on introducing a *separate* generic text_alloc() interface that would work for its intended users (kprobes, bpf, etc) and have existing users of module_alloc() switch to that instead. Jessica