Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp240949imp; Thu, 21 Feb 2019 00:06:07 -0800 (PST) X-Google-Smtp-Source: AHgI3IaVDWD8HXqNp3CWb22HNNejNVjnoifueiR8s51th/uKUOLTtnP5UhUrKlnSkF2K2SOhcm6P X-Received: by 2002:a63:1a62:: with SMTP id a34mr9568321pgm.60.1550736367424; Thu, 21 Feb 2019 00:06:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550736367; cv=none; d=google.com; s=arc-20160816; b=spX/aRYyaqIJfBJ/T2uv+ZVOpMZPAHAiPrgJpbflXtgV247DyOO4zAGMjeUDJBlYpm TEtLtRidn2uaUojg5JGRbvZ4oGnUpjvi+m39bPFGKujNFwRsyyTUcaZCzkuVBGIhV6kI UDgpHhBGpHTP3Vk9YLY6DZFtHeznofoZbYdCzeZWpjhLdMdo4iIXzD/N67ze/6KcVaod VAP6nPGbQrSEO9+P8GX0X8Vh94mfAeII1Zng9jmlf2p0dFV/KKiwW5hsu/58K2MHQ/U8 4w82MnWK6vB61+V75NV4M4wP27NILrcpLOX1jrMMrqXgF6+aoZJ7W82UWU63PsjJAAX3 H+Mg== 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=VCE7+cdv3QvptEXKiW07jK1lErjsalasiNnLTVxWl58=; b=CpH4pxbMPpIQ3y8sSNFYWJ6rtm1giqTizo+b13BMr8JSZM/oD4B5fXQ/TBiSAxhVDg kr22Obdg8aOFb63l2belf+YdYJHSZcgRhhxwAggMry3+7R6DaTci3Y4xB3lrnXsXzIUb Kfg7vfSmJh0HTMdVKeGJT5Zi4qXa9SalZfFb2UjLSjZBx8DMONsmC2RL7qV+0w0veDZQ zuq+sryRA51BiNPMlptIyOaA7CqUZX9u6PwfgmfCW/LgcffVVJowenP5hhKID4LFTAlq SaVY2PwP0/YcxBax75VFMargfcFZUQG1Djl37pmGRZ15e3y7Q6m8AjvV7+aDCYU7ECLS ALeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b="b+Gz4/E0"; 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 w6si2627329pgp.129.2019.02.21.00.05.52; Thu, 21 Feb 2019 00:06:07 -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="b+Gz4/E0"; 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 S1727497AbfBUIFG (ORCPT + 99 others); Thu, 21 Feb 2019 03:05:06 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:18195 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727436AbfBUIFB (ORCPT ); Thu, 21 Feb 2019 03:05:01 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 444n7v3D5pz9vJgH; Thu, 21 Feb 2019 09:04:59 +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=b+Gz4/E0; 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 5ccK_XVBJf1d; Thu, 21 Feb 2019 09:04:59 +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 444n7v28Xnz9vJg1; Thu, 21 Feb 2019 09:04:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1550736299; bh=VCE7+cdv3QvptEXKiW07jK1lErjsalasiNnLTVxWl58=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=b+Gz4/E0j6L7G75bk3vW2Mt31LaGlLjfEa00jr2jF/R9GdichbkPqXs4O8v5tBU6D jvF8wAypFRLf5Vw+9NITQDmMQ6iJpAmpbO7Z5tdrxFwzPRtQZ1yVlOPq1FAeuLAbsE SRz9+0fp3LaXo7rLeMCGdX3cg3nKGmWxeQVZdaEY= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 2DAC18B78F; Thu, 21 Feb 2019 09:05:00 +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 v6AT6uE_GGdF; Thu, 21 Feb 2019 09:05:00 +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 067378B75B; Thu, 21 Feb 2019 09:05:00 +0100 (CET) Received: by po16846vm.idsi0.si.c-s.fr (Postfix, from userid 0) id C59E16E866; Thu, 21 Feb 2019 08:04:59 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v4 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 08:04:59 +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 01ac44d5d4b4..79a50276437c 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 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