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=-4.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 45C0EC43460 for ; Fri, 7 May 2021 12:50:24 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 E42086143F for ; Fri, 7 May 2021 12:50:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E42086143F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Type: Content-Transfer-Encoding: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=TzL+a6agHmdZtMd/xcHGSzCqLtW4W8gWSyaMDbMagLY=; b=qAXxokq0CpN5R8OmLBNLJT1A2 HjD0O0wjasIQCf9HKTZhsqKu5x8DEZCA2Uo4q7UuVIfFv43mK4l4sc0DbJwSygaASg3O9HrXx9rwB jnRULBmmb05rcdrAFaDaNAGBBrNDHKh0K+oiop3PNyFtNCdh7WaQX7hjOdDjB5TWpIS0s94nEEJta xBu3ibSqiibANrl5TsL5PQdbQSckqqzBx4uF/c+kUUg139RY/fiYbhiKOz/OU2IXqhMKHCGz5rdDN +lXaiq8sX1pdtNa/VlIEVMsVkv+kBsSH+lky25mISw3UrPu9uUklv/Q1qJk3ZNxj03yIXpl2mPEKD vhvgEAMIw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lezuW-0075Io-PM; Fri, 07 May 2021 12:48:52 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lezuV-0075IR-4u for linux-arm-kernel@desiato.infradead.org; Fri, 07 May 2021 12:48:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=u+KuNpDF6qd8C8OKxbLGuNgKoKKf8B6ktrYueEAPEq8=; b=OuR6gXn9CnhePV7KhzwEX9owQt hCGMCBx4SJyLfZpMihwUQa0BST+ggyRRE+owvhfMgtwvR8qN7ij82edXHbvJgZ/BQrC+G+PE0JdFp J0hvOVp69WzOXsJjGPbJMHi0cdYHohXPRm7Z3pYO04fXTebo1gOIlOMz8WLg5yKZYrNnYHJZVK+ix 80M+S4/Z0axH6kXME2Pvhvsa6yCHvU9LtT/CdgQ2e3JmjQW2XYCPtNgZK04Qx0QUEahgHh69M9Yku Bkr664KgagG7SgFS80nWYndM7gj5+REVnXR1uPPhwHoRzXIni5A6wBlfe+cc2IDs8OQqPAd4FsWKP 0xjtAphg==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lezuS-006rTj-Kh for linux-arm-kernel@lists.infradead.org; Fri, 07 May 2021 12:48:49 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id AE5046143F; Fri, 7 May 2021 12:48:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620391728; bh=vaBF2uHP43lFyzQwMbdbFEMpn4rQ8hW21O3qLxQS5Ak=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=iI9XS9nv67rnDiBHeuSryQolG8PeQYxzxPdHrDmq9vP05gI46DB/f/n6kIMO4DKod vNmA1K1fye00nnZ7EeAGHG0zy4LL5wwZHhgQGl9NSocHP7jXvQLU3T7gVQlsQRYpI0 Cw7gF01oC9+5IXOOEHSwvRdTj7aeTIeJ43wNVsPiKZHrExqmi/URQk7bj5nncex8cj tyTkktZVOyTlwVjzIDxVkjHr3wpfMgP8qSmTPsOxFcVzXIOXe0CneIRKrBng1uzmCt znJocDSdswSCf7hNwkhIuFVXrOdC0KRrW4UTjyGOKndKUia6Rq92b5Sj1k4IVNPDZH iy+EbcMxByCHg== Date: Fri, 7 May 2021 14:48:42 +0200 From: Jessica Yu To: Russell King - ARM Linux admin 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: References: <20210507121322.6441-1-jeyu@kernel.org> <20210507123054.GD1336@shell.armlinux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210507123054.GD1336@shell.armlinux.org.uk> X-OS: Linux gunter 5.11.16-1-default x86_64 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210507_054848_733948_14066257 X-CRM114-Status: GOOD ( 14.60 ) 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org +++ Russell King - ARM Linux admin [07/05/21 13:30 +0100]: >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? Yeah, that sounds better. Originally, I had wanted to keep the #ifndef in one place to keep the churn to a minimum. But seeing that we have to patch up ARM too, it's probably the less ugly option now. Let me cook up an alternative patch and resend. Thanks, Jessica _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel