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=-7.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=no 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 E2AC1C433E0 for ; Tue, 14 Jul 2020 09:47:30 +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 B025E217D8 for ; Tue, 14 Jul 2020 09:47:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tzaHw25T" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B025E217D8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com 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-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=IoWQQC0JOnim6Exe6W8dDbQQ4STBHqOAWbMb/ljWsfk=; b=tzaHw25TrPcks9JfQhLZS7QE/H lmr13+35lzaSFy68gRJn2OSYKa14ZG2VkVrwH3+jhpSC5m2y8yP1+lUZLSAcRPzrE6hSm46lgHliy YepwyJE59/tiYnSk0G3lM1ZJ17jM6YysHCLFabW34yfFo1CgF4MHddooa27RPOJOUTQ32RER0vEWu jNX13wlzSa4DTA8mgXYeatyPRVR1C0ZhPnKjCZHTs7k0kI2dkSs73cnPvoP5hxevIRawoOC6DavOJ IDJahOs3QL8Z37ImGvAApl2mlREyDx/1+mrVWPJUsTq+TOT4ZTq4VdYYQSO7zFjWy3nOFeMXiLxqj R9GBI8ug==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jvHX3-0007iK-Fz; Tue, 14 Jul 2020 09:47:25 +0000 Received: from mga09.intel.com ([134.134.136.24]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jvHX0-0007gH-7a; Tue, 14 Jul 2020 09:47:23 +0000 IronPort-SDR: 9cPR3wJqNVoJ2yoes4ZvaO1NE3V5mXHZNOEblgGTfkPSi2bx3q6V80rl3LnOteHeaX6vaNO85Z uLMs6oFIGpiQ== X-IronPort-AV: E=McAfee;i="6000,8403,9681"; a="150282966" X-IronPort-AV: E=Sophos;i="5.75,350,1589266800"; d="scan'208";a="150282966" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jul 2020 02:47:19 -0700 IronPort-SDR: tnOCkLt8IfVkm5xN3VakaM9NZRaZ4I7vcKaIxPq0JkwL/dnT/xa9qFx9uW0JY5/S7u+lxPJYn9 QgrYykxLQnPw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,350,1589266800"; d="scan'208";a="429708293" Received: from rmarti11-mobl.ger.corp.intel.com (HELO localhost) ([10.252.54.57]) by orsmga004.jf.intel.com with ESMTP; 14 Jul 2020 02:46:40 -0700 From: Jarkko Sakkinen To: linux-kernel@vger.kernel.org Subject: [PATCH v2 0/3] kprobes: Remove MODULE dependency Date: Tue, 14 Jul 2020 12:45:35 +0300 Message-Id: <20200714094625.1443261-1-jarkko.sakkinen@linux.intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200714_054722_413891_28C356BD X-CRM114-Status: GOOD ( 17.47 ) 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 , Song Liu , Paul Mackerras , Zong Li , Paul Burton , "Aneesh Kumar K.V" , Vincent Whitchurch , Benjamin Herrenschmidt , Omar Sandoval , Petr Mladek , Brian Gerst , Andy Lutomirski , Thomas Gleixner , Iurii Zaikin , Jiri Kosina , Anup Patel , Philipp Rudo , Vincent Chen , Torsten Duwe , Masami Hiramatsu , Andrew Morton , Mark Rutland , Ingo Molnar , "open list:S390" , Joe Lawrence , Alexandre Ghiti , Helge Deller , John Fastabend , Yonghong Song , Borislav Petkov , Andrii Nakryiko , Vasily Gorbik , "moderated list:ARM PORT" , Daniel Axtens , Damien Le Moal , Stephen Boyd , Sean Christopherson , Martin KaFai Lau , Kefeng Wang , Palmer Dabbelt , Heiko Carstens , Jarkko Sakkinen , Atish Patra , Will Deacon , Masahiro Yamada , Nayna Jain , Krzysztof Kozlowski , Christian Borntraeger , Sami Tolvanen , Mao Han , Marco Elver , Kees Cook , Arnd Bergmann , "Steven Rostedt \(VMware\)" , Babu Moger , Russell King , Ben Dooks , Peter Collingbourne , Tiezhu Yang , Thomas Bogendoerfer , "open list:PARISC ARCHITECTURE" , Jessica Yu , "open list:BPF JIT for MIPS 32-BIT AND 64-BIT" , Thiago Jung Bauermann , Peter Zijlstra , "open list:SPARC + UltraSPARC sparc/sparc64" , "H. Peter Anvin" , Amit Daniel Kachhap , "open list:LIVE PATCHING" , "open list:RISC-V ARCHITECTURE" , Miroslav Benes , Jiri Olsa , Ard Biesheuvel , Vincenzo Frascino , Anders Roxell , Sven Schnelle , Mike Rapoport , "Paul E. McKenney" , Frederic Weisbecker , Paul Walmsley , KP Singh , Gerald Schaefer , Josh Poimboeuf , "open list:BPF JIT for MIPS 32-BIT AND 64-BIT" , "open list:MIPS" , Sergey Senozhatsky , "open list:LINUX FOR POWERPC 32-BIT AND 64-BIT" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Remove MODULES dependency by creating module subsystem indepdent text_alloc() and text_memfree() to allocate space for executable code. Right now one has to compile modules support only to enable kprobes. This incrases the barrier to use them in test kernels and I'd guess also in some embedded kernels (the former is my use case). v2: * Added the missing cover letter. Jarkko Sakkinen (3): module: Rename module_alloc() to text_alloc() and move to kernel proper module: Add lock_modules() and unlock_modules() kprobes: Flag out CONFIG_MODULES dependent code arch/Kconfig | 1 - arch/arm/kernel/Makefile | 3 +- arch/arm/kernel/module.c | 21 ------- arch/arm/kernel/text.c | 33 +++++++++++ arch/arm64/kernel/Makefile | 2 +- arch/arm64/kernel/module.c | 42 -------------- arch/arm64/kernel/text.c | 54 ++++++++++++++++++ arch/mips/kernel/Makefile | 2 +- arch/mips/kernel/module.c | 9 --- arch/mips/kernel/text.c | 19 +++++++ arch/mips/net/bpf_jit.c | 4 +- arch/nds32/kernel/Makefile | 2 +- arch/nds32/kernel/module.c | 7 --- arch/nds32/kernel/text.c | 12 ++++ arch/nios2/kernel/Makefile | 1 + arch/nios2/kernel/module.c | 19 ------- arch/nios2/kernel/text.c | 34 +++++++++++ arch/parisc/kernel/Makefile | 2 +- arch/parisc/kernel/module.c | 11 ---- arch/parisc/kernel/text.c | 22 ++++++++ arch/powerpc/net/bpf_jit_comp.c | 4 +- arch/riscv/kernel/Makefile | 1 + arch/riscv/kernel/module.c | 12 ---- arch/riscv/kernel/text.c | 20 +++++++ arch/s390/kernel/Makefile | 2 +- arch/s390/kernel/ftrace.c | 2 +- arch/s390/kernel/module.c | 16 ------ arch/s390/kernel/text.c | 23 ++++++++ arch/sparc/kernel/Makefile | 1 + arch/sparc/kernel/module.c | 30 ---------- arch/sparc/kernel/text.c | 39 +++++++++++++ arch/sparc/net/bpf_jit_comp_32.c | 6 +- arch/unicore32/kernel/Makefile | 1 + arch/unicore32/kernel/module.c | 7 --- arch/unicore32/kernel/text.c | 18 ++++++ arch/x86/kernel/Makefile | 1 + arch/x86/kernel/ftrace.c | 4 +- arch/x86/kernel/kprobes/core.c | 4 +- arch/x86/kernel/module.c | 49 ---------------- arch/x86/kernel/text.c | 60 ++++++++++++++++++++ include/linux/module.h | 29 +++++++--- include/linux/moduleloader.h | 4 +- kernel/Makefile | 2 +- kernel/bpf/core.c | 4 +- kernel/kprobes.c | 17 ++++-- kernel/livepatch/core.c | 8 +-- kernel/module.c | 97 +++++++++++++------------------- kernel/text.c | 25 ++++++++ kernel/trace/trace_kprobe.c | 20 ++++++- 49 files changed, 484 insertions(+), 322 deletions(-) create mode 100644 arch/arm/kernel/text.c create mode 100644 arch/arm64/kernel/text.c create mode 100644 arch/mips/kernel/text.c create mode 100644 arch/nds32/kernel/text.c create mode 100644 arch/nios2/kernel/text.c create mode 100644 arch/parisc/kernel/text.c create mode 100644 arch/riscv/kernel/text.c create mode 100644 arch/s390/kernel/text.c create mode 100644 arch/sparc/kernel/text.c create mode 100644 arch/unicore32/kernel/text.c create mode 100644 arch/x86/kernel/text.c create mode 100644 kernel/text.c -- 2.25.1 _______________________________________________ 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=-7.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=no 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 6F711C433E3 for ; Tue, 14 Jul 2020 10:38:02 +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 9D3AE22202 for ; Tue, 14 Jul 2020 10:38:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9D3AE22202 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com 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 4B5cRW3yxZzDqdf for ; Tue, 14 Jul 2020 20:37:59 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=linux.intel.com (client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=jarkko.sakkinen@linux.intel.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 4B5bK9022hzDqLr for ; Tue, 14 Jul 2020 19:47:23 +1000 (AEST) IronPort-SDR: 6ljhCjQYc8saOOrUhV5hESNwvppN9RtNnB3Cntw0bpXh5reKGpze3VUNm3nzB0ZOMJYNzdJKsF 4bkxZBZFMRzg== X-IronPort-AV: E=McAfee;i="6000,8403,9681"; a="213661351" X-IronPort-AV: E=Sophos;i="5.75,350,1589266800"; d="scan'208";a="213661351" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jul 2020 02:47:19 -0700 IronPort-SDR: tnOCkLt8IfVkm5xN3VakaM9NZRaZ4I7vcKaIxPq0JkwL/dnT/xa9qFx9uW0JY5/S7u+lxPJYn9 QgrYykxLQnPw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,350,1589266800"; d="scan'208";a="429708293" Received: from rmarti11-mobl.ger.corp.intel.com (HELO localhost) ([10.252.54.57]) by orsmga004.jf.intel.com with ESMTP; 14 Jul 2020 02:46:40 -0700 From: Jarkko Sakkinen To: linux-kernel@vger.kernel.org Subject: [PATCH v2 0/3] kprobes: Remove MODULE dependency Date: Tue, 14 Jul 2020 12:45:35 +0300 Message-Id: <20200714094625.1443261-1-jarkko.sakkinen@linux.intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Tue, 14 Jul 2020 20:36:21 +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 , Song Liu , Paul Mackerras , Zong Li , Paul Burton , "Aneesh Kumar K.V" , Vincent Whitchurch , Omar Sandoval , Petr Mladek , Brian Gerst , Andy Lutomirski , Thomas Gleixner , Iurii Zaikin , Jiri Kosina , Anup Patel , Philipp Rudo , Vincent Chen , Torsten Duwe , Masami Hiramatsu , Andrew Morton , Mark Rutland , Ingo Molnar , "open list:S390" , Joe Lawrence , Alexandre Ghiti , Helge Deller , John Fastabend , Yonghong Song , Borislav Petkov , Andrii Nakryiko , Vasily Gorbik , "moderated list:ARM PORT" , Daniel Axtens , Damien Le Moal , Stephen Boyd , Sean Christopherson , Martin KaFai Lau , Kefeng Wang , Palmer Dabbelt , Heiko Carstens , Jarkko Sakkinen , Atish Patra , Will Deacon , Masahiro Yamada , Nayna Jain , Krzysztof Kozlowski , Christian Borntraeger , Sami Tolvanen , Mao Han , Marco Elver , Kees Cook , Arnd Bergmann , "Steven Rostedt \(VMware\)" , Babu Moger , Russell King , Ben Dooks , Peter Collingbourne , Tiezhu Yang , Thomas Bogendoerfer , "open list:PARISC ARCHITECTURE" , Jessica Yu , "open list:BPF JIT for MIPS 32-BIT AND 64-BIT" , Thiago Jung Bauermann , Peter Zijlstra , "open list:SPARC + UltraSPARC sparc/sparc64" , "H. Peter Anvin" , Amit Daniel Kachhap , "open list:LIVE PATCHING" , "open list:RISC-V ARCHITECTURE" , Miroslav Benes , Jiri Olsa , Ard Biesheuvel , Vincenzo Frascino , Anders Roxell , Sven Schnelle , Mike Rapoport , "Paul E. McKenney" , Frederic Weisbecker , Paul Walmsley , KP Singh , Gerald Schaefer , Josh Poimboeuf , "open list:BPF JIT for MIPS 32-BIT AND 64-BIT" , "open list:MIPS" , Sergey Senozhatsky , "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" Remove MODULES dependency by creating module subsystem indepdent text_alloc() and text_memfree() to allocate space for executable code. Right now one has to compile modules support only to enable kprobes. This incrases the barrier to use them in test kernels and I'd guess also in some embedded kernels (the former is my use case). v2: * Added the missing cover letter. Jarkko Sakkinen (3): module: Rename module_alloc() to text_alloc() and move to kernel proper module: Add lock_modules() and unlock_modules() kprobes: Flag out CONFIG_MODULES dependent code arch/Kconfig | 1 - arch/arm/kernel/Makefile | 3 +- arch/arm/kernel/module.c | 21 ------- arch/arm/kernel/text.c | 33 +++++++++++ arch/arm64/kernel/Makefile | 2 +- arch/arm64/kernel/module.c | 42 -------------- arch/arm64/kernel/text.c | 54 ++++++++++++++++++ arch/mips/kernel/Makefile | 2 +- arch/mips/kernel/module.c | 9 --- arch/mips/kernel/text.c | 19 +++++++ arch/mips/net/bpf_jit.c | 4 +- arch/nds32/kernel/Makefile | 2 +- arch/nds32/kernel/module.c | 7 --- arch/nds32/kernel/text.c | 12 ++++ arch/nios2/kernel/Makefile | 1 + arch/nios2/kernel/module.c | 19 ------- arch/nios2/kernel/text.c | 34 +++++++++++ arch/parisc/kernel/Makefile | 2 +- arch/parisc/kernel/module.c | 11 ---- arch/parisc/kernel/text.c | 22 ++++++++ arch/powerpc/net/bpf_jit_comp.c | 4 +- arch/riscv/kernel/Makefile | 1 + arch/riscv/kernel/module.c | 12 ---- arch/riscv/kernel/text.c | 20 +++++++ arch/s390/kernel/Makefile | 2 +- arch/s390/kernel/ftrace.c | 2 +- arch/s390/kernel/module.c | 16 ------ arch/s390/kernel/text.c | 23 ++++++++ arch/sparc/kernel/Makefile | 1 + arch/sparc/kernel/module.c | 30 ---------- arch/sparc/kernel/text.c | 39 +++++++++++++ arch/sparc/net/bpf_jit_comp_32.c | 6 +- arch/unicore32/kernel/Makefile | 1 + arch/unicore32/kernel/module.c | 7 --- arch/unicore32/kernel/text.c | 18 ++++++ arch/x86/kernel/Makefile | 1 + arch/x86/kernel/ftrace.c | 4 +- arch/x86/kernel/kprobes/core.c | 4 +- arch/x86/kernel/module.c | 49 ---------------- arch/x86/kernel/text.c | 60 ++++++++++++++++++++ include/linux/module.h | 29 +++++++--- include/linux/moduleloader.h | 4 +- kernel/Makefile | 2 +- kernel/bpf/core.c | 4 +- kernel/kprobes.c | 17 ++++-- kernel/livepatch/core.c | 8 +-- kernel/module.c | 97 +++++++++++++------------------- kernel/text.c | 25 ++++++++ kernel/trace/trace_kprobe.c | 20 ++++++- 49 files changed, 484 insertions(+), 322 deletions(-) create mode 100644 arch/arm/kernel/text.c create mode 100644 arch/arm64/kernel/text.c create mode 100644 arch/mips/kernel/text.c create mode 100644 arch/nds32/kernel/text.c create mode 100644 arch/nios2/kernel/text.c create mode 100644 arch/parisc/kernel/text.c create mode 100644 arch/riscv/kernel/text.c create mode 100644 arch/s390/kernel/text.c create mode 100644 arch/sparc/kernel/text.c create mode 100644 arch/unicore32/kernel/text.c create mode 100644 arch/x86/kernel/text.c create mode 100644 kernel/text.c -- 2.25.1