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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D10C1CD128A for ; Wed, 3 Apr 2024 11:21:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=1Ks66FsEMSzek6Cexa1MJvbgSLQETiIhHy1Ko5HLhHg=; b=pEZT2eAzPtCAWZ H8le2EaAdpHDhL9VHuMBgHNyI/IxUTv2r/fZx8yYosCEGtDTdppi7GVJafsgS82rjjPPZzh6mH+kv sWDUygz/jNUeosN61DTVmTcSsHE6Z/ZxQVzH09VL/mYmYD7SxgHgG9l6utDAuf1hJBoRgETbHjA5s 27AOaDl+Y7JZeFYQwzwDkmua0X83eLBXThH3rSyvvIB66hK/usv8FPMPE64/YjjlXenc3/mDZYM5S vHlWtSKkwOl+r8hZOUJbTzeTcdONLCW64rdGvmi6zoJ4Z4rsNOVvNJhp3Ievtj9X/e8a1/ggPIpSe T568q9pWhbMJ/4C3P2SQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rryfh-0000000FkNn-0pKz; Wed, 03 Apr 2024 11:20:49 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rryfd-0000000FkMv-3HqL for linux-arm-kernel@lists.infradead.org; Wed, 03 Apr 2024 11:20:47 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 132641007; Wed, 3 Apr 2024 04:21:16 -0700 (PDT) Received: from FVFF77S0Q05N (unknown [10.57.16.212]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 84A8A3F64C; Wed, 3 Apr 2024 04:20:41 -0700 (PDT) Date: Wed, 3 Apr 2024 12:20:38 +0100 From: Mark Rutland To: linux-kernel@vger.kernel.org Cc: agordeev@linux.ibm.com, anil.s.keshavamurthy@intel.com, aou@eecs.berkeley.edu, bp@alien8.de, catalin.marinas@arm.com, dave.hansen@linux.intel.com, davem@davemloft.net, gor@linux.ibm.com, hca@linux.ibm.com, jarkko@kernel.org, jcalvinowens@gmail.com, linux-arm-kernel@lists.infradead.org, mhiramat@kernel.org, mingo@redhat.com, mpe@ellerman.id.au, naveen.n.rao@linux.ibm.com, palmer@dabbelt.com, paul.walmsley@sifive.com, tglx@linutronix.de, will@kernel.org Subject: Re: [PATCH 4/4] kprobes: Remove core dependency on modules Message-ID: References: <20240326163624.3253157-1-mark.rutland@arm.com> <20240326163624.3253157-5-mark.rutland@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240326163624.3253157-5-mark.rutland@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240403_042045_897249_47CB76AC X-CRM114-Status: GOOD ( 22.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Mar 26, 2024 at 04:36:24PM +0000, Mark Rutland wrote: > From: Jarkko Sakkinen > > Tracing with kprobes while running a monolithic kernel is currently > impossible because KPROBES depends on MODULES. While this dependency is > necessary when KPROBES_USE_MODULE_ALLOC=y, all the other module-specific > code only exist to handle the case when MODULES=y, and can be hidden > behind ifdeffery. > > Add the necessary ifdeffery, and remove the dependency on MODULES=N when > KPROBES_USE_MODULE_ALLOC=n. > > Currently this allows kprobes to be used when CONFIG_MODULES=n on arm64 > and riscv, and other architectures can enable support by implementing > their own kprobes_alloc_insn_page() and kprobes_free_insn_page() which > do not depend on MODULES. > > Signed-off-by: Jarkko Sakkinen > Link: https://lore.kernel.org/all/20240326012102.27438-1-jarkko@kernel.org/ > [Mark: Remove execmem changes, depend on !KPROBES_USE_MODULE_ALLOC] > Signed-off-by: Mark Rutland > Cc: Anil S Keshavamurthy > Cc: David S. Miller > Cc: Jarkko Sakkinen > Cc: Masami Hiramatsu > Cc: Naveen N. Rao > --- > arch/Kconfig | 2 +- > kernel/kprobes.c | 12 +++++++++++- > kernel/trace/trace_kprobe.c | 15 +++++++++++++-- > 3 files changed, 25 insertions(+), 4 deletions(-) > > diff --git a/arch/Kconfig b/arch/Kconfig > index 85bb59f7b8c07..cf43de9ffb5b9 100644 > --- a/arch/Kconfig > +++ b/arch/Kconfig > @@ -52,7 +52,7 @@ config GENERIC_ENTRY > > config KPROBES > bool "Kprobes" > - depends on MODULES > + depends on MODULES || !KPROBES_USE_MODULE_ALLOC Whoops; that should be: depends on MODULES || HAVE_KPROBES_ALLOC ... with similar fixups in the commit message to describe HAVE_KPROBES_ALLOC rather than KPROBES_USE_MODULE_ALLOC (which does not exist in any version of the series that got sent to the list). I'll send a v2 with that fixed (and the other changes from Jarkko's v7 base patch) once I've locally tested that for architectures with and without HAVE_KPROBES_ALLOC. Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel