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 C7700CD1288 for ; Wed, 3 Apr 2024 16:11:20 +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:References:To:From:Subject: Cc:Message-Id:Date:Mime-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2WBqxglqTurQAOraXOWSWEu8tyJs1nCD2Yg//aQ/dJo=; b=Lo3Vn81G6G9YJL e7gUb6iHbPxBbN2kLhH+ZPsEH6WQPJS1oyoTwTZ2sQggRH1ifeZKaNmJb0zqVfctgTeBVL7xSDKV8 G4bm9z7tn56ZvlcLBp/Y9ZZUq89hBhipkND26SWtnLR+vr6b/OmFJCS/X21zoU++KkL3XUtRsG1oQ zOcYFnMqCdWvaz3ERFkPRossd3yC8+3vQT6Uv/a6NnGvzGnxVxP1BjVRyk2xFtPqjXfpnJPIJ7qK8 mvSrrd7B8IrLdstl3mKPymNRLwnBEiL5QSxL8qDyEnyNEcL9usJpRkq1BvKaLoPjFz6/BDiIzmBYq 0Y6TPD+p/zt30pfst9zw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rs3Cf-0000000GuRg-2tmn; Wed, 03 Apr 2024 16:11:09 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rs3Cd-0000000GuR4-0iEV for linux-arm-kernel@lists.infradead.org; Wed, 03 Apr 2024 16:11:08 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id DA65CCE1304; Wed, 3 Apr 2024 16:11:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 167ACC433C7; Wed, 3 Apr 2024 16:10:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712160664; bh=nyU0F3ej83LHBArYWvHTmUMX9HPrzUZJ7A/Qsu6qybw=; h=Date:Cc:Subject:From:To:References:In-Reply-To:From; b=gjPhTdrkX6vjBSuS+zaKuaiyoGR/UHwImYh5jczdwkYJGVKzTI8yf2hpvYuYivheF 9cAasLK2QGmMR19zPptwl9h0ZbUmVIMRICLp23Kjwu2VcYz0+/6ZeLdy4bzT59PDc2 l63iyGVEr2qZXLKQT6+2lXJITHV3yENnPasAhVdiRKDDtUBVDx+h/fqVo0cbFGV7t1 u7dlbbHFhMewEnqBVLHRm7gTFbvCN1GWPuV+Llr16q96XepFSjlvVBfIIp39cnhcMb LqkfZqDv4tft76m0tI2QRTWTUo2DDnMJBAR90COOO/G7XwDSHBgrqRskp2gieKHvJt RLvt1DTrQcT8g== Mime-Version: 1.0 Date: Wed, 03 Apr 2024 19:10:58 +0300 Message-Id: Cc: , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH 4/4] kprobes: Remove core dependency on modules From: "Jarkko Sakkinen" To: "Mark Rutland" , X-Mailer: aerc 0.17.0 References: <20240326163624.3253157-1-mark.rutland@arm.com> <20240326163624.3253157-5-mark.rutland@arm.com> In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240403_091107_580673_FBADF534 X-CRM114-Status: GOOD ( 26.20 ) 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 Wed Apr 3, 2024 at 2:20 PM EEST, Mark Rutland wrote: > 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. OK, please put to me to the CC list as I'm not ATM subscribed to the tracing list. BR, Jarkko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel