Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp788399imp; Thu, 21 Feb 2019 11:11:22 -0800 (PST) X-Google-Smtp-Source: AHgI3IZLYl8jvoLtE60Jw/2KDG6gCQSIFpxsTTu1zJZMncbd+cQAJsTZ6Oo/GduVx/BX/lp97PXd X-Received: by 2002:a17:902:7d89:: with SMTP id a9mr69535plm.33.1550776282859; Thu, 21 Feb 2019 11:11:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550776282; cv=none; d=google.com; s=arc-20160816; b=Jwtkz0zU8qWy/Xd3oqLGnN2OaPSTCw+IXbBuTF3YBD11jq+8GLQtZMNqs/Uo9C4pLu oyKS0lehjIXAH3LAT/k2CjwbzvIJS+4zuRUY2zhBnoPzhDd6/byQaxJf0jaP/f05XPz0 W1fSmVfXHEsvMypTwqW4H//VyIW7HMiHoUNwECBGZ3fCCevPVAtbSWho97OcsXIgyfPK iDKu5ozc9w+4FaTPc4cP5WsHscOvEsBdpkmz2ltMMNCn1TZgLyjeGp18Pe1+7XbetwRz W4S9ZfW8rJGVCJlEz8SQ0ZOnSobSPYqmhTS9cu0CbSdIWJCnxrSOt63eGy1GQxKnUUB6 RRmA== 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=Wega3z32XZzBPzzO4CpRHcy4LtLp8e6cKQ/xDVYl5InTJK3tL0hL8vF5bqlVrj6cnJ tUp25Bneu2tm64uoc+RGJWNbvcOY38+qXwcRqsGwv12MLL2Y+iuoL7tisg6GweMulvd+ j+db+9jvF0nWtRsNDc8QQ6bccD/q5QvHTSPn6U3LDLUn8ASHvMDLW+uYsrwJ6gl2/Aex k8D+uZUxavEswWMhbMUi2Et4QbmSuM3r34LN32y4LUoZZF1AEjE9zx2ZmYhzmJ74808d swOsi/7iWkT7N4hOmQDE9IeYQIIEBgnav1MtFrnscGqNKYGXjVx+qcjz1yXn4fJklzkO Uirw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=VxhFAYYL; 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 t13si20839602pgu.81.2019.02.21.11.11.07; Thu, 21 Feb 2019 11:11:22 -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=VxhFAYYL; 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 S1726665AbfBUTIw (ORCPT + 99 others); Thu, 21 Feb 2019 14:08:52 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:29818 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726632AbfBUTIu (ORCPT ); Thu, 21 Feb 2019 14:08:50 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4453sr1Htxz9v9DH; Thu, 21 Feb 2019 20:08:48 +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=VxhFAYYL; 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 hqxJ4phjcETZ; Thu, 21 Feb 2019 20:08:48 +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 4453sr038yz9v9DG; Thu, 21 Feb 2019 20:08:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1550776128; bh=02ljiBkmcqq7HcRxan5DntP8oMfjS88LVnUYOxruHkQ=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=VxhFAYYLSmGaGQFcOpAYoWY/29Q0q+2/me9UNpzKdEfakVHh6882R3TWGPpSOHLdA xDXw/umTYysAumVokx8C9hrUWfpzf0XYgR9eZCPDdDn3hpvqNNL6tS5kFb0/5/Jbo3 LBOLZBy3ESUEjQbnQKpHUWRiP2pLbXXb8tt0Q16M= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 079F48B86A; Thu, 21 Feb 2019 20:08:48 +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 851xaWu4prLf; Thu, 21 Feb 2019 20:08:47 +0100 (CET) Received: from po16846vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id CFA618B852; Thu, 21 Feb 2019 20:08:47 +0100 (CET) Received: by po16846vm.idsi0.si.c-s.fr (Postfix, from userid 0) id A3A626EF61; Thu, 21 Feb 2019 19:08:47 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v5 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: Thu, 21 Feb 2019 19:08:47 +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