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=-5.0 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 B309AC433ED for ; Fri, 7 May 2021 12:31:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6C6996145E for ; Fri, 7 May 2021 12:31:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236685AbhEGMcC (ORCPT ); Fri, 7 May 2021 08:32:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233468AbhEGMcB (ORCPT ); Fri, 7 May 2021 08:32:01 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48F82C061574 for ; Fri, 7 May 2021 05:31:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=B4OtqkGn285R60YiVqH6q3onTS7Lt7KKKKLOjRmOeV4=; b=ZVM8/wMyekdiVYbyNXTg1uy4i Jl9IXPuzvxmeenmYLQI3/GzdtqOmodJRHf3id3FjDcg0GLbXtEyCBabEt7NX8KPj1fc3wRhfdH7/b pDaOUqdSLBtQ6Hc+sESBUbdYJYuIIwCBjv39DEa8RxSA51brI5orDHfPHCVTGPuQ/H+dEgfhfyJ+s cOvWVc6JVxK6B85MVUKbK9YrNll44QU623fa3W3oYDP97SzMAUoBe9VciVWx4RSPWRCX2vgc2z5yV faklLezAiSxTrdHCXSGc22xLy5WZtprqEgqqdnUx3QVJLiekKU+0B/MFqp7iQK1GHnFSdbxcoY/MT zuuAASpAg==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:43756) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lezdA-0003iW-2O; Fri, 07 May 2021 13:30:56 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1lezd9-0005lq-GX; Fri, 07 May 2021 13:30:55 +0100 Date: Fri, 7 May 2021 13:30:55 +0100 From: Russell King - ARM Linux admin To: Jessica Yu Cc: Peter Zijlstra , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ARM: module: treat exit sections the same as init sections when !CONFIG_MODULE_UNLOAD Message-ID: <20210507123054.GD1336@shell.armlinux.org.uk> References: <20210507121322.6441-1-jeyu@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210507121322.6441-1-jeyu@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: Russell King - ARM Linux admin Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 07, 2021 at 02:13:22PM +0200, Jessica Yu wrote: > Dynamic code patching (alternatives, jump_label and static_call) can > have sites in __exit code, even if __exit is never executed. Therefore > __exit must be present at runtime, at least for as long as __init code is. ... > Previously, the module loader never loaded the exit sections in the first > place when CONFIG_MODULE_UNLOAD=n. Commit 33121347fb1c ("module: treat exit > sections the same as init sections when !CONFIG_MODULE_UNLOAD") addressed > the issue by having the module loader load the exit sections and then making > __exit identify as __init for !MODULE_UNLOAD. Then, since they are treated > like init sections, they will be also discarded after init. > > That commit satisfied the above requirements for jump_labels and > static_calls by modifying the checks in the core module_init_section() > function in kernel/module.c to include exit sections. However, ARM > overrides these and implements their own module_{init,exit}_section() > functions. Add a similar check for exit sections to ARM's > module_init_section() function so that all arches are on the same page. Shouldn't the module core code itself be doing: module_init_section(name) || module_exit_section(name) itself when CONFIG_MODULE_UNLOAD is not set, rather than pushing this logic down into every module_init_section() implementation? -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!