From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 90D4720EB; Sat, 20 Apr 2024 07:35:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713598501; cv=none; b=NEJIQASP3Ux0IRBMlmLbRO1DwkcnRXowI+ccL0hzeoDZKOOfU8/RMng5REfSY15sIvPAzNlS6mvu+TCUmmUhN+BFpwP0C0eVoaEMIstQgbhVDGRD4clvXzmN0U3EWwboWhDps0TZVFWeJrUzCcWe2A99ek+g3H3KIYLKt2LVpNI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713598501; c=relaxed/simple; bh=YQ9KfPtm5Gq9HYepBoPJrHlxAcwZYbjakD5piFpGBCI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XLxl6jNNEst2IqF5XyMzMm82Xg8yJj4+7+iWllu0I+9/7J/iwHLHvBsh8AuzwxMOwekkExF8wcmFVqi/Cg8qyyN3l4WwEDpA1H12Ki3o1gYt2QeHg7FwgCnr1Vof9BkqkBnCwGTNYSzmQ6N+NLAkyoeBp99rBZLphCBV9icN8UQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HstIwZ4k; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HstIwZ4k" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4FB26C113CE; Sat, 20 Apr 2024 07:34:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713598501; bh=YQ9KfPtm5Gq9HYepBoPJrHlxAcwZYbjakD5piFpGBCI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HstIwZ4kXYt594F3dTAKefbjqk59LgLelJ4wfeugjHKdccg9U6QSsThvKUdOj6kpr cxBq3QX4LKiL1ekSZ4hlwHrg2Qo19wEMdjfcoqJC1hKB987QXK8Wq3oegsKl2zZTfI 0ahwnVH2zTwg0WMFDB5bQY2DWepkh6sfONxxfG+SnniZiiLcfZnS8gmDD4/taXFr4a gNoyuT99b/yZU19nTHh4Wm4L6MjmbQoSYrPwuVYcHB2CCTGISZcttYnTQA36iEYp8c S1AEVNMPdbCPnyweb2c/fhVBUzL5EOQDTyFmN+U+fX6hUzHCENDjnN15hBAkD3dzc1 3OfMh4fyGR7Ag== Date: Sat, 20 Apr 2024 10:33:38 +0300 From: Mike Rapoport To: Christophe Leroy Cc: Masami Hiramatsu , "linux-kernel@vger.kernel.org" , Alexandre Ghiti , Andrew Morton , =?iso-8859-1?Q?Bj=F6rn_T=F6pel?= , Catalin Marinas , "David S. Miller" , Dinh Nguyen , Donald Dutile , Eric Chanudet , Heiko Carstens , Helge Deller , Huacai Chen , Kent Overstreet , Luis Chamberlain , Mark Rutland , Michael Ellerman , Nadav Amit , Palmer Dabbelt , Puranjay Mohan , Rick Edgecombe , Russell King , Song Liu , Steven Rostedt , Thomas Bogendoerfer , Thomas Gleixner , Will Deacon , "bpf@vger.kernel.org" , "linux-arch@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-mips@vger.kernel.org" , "linux-mm@kvack.org" , "linux-modules@vger.kernel.org" , "linux-parisc@vger.kernel.org" , "linux-riscv@lists.infradead.org" , "linux-s390@vger.kernel.org" , "linux-trace-kernel@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "loongarch@lists.linux.dev" , "netdev@vger.kernel.org" , "sparclinux@vger.kernel.org" , "x86@kernel.org" Subject: Re: [PATCH v4 14/15] kprobes: remove dependency on CONFIG_MODULES Message-ID: References: <20240411160051.2093261-1-rppt@kernel.org> <20240411160051.2093261-15-rppt@kernel.org> <20240418061615.5fad23b954bf317c029acc4d@gmail.com> <321def3e-8bf1-4920-92dd-037b20f1272d@csgroup.eu> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <321def3e-8bf1-4920-92dd-037b20f1272d@csgroup.eu> On Fri, Apr 19, 2024 at 03:59:40PM +0000, Christophe Leroy wrote: > > > Le 19/04/2024 à 17:49, Mike Rapoport a écrit : > > Hi Masami, > > > > On Thu, Apr 18, 2024 at 06:16:15AM +0900, Masami Hiramatsu wrote: > >> Hi Mike, > >> > >> On Thu, 11 Apr 2024 19:00:50 +0300 > >> Mike Rapoport wrote: > >> > >>> From: "Mike Rapoport (IBM)" > >>> > >>> kprobes depended on CONFIG_MODULES because it has to allocate memory for > >>> code. > >>> > >>> Since code allocations are now implemented with execmem, kprobes can be > >>> enabled in non-modular kernels. > >>> > >>> Add #ifdef CONFIG_MODULE guards for the code dealing with kprobes inside > >>> modules, make CONFIG_KPROBES select CONFIG_EXECMEM and drop the > >>> dependency of CONFIG_KPROBES on CONFIG_MODULES. > >> > >> Thanks for this work, but this conflicts with the latest fix in v6.9-rc4. > >> Also, can you use IS_ENABLED(CONFIG_MODULES) instead of #ifdefs in > >> function body? We have enough dummy functions for that, so it should > >> not make a problem. > > > > The code in check_kprobe_address_safe() that gets the module and checks for > > __init functions does not compile with IS_ENABLED(CONFIG_MODULES). > > I can pull it out to a helper or leave #ifdef in the function body, > > whichever you prefer. > > As far as I can see, the only problem is MODULE_STATE_COMING. > Can we move 'enum module_state' out of #ifdef CONFIG_MODULES in module.h ? There's dereference of 'struct module' there: (*probed_mod)->state != MODULE_STATE_COMING) { ... } so moving out 'enum module_state' won't be enough. > > > >> -- > >> Masami Hiramatsu > > -- Sincerely yours, Mike. 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 416A6C001CC for ; Sat, 20 Apr 2024 07:35:25 +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=qFSrjWfKB1a8vXsVibvRtbM2HouFElj11BAXkVw3Egg=; b=euJjgL8Am1WRPp ye6/D3fKo4xndd0Ieb8ZpRllT6zWlb7+ZtOROdeZROZM8FBU/pHEAnMuqOySVkyrTufKpQTVrLFtj AjS3mpl/4ujdOa51DIlJw3bcYk77vjrbVJymubZfZA+8W979mI+QXSvCsm1+/S1XHFHqcYURmhcH5 acEhjUjBeWqdnwJlOworhqgfPUpioDumsK+YdTJhh4LbZomBSd5QJ990/gRDy0f9O3Jx2YOsgGdR5 J07dV6ZlTynk45Uu16cK7fYQHNDE/dF98YqI6MFAkeLQMVQLacV8W+AO5750FNNyi0pruOk2+bpK0 1jhGbGvmwzMT3JKDza5w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ry5Fe-0000000813o-1QC9; Sat, 20 Apr 2024 07:35:10 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ry5Fa-0000000811X-1uGs; Sat, 20 Apr 2024 07:35:08 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id F15A6CE10BD; Sat, 20 Apr 2024 07:35:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4FB26C113CE; Sat, 20 Apr 2024 07:34:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713598501; bh=YQ9KfPtm5Gq9HYepBoPJrHlxAcwZYbjakD5piFpGBCI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HstIwZ4kXYt594F3dTAKefbjqk59LgLelJ4wfeugjHKdccg9U6QSsThvKUdOj6kpr cxBq3QX4LKiL1ekSZ4hlwHrg2Qo19wEMdjfcoqJC1hKB987QXK8Wq3oegsKl2zZTfI 0ahwnVH2zTwg0WMFDB5bQY2DWepkh6sfONxxfG+SnniZiiLcfZnS8gmDD4/taXFr4a gNoyuT99b/yZU19nTHh4Wm4L6MjmbQoSYrPwuVYcHB2CCTGISZcttYnTQA36iEYp8c S1AEVNMPdbCPnyweb2c/fhVBUzL5EOQDTyFmN+U+fX6hUzHCENDjnN15hBAkD3dzc1 3OfMh4fyGR7Ag== Date: Sat, 20 Apr 2024 10:33:38 +0300 From: Mike Rapoport To: Christophe Leroy Cc: Masami Hiramatsu , "linux-kernel@vger.kernel.org" , Alexandre Ghiti , Andrew Morton , =?iso-8859-1?Q?Bj=F6rn_T=F6pel?= , Catalin Marinas , "David S. Miller" , Dinh Nguyen , Donald Dutile , Eric Chanudet , Heiko Carstens , Helge Deller , Huacai Chen , Kent Overstreet , Luis Chamberlain , Mark Rutland , Michael Ellerman , Nadav Amit , Palmer Dabbelt , Puranjay Mohan , Rick Edgecombe , Russell King , Song Liu , Steven Rostedt , Thomas Bogendoerfer , Thomas Gleixner , Will Deacon , "bpf@vger.kernel.org" , "linux-arch@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-mips@vger.kernel.org" , "linux-mm@kvack.org" , "linux-modules@vger.kernel.org" , "linux-parisc@vger.kernel.org" , "linux-riscv@lists.infradead.org" , "linux-s390@vger.kernel.org" , "linux-trace-kernel@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "loongarch@lists.linux.dev" , "netdev@vger.kernel.org" , "sparclinux@vger.kernel.org" , "x86@kernel.org" Subject: Re: [PATCH v4 14/15] kprobes: remove dependency on CONFIG_MODULES Message-ID: References: <20240411160051.2093261-1-rppt@kernel.org> <20240411160051.2093261-15-rppt@kernel.org> <20240418061615.5fad23b954bf317c029acc4d@gmail.com> <321def3e-8bf1-4920-92dd-037b20f1272d@csgroup.eu> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <321def3e-8bf1-4920-92dd-037b20f1272d@csgroup.eu> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240420_003506_925334_13B62FC6 X-CRM114-Status: GOOD ( 25.37 ) X-BeenThere: linux-riscv@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="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Fri, Apr 19, 2024 at 03:59:40PM +0000, Christophe Leroy wrote: > = > = > Le 19/04/2024 =E0 17:49, Mike Rapoport a =E9crit=A0: > > Hi Masami, > > = > > On Thu, Apr 18, 2024 at 06:16:15AM +0900, Masami Hiramatsu wrote: > >> Hi Mike, > >> > >> On Thu, 11 Apr 2024 19:00:50 +0300 > >> Mike Rapoport wrote: > >> > >>> From: "Mike Rapoport (IBM)" > >>> > >>> kprobes depended on CONFIG_MODULES because it has to allocate memory = for > >>> code. > >>> > >>> Since code allocations are now implemented with execmem, kprobes can = be > >>> enabled in non-modular kernels. > >>> > >>> Add #ifdef CONFIG_MODULE guards for the code dealing with kprobes ins= ide > >>> modules, make CONFIG_KPROBES select CONFIG_EXECMEM and drop the > >>> dependency of CONFIG_KPROBES on CONFIG_MODULES. > >> > >> Thanks for this work, but this conflicts with the latest fix in v6.9-r= c4. > >> Also, can you use IS_ENABLED(CONFIG_MODULES) instead of #ifdefs in > >> function body? We have enough dummy functions for that, so it should > >> not make a problem. > > = > > The code in check_kprobe_address_safe() that gets the module and checks= for > > __init functions does not compile with IS_ENABLED(CONFIG_MODULES). > > I can pull it out to a helper or leave #ifdef in the function body, > > whichever you prefer. > = > As far as I can see, the only problem is MODULE_STATE_COMING. > Can we move 'enum module_state' out of #ifdef CONFIG_MODULES in module.h = ? There's dereference of 'struct module' there: = (*probed_mod)->state !=3D MODULE_STATE_COMING) { ... } so moving out 'enum module_state' won't be enough. = > > = > >> -- = > >> Masami Hiramatsu > > = -- = Sincerely yours, Mike. _______________________________________________ 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 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 A8249C4345F for ; Sat, 20 Apr 2024 07:35:26 +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=AXso/GXE5RQwFql8JO1dpXokn9vjSffrkfmDw5Eb0r4=; b=v47OYhJjAfXbgr QTi2URPhReDiTZvnyeQuFHDgQPXjcCFz1kQhxSc/eGQa6gM6R5v/sYARPBZisF4tr7xM2cAFHe5MY 6v1Z/lvZS1rnVTERr7FaNS9Y1pn2FLpu7q6siM5/25wsLCDN8OFothTd0wvH6jBsKVAvub1CXiQbc zfVu4Rw+JiPTTvcez6kxaYrrV879ERRR401U+jfeZVblTCUMusWdkH0b7ckfMPgv1kxiyKEY14F+G e1YCbw+8oJ9yc5sWhu14DPCQ6usIKAu+PswPKF/IH//nt8Sph6htQZ2NlE2pHOkNGR6/cNhBdQLGK zUp4HGCBf/VASuJB/KvA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ry5Fd-0000000813F-2MSP; Sat, 20 Apr 2024 07:35:09 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ry5Fa-0000000811X-1uGs; Sat, 20 Apr 2024 07:35:08 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id F15A6CE10BD; Sat, 20 Apr 2024 07:35:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4FB26C113CE; Sat, 20 Apr 2024 07:34:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713598501; bh=YQ9KfPtm5Gq9HYepBoPJrHlxAcwZYbjakD5piFpGBCI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HstIwZ4kXYt594F3dTAKefbjqk59LgLelJ4wfeugjHKdccg9U6QSsThvKUdOj6kpr cxBq3QX4LKiL1ekSZ4hlwHrg2Qo19wEMdjfcoqJC1hKB987QXK8Wq3oegsKl2zZTfI 0ahwnVH2zTwg0WMFDB5bQY2DWepkh6sfONxxfG+SnniZiiLcfZnS8gmDD4/taXFr4a gNoyuT99b/yZU19nTHh4Wm4L6MjmbQoSYrPwuVYcHB2CCTGISZcttYnTQA36iEYp8c S1AEVNMPdbCPnyweb2c/fhVBUzL5EOQDTyFmN+U+fX6hUzHCENDjnN15hBAkD3dzc1 3OfMh4fyGR7Ag== Date: Sat, 20 Apr 2024 10:33:38 +0300 From: Mike Rapoport To: Christophe Leroy Cc: Masami Hiramatsu , "linux-kernel@vger.kernel.org" , Alexandre Ghiti , Andrew Morton , =?iso-8859-1?Q?Bj=F6rn_T=F6pel?= , Catalin Marinas , "David S. Miller" , Dinh Nguyen , Donald Dutile , Eric Chanudet , Heiko Carstens , Helge Deller , Huacai Chen , Kent Overstreet , Luis Chamberlain , Mark Rutland , Michael Ellerman , Nadav Amit , Palmer Dabbelt , Puranjay Mohan , Rick Edgecombe , Russell King , Song Liu , Steven Rostedt , Thomas Bogendoerfer , Thomas Gleixner , Will Deacon , "bpf@vger.kernel.org" , "linux-arch@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-mips@vger.kernel.org" , "linux-mm@kvack.org" , "linux-modules@vger.kernel.org" , "linux-parisc@vger.kernel.org" , "linux-riscv@lists.infradead.org" , "linux-s390@vger.kernel.org" , "linux-trace-kernel@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "loongarch@lists.linux.dev" , "netdev@vger.kernel.org" , "sparclinux@vger.kernel.org" , "x86@kernel.org" Subject: Re: [PATCH v4 14/15] kprobes: remove dependency on CONFIG_MODULES Message-ID: References: <20240411160051.2093261-1-rppt@kernel.org> <20240411160051.2093261-15-rppt@kernel.org> <20240418061615.5fad23b954bf317c029acc4d@gmail.com> <321def3e-8bf1-4920-92dd-037b20f1272d@csgroup.eu> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <321def3e-8bf1-4920-92dd-037b20f1272d@csgroup.eu> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240420_003506_925334_13B62FC6 X-CRM114-Status: GOOD ( 25.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="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Apr 19, 2024 at 03:59:40PM +0000, Christophe Leroy wrote: > = > = > Le 19/04/2024 =E0 17:49, Mike Rapoport a =E9crit=A0: > > Hi Masami, > > = > > On Thu, Apr 18, 2024 at 06:16:15AM +0900, Masami Hiramatsu wrote: > >> Hi Mike, > >> > >> On Thu, 11 Apr 2024 19:00:50 +0300 > >> Mike Rapoport wrote: > >> > >>> From: "Mike Rapoport (IBM)" > >>> > >>> kprobes depended on CONFIG_MODULES because it has to allocate memory = for > >>> code. > >>> > >>> Since code allocations are now implemented with execmem, kprobes can = be > >>> enabled in non-modular kernels. > >>> > >>> Add #ifdef CONFIG_MODULE guards for the code dealing with kprobes ins= ide > >>> modules, make CONFIG_KPROBES select CONFIG_EXECMEM and drop the > >>> dependency of CONFIG_KPROBES on CONFIG_MODULES. > >> > >> Thanks for this work, but this conflicts with the latest fix in v6.9-r= c4. > >> Also, can you use IS_ENABLED(CONFIG_MODULES) instead of #ifdefs in > >> function body? We have enough dummy functions for that, so it should > >> not make a problem. > > = > > The code in check_kprobe_address_safe() that gets the module and checks= for > > __init functions does not compile with IS_ENABLED(CONFIG_MODULES). > > I can pull it out to a helper or leave #ifdef in the function body, > > whichever you prefer. > = > As far as I can see, the only problem is MODULE_STATE_COMING. > Can we move 'enum module_state' out of #ifdef CONFIG_MODULES in module.h = ? There's dereference of 'struct module' there: = (*probed_mod)->state !=3D MODULE_STATE_COMING) { ... } so moving out 'enum module_state' won't be enough. = > > = > >> -- = > >> Masami Hiramatsu > > = -- = Sincerely yours, Mike. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 DEDBFC4345F for ; Sat, 20 Apr 2024 07:35:51 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=HstIwZ4k; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4VM3GG3lZtz3d2m for ; Sat, 20 Apr 2024 17:35:50 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=HstIwZ4k; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=145.40.73.55; helo=sin.source.kernel.org; envelope-from=rppt@kernel.org; receiver=lists.ozlabs.org) Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4VM3FP035Cz3bZ3 for ; Sat, 20 Apr 2024 17:35:04 +1000 (AEST) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id F15A6CE10BD; Sat, 20 Apr 2024 07:35:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4FB26C113CE; Sat, 20 Apr 2024 07:34:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713598501; bh=YQ9KfPtm5Gq9HYepBoPJrHlxAcwZYbjakD5piFpGBCI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HstIwZ4kXYt594F3dTAKefbjqk59LgLelJ4wfeugjHKdccg9U6QSsThvKUdOj6kpr cxBq3QX4LKiL1ekSZ4hlwHrg2Qo19wEMdjfcoqJC1hKB987QXK8Wq3oegsKl2zZTfI 0ahwnVH2zTwg0WMFDB5bQY2DWepkh6sfONxxfG+SnniZiiLcfZnS8gmDD4/taXFr4a gNoyuT99b/yZU19nTHh4Wm4L6MjmbQoSYrPwuVYcHB2CCTGISZcttYnTQA36iEYp8c S1AEVNMPdbCPnyweb2c/fhVBUzL5EOQDTyFmN+U+fX6hUzHCENDjnN15hBAkD3dzc1 3OfMh4fyGR7Ag== Date: Sat, 20 Apr 2024 10:33:38 +0300 From: Mike Rapoport To: Christophe Leroy Subject: Re: [PATCH v4 14/15] kprobes: remove dependency on CONFIG_MODULES Message-ID: References: <20240411160051.2093261-1-rppt@kernel.org> <20240411160051.2093261-15-rppt@kernel.org> <20240418061615.5fad23b954bf317c029acc4d@gmail.com> <321def3e-8bf1-4920-92dd-037b20f1272d@csgroup.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <321def3e-8bf1-4920-92dd-037b20f1272d@csgroup.eu> 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: Mark Rutland , "x86@kernel.org" , Catalin Marinas , "linux-mips@vger.kernel.org" , Song Liu , Donald Dutile , Luis Chamberlain , "sparclinux@vger.kernel.org" , "linux-riscv@lists.infradead.org" , Nadav Amit , "linux-arch@vger.kernel.org" , "linux-s390@vger.kernel.org" , Helge Deller , Huacai Chen , Russell King , "linux-trace-kernel@vger.kernel.org" , Alexandre Ghiti , Will Deacon , Heiko Carstens , Steven Rostedt , "loongarch@lists.linux.dev" , Thomas Gleixner , Masami Hiramats u , "bpf@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Thomas Bogendoerfer , "linux-parisc@vger.kernel.org" , Puranjay Mohan , "linux-mm@kvack.org" , "netdev@vger.kernel.org" , Kent Overstreet , "linux-kernel@vger.kernel.org" , Dinh Nguyen , =?iso-8859-1?Q?Bj=F6rn_T=F6pel?= , Eric Chanudet , Palmer Dabbelt , Andrew Morton , Rick Edgecombe , "linuxppc-dev@lists.ozlabs.org" , "David S. Miller" , "linux-modules@vger.kernel.org" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Fri, Apr 19, 2024 at 03:59:40PM +0000, Christophe Leroy wrote: > > > Le 19/04/2024 à 17:49, Mike Rapoport a écrit : > > Hi Masami, > > > > On Thu, Apr 18, 2024 at 06:16:15AM +0900, Masami Hiramatsu wrote: > >> Hi Mike, > >> > >> On Thu, 11 Apr 2024 19:00:50 +0300 > >> Mike Rapoport wrote: > >> > >>> From: "Mike Rapoport (IBM)" > >>> > >>> kprobes depended on CONFIG_MODULES because it has to allocate memory for > >>> code. > >>> > >>> Since code allocations are now implemented with execmem, kprobes can be > >>> enabled in non-modular kernels. > >>> > >>> Add #ifdef CONFIG_MODULE guards for the code dealing with kprobes inside > >>> modules, make CONFIG_KPROBES select CONFIG_EXECMEM and drop the > >>> dependency of CONFIG_KPROBES on CONFIG_MODULES. > >> > >> Thanks for this work, but this conflicts with the latest fix in v6.9-rc4. > >> Also, can you use IS_ENABLED(CONFIG_MODULES) instead of #ifdefs in > >> function body? We have enough dummy functions for that, so it should > >> not make a problem. > > > > The code in check_kprobe_address_safe() that gets the module and checks for > > __init functions does not compile with IS_ENABLED(CONFIG_MODULES). > > I can pull it out to a helper or leave #ifdef in the function body, > > whichever you prefer. > > As far as I can see, the only problem is MODULE_STATE_COMING. > Can we move 'enum module_state' out of #ifdef CONFIG_MODULES in module.h ? There's dereference of 'struct module' there: (*probed_mod)->state != MODULE_STATE_COMING) { ... } so moving out 'enum module_state' won't be enough. > > > >> -- > >> Masami Hiramatsu > > -- Sincerely yours, Mike.