Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2839826imu; Thu, 29 Nov 2018 11:03:37 -0800 (PST) X-Google-Smtp-Source: AFSGD/VSXZuMpBLo/Sy+ZJMYOvKiwqSgcZgSODIw4f0yfVPeGj/VbaHq8YwrSasuf5kWxQYzUW5n X-Received: by 2002:a17:902:9691:: with SMTP id n17mr2698660plp.9.1543518217312; Thu, 29 Nov 2018 11:03:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543518217; cv=none; d=google.com; s=arc-20160816; b=XBxiVdxLbvxg0KLUyMTiwE/TzODZsFTRCCoe39FidWkRewwVd2Lc1jPqPeR9gvc3cT E5z54XG97X5ESaYHI0Si8Im+OrlhjL9cM6cL9pjVhtvVOpr97MfdLcWzjcs0DlU4T0nM rNudlZXecPQJA0iKzJ/tYjTDNoJhTTtkZUeZc0wYr0YOMbBcCOv0vfDqcsIIYQ83ilGt vtxOl/fvAHjMAcHaa/dH1jV6bp1qwgjnw9nCpraDc4Dc4Cnktl7J/cXQdUxjh0AC426q EsSO4Z6i3wPd1uMS506YZg6QOB6dQr0p70EhlHsCQfulQSrSdDCji13RjJlTI/ABIRdB fqRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:references :in-reply-to:message-id; bh=1A5oIJc9AvBcdpRMGWal8RSRLIKDMq1OW5jQD01dGDU=; b=hXIOo64wEz+nT/+TgxVIfe7LL4HlizYh/ZViKmOnPu+5PEjb47Zb4IebdY/QYbqsE5 nMn4wmisGYD1gkGlfrgP8Zhir+TbvSz7QWjcB37JbaOzvLGJeVxiWKfMFTcT62uyfU8Y WImFtkRdTRC2dLAHDyVC2eMo2BIxvNGfNG7YTqt6ovU6GSIlJ+Jyx1dXb9M6R8NwQ1Om yZAoZYpwetKNmiBkfUUF8yWK4wUK2RpFEQK6AB01Avhw/CZtsqRPYqtOixUof3/hX/W/ aeYDU0uaJDc9XQcZHclLhxreewuSoEl7mXD5qvZTseyiLpeU9irQHY2bjm0QuFLyqBmn Sizw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q13si2300264pgj.86.2018.11.29.11.03.15; Thu, 29 Nov 2018 11:03:37 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727026AbeK3GHF (ORCPT + 99 others); Fri, 30 Nov 2018 01:07:05 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:60183 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726891AbeK3GHE (ORCPT ); Fri, 30 Nov 2018 01:07:04 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 435RgD4sPqz9v12C; Thu, 29 Nov 2018 20:00:40 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id AHGpkFLAGPJx; Thu, 29 Nov 2018 20:00:40 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 435RgD4L9Sz9v11y; Thu, 29 Nov 2018 20:00:40 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 740288B912; Thu, 29 Nov 2018 20:00:39 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id dP4yoVakuMrk; Thu, 29 Nov 2018 20:00:39 +0100 (CET) Received: from po14163vm.idsi0.si.c-s.fr (unknown [192.168.232.3]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 4F30C8B90F; Thu, 29 Nov 2018 20:00:33 +0100 (CET) Received: by po14163vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 8ADAC69B63; Thu, 29 Nov 2018 19:00:32 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v1 11/13] powerpc/kconfig: define CONFIG_DATA_SHIFT and CONFIG_ETEXT_SHIFT To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , j.neuschaefer@gmx.net Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Thu, 29 Nov 2018 19:00:32 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org CONFIG_STRICT_KERNEL_RWX requires a special alignment for DATA for some subarches. Today it is just defined as an #ifdef in vmlinux.lds.S In order to get more flexibility, this patch moves the definition of this alignment in Kconfig On some subarches, CONFIG_STRICT_KERNEL_RWX will require a special alignment of _etext. This patch also adds a configuration item for it in Kconfig Signed-off-by: Christophe Leroy --- arch/powerpc/Kconfig | 9 +++++++++ arch/powerpc/kernel/vmlinux.lds.S | 9 +++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 4a81a80d0635..f3e420f3f1d7 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -728,6 +728,15 @@ config THREAD_SHIFT Used to define the stack size. The default is almost always what you want. Only change this if you know what you are doing. +config ETEXT_SHIFT + int + default PPC_PAGE_SHIFT + +config DATA_SHIFT + int + default 24 if STRICT_KERNEL_RWX && PPC64 + default PPC_PAGE_SHIFT + config FORCE_MAX_ZONEORDER int "Maximum zone order" range 8 9 if PPC64 && PPC_64K_PAGES diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S index 1148c3c60c3b..d210dcfe915a 100644 --- a/arch/powerpc/kernel/vmlinux.lds.S +++ b/arch/powerpc/kernel/vmlinux.lds.S @@ -12,11 +12,8 @@ #include #include -#if defined(CONFIG_STRICT_KERNEL_RWX) && !defined(CONFIG_PPC32) -#define STRICT_ALIGN_SIZE (1 << 24) -#else -#define STRICT_ALIGN_SIZE PAGE_SIZE -#endif +#define STRICT_ALIGN_SIZE (1 << CONFIG_DATA_SHIFT) +#define ETEXT_ALIGN_SIZE (1 << CONFIG_ETEXT_SHIFT) ENTRY(_stext) @@ -131,7 +128,7 @@ SECTIONS } :kernel - . = ALIGN(PAGE_SIZE); + . = ALIGN(ETEXT_ALIGN_SIZE); _etext = .; PROVIDE32 (etext = .); -- 2.13.3