Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp614484ybl; Wed, 21 Aug 2019 02:54:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqyxcCAkifIY56c6/9uPPuVwezvQy3V/Aqrl7QvaHSEFkkNtKXJDrJh0AA5UyyWZ/hMpO/23 X-Received: by 2002:a62:e109:: with SMTP id q9mr34945566pfh.71.1566381290266; Wed, 21 Aug 2019 02:54:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566381290; cv=none; d=google.com; s=arc-20160816; b=Ql20xDw4ZRhCUjBSEX8+Fw1VbCXFPkPrShQI0pnHl6IQyaztYZIQ4J0HgcAvuP782T KnSJVLduaXN7Fd23rBabtyo1xt3mZRxdX3MR2jhVEq9sx+W9QlcC8gxT2R9KrcgLYYT2 8JsKkfF8fUHsF9qxLlTwBBkzqMObH4AG+voebzVTEZF9/x4ZzEWh6lxqfaPRxFP9ScEB qV+u4mmdjmk3zas4V/o5NOTmk688kdmZDyEoORwqNxzgptwZ/1fVzUz30owSu+NQh5v9 mHmXbQ+uYVPUg95Au7ot5vID1Pc4bOtkzv+YDI4gzRQ2SY6EMLocLjNLbCNBwrmLW09M jgOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=9GQBMdZzkK+IcjfyplTPvKlyAXjm6BOEDq4RomtmFYk=; b=l5JEA59/FFKuvOxbd6kZDLzVDQrnU3XdHoTzTGoP2Bi4kqBWO3gL5XxEnOXAXHtzXE WPr0mzI3jIMZ+WULlVm2bfszaoPSnOKJ85CHa7xD3rv6zJnxHs9FC3xyWy3mweYVx6xw TR3smme2fm0oqvikg4pN/zlUxs7iphX1w9n6bebF7QNYB2Nkn8qzq2eqxNmyxL/MZFnJ O4D7kvqfglmRVFDHvpH8idDxzd8fFAnTseJU+Gcuj/Pb2XP7lCxsIfTg0jL4RA5FY+9o PcuzDDiL7kZS1gyqdPSJXOLYA9+RyJEn1sAwn0BiOK/yjpxvVOFDdxVtdadW7ks/uZQZ tYhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mIMdrRd4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t4si14665975plb.366.2019.08.21.02.54.32; Wed, 21 Aug 2019 02:54:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mIMdrRd4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726724AbfHUIvJ (ORCPT + 99 others); Wed, 21 Aug 2019 04:51:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:55688 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726513AbfHUIvJ (ORCPT ); Wed, 21 Aug 2019 04:51:09 -0400 Received: from linux-8ccs (unknown [92.117.239.114]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CCC0422D6D; Wed, 21 Aug 2019 08:51:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566377468; bh=f3s88lPNH/dY9osiPrQr5NXYKI7UrqZXDNRWl0J91sE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mIMdrRd4TMB+wOCdZPMyZ+4XNb7X70hjjl6xdS3sK94U8F2PBXqHPvQ15uT2YqV+8 vCDT8XjvnFwxgJ84AHxPOVdBVKU+USmKm85TAic0a6IKdhBymW1OqG/YI6gugQ+vZl k7aLEaPTU7qIuMIaBtKccr3a9gPlZTNWUA0peT5U= Date: Wed, 21 Aug 2019 10:51:04 +0200 From: Jessica Yu To: zhe.he@windriver.com Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] modules: page-align module section allocations only for arches supporting strict module rwx Message-ID: <20190821085104.GA8668@linux-8ccs> References: <1566312790-253213-1-git-send-email-zhe.he@windriver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <1566312790-253213-1-git-send-email-zhe.he@windriver.com> X-OS: Linux linux-8ccs 4.12.14-lp150.12.28-default x86_64 User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +++ zhe.he@windriver.com [20/08/19 22:53 +0800]: >From: He Zhe > >We should keep the case of "#define debug_align(X) (X)" for all arches >without CONFIG_HAS_STRICT_MODULE_RWX ability, which would save people, who >are sensitive to system size, a lot of memory when using modules, >especially for embedded systems. This is also the intention of the >original #ifdef... statement and still valid for now. > >Note that this still keeps the effect of the fix of the following commit, >38f054d549a8 ("modules: always page-align module section allocations"), >since when CONFIG_ARCH_HAS_STRICT_MODULE_RWX is enabled, module pages are >aligned. > >Signed-off-by: He Zhe >--- >This patch is based on the top of modules-next tree, 38f054d549a8. I've applied this. Thanks! Jessica > kernel/module.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > >diff --git a/kernel/module.c b/kernel/module.c >index cd8df51..9ee9342 100644 >--- a/kernel/module.c >+++ b/kernel/module.c >@@ -64,9 +64,14 @@ > > /* > * Modules' sections will be aligned on page boundaries >- * to ensure complete separation of code and data >+ * to ensure complete separation of code and data, but >+ * only when CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y > */ >+#ifdef CONFIG_ARCH_HAS_STRICT_MODULE_RWX > # define debug_align(X) ALIGN(X, PAGE_SIZE) >+#else >+# define debug_align(X) (X) >+#endif > > /* If this is set, the section belongs in the init part of the module */ > #define INIT_OFFSET_MASK (1UL << (BITS_PER_LONG-1)) >-- >2.7.4 >