Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp817462imp; Wed, 20 Feb 2019 09:30:37 -0800 (PST) X-Google-Smtp-Source: AHgI3IZMU7xUn2a0HPBrMYCw9fyFOZ8UBfeJu6lVhuPvVdaaylpfQPOz5VmIARYVEeBxlAmMBWHX X-Received: by 2002:aa7:9102:: with SMTP id 2mr35501281pfh.179.1550683837894; Wed, 20 Feb 2019 09:30:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550683837; cv=none; d=google.com; s=arc-20160816; b=PGPKikFYhoIgbPX6kQp0Bnx68D0S3TbGdKpYt0V3KAwr6Fct6aWplhCpYKp7XGu03g RK67mK4lKwuPvnZHRx2slmnWolsms7vJz3ZTua68G71nPUy2uwn2buUd2AMyOcAPz8Ix lYOChY/HnxmjZ4bvf7+YlJN2Zz0VjHrUnAkqVji1n/NPWk8Lg2NTY78vVAOB7qXLdEuX xd+z2enPNFtsYpG1UUZ2DZTv9ss/3+idEWeN/RpLTVpinNOa3FCIiMamY0Zn1GboHMWE L5xv1rYPfwfpb7UU0GQ/llMOjLuxStap9YWVz/eckuJ7D9MLN6Y3WT0cKB955e9B0hD9 X4Iw== 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:dkim-signature; bh=02ljiBkmcqq7HcRxan5DntP8oMfjS88LVnUYOxruHkQ=; b=eugofimP867NUhymrFsbLTUbSAF/TfTefeCyNAxAvgAyH7q1CMus6+iICLir+fT7Nd XTS4LCm4blSRTywCd20N44yEPXi++HCuP1hMyt8ZIW1nxZLiRqc+Vhzs0fnjovHXT7WX 9WMePUgazLsQWjLAikvFSvtXxnFjDub5x1oWnEVpmcns+WJYQE3+/41YidgdycBfNFAI CuL7mO2qniwGKXq+bn0xmTmhfC2j1t7MVM9uD7uE3Mj0OPnwWJORmt9ZayOYF/urvyhN 3DEvHkfNIuYigFA651FtjrUGsMp3hADHj3uSyYrE/nJN/Yfs3W50iHW8gF4562fiGabQ fDkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=oVnb10L8; 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 u69si13421629pgd.161.2019.02.20.09.30.22; Wed, 20 Feb 2019 09:30: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; dkim=pass header.i=@c-s.fr header.s=mail header.b=oVnb10L8; 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 S1726876AbfBTR3X (ORCPT + 99 others); Wed, 20 Feb 2019 12:29:23 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:40285 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726607AbfBTR3U (ORCPT ); Wed, 20 Feb 2019 12:29:20 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 444PjS658Fz9v0vj; Wed, 20 Feb 2019 18:29:16 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=oVnb10L8; dkim-adsp=pass; dkim-atps=neutral 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 GN2hB2Mnp6_7; Wed, 20 Feb 2019 18:29:16 +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 444PjS52Q7z9v0g0; Wed, 20 Feb 2019 18:29:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1550683756; bh=02ljiBkmcqq7HcRxan5DntP8oMfjS88LVnUYOxruHkQ=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=oVnb10L8b/JsRKSOLnBXO+wZq+/UeftjNTjxbi+gBxvuACmljC6ubSjfDGWjX3gCM D5zSMXS5UbUnGyXyCzbf0KDqHDnSuRK4zqpTiQ4DNtzchCzOoOgvqdJEGJp5ervqzi d6kKIU/U2DS2ILPIaU3OvJBkhBU8uwbgzOLVZ48w= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 5C0758B84F; Wed, 20 Feb 2019 18:29:18 +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 MiCQfnASt3gM; Wed, 20 Feb 2019 18:29:18 +0100 (CET) Received: from po16846vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.231.2]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 43CBE8B84A; Wed, 20 Feb 2019 18:29:18 +0100 (CET) Received: by po16846vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 37D1F6E85E; Wed, 20 Feb 2019 17:29:18 +0000 (UTC) Message-Id: <463a85f5e8ace8971d5b3f0772ab611698425880.1550648295.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v3 11/16] 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: Wed, 20 Feb 2019 17:29:18 +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 417e52a27f63..edef40a2b446 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -725,6 +725,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 c3efb972c8c1..060a1acd7c6d 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