Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp787229imp; Thu, 21 Feb 2019 11:10:09 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib7NN49yJwvXFvJBRN7spMTas5R/k750rzoTiu6BeUEoTEOmevfYYUVHv1M3f7863XcANKK X-Received: by 2002:a62:445a:: with SMTP id r87mr64628pfa.13.1550776209293; Thu, 21 Feb 2019 11:10:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550776209; cv=none; d=google.com; s=arc-20160816; b=WSPHkTxTlDeTO/nyZwydCmgDfn+Z6luWBw0ARwFqAC+2nRa1CciARt4CU2TWg5vzDQ sH8D0YLHRMc7GIrEDR28yDgmBHbC+IjT1Q+5D6SO8+pJCPC1vKNn7Y+LNM94f9KRK9lF xvdpcRgvxlyNjX+cQS3ULNhXorDOZu2eYL1hSCi6BeK4EaiDppbXU0chg1jdJzUvO+df Ki9n2P+92EWHmM0uZaKcnpmV7A/5/3awb/k8yfwJCunutY3zmBFfIOlrDW+y/zOBHrCW UtEebR9A8DBLPIFtDwQ1HRCLkW18Ah8bUAHuqrj4zvp1nWBeYAY4K4js9ga8bAZTdevn O2Sg== 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=rbzK6VyAdTHyLL0UVQmqZhhndDy082fNAq24IRLMG0k=; b=QomT2zPls9Ji2IZKImisdvdWMlX20UfasXzWXqziDuUThGDxMVxpxiba2pYKJUqCI7 Y1e9DlZAr2OALF7BOdhcL1tOfqYQOJ5LPqWF8B17ZewjZPcX49K+9pd+npjpWqgS+8Rm rm9KXRhHG6sLi9hDwPElpXtZ4UakxSvgbgjszAGuJwLQLVgFCdrocUjeEuBKBH/WDHwg t85oHUj4OW/o/S/RkCeb+HxZoCeWEW52Le5WzU7cgUxIcY5teJpAwsK25P5sTpOA07N8 LDUAvylkPAM6wwxrsgwE+zpo1cPPlQmKiKmsGd51bDSD5Iqrvnd1AL9RMmG93u/mHX6Y wp+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b="Uy9Et/M/"; 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 w4si17363410plp.141.2019.02.21.11.09.53; Thu, 21 Feb 2019 11:10:09 -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="Uy9Et/M/"; 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 S1726756AbfBUTI4 (ORCPT + 99 others); Thu, 21 Feb 2019 14:08:56 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:13127 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726656AbfBUTIw (ORCPT ); Thu, 21 Feb 2019 14:08:52 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4453sv2J2dz9v9DL; Thu, 21 Feb 2019 20:08:51 +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=Uy9Et/M/; 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 okfwyqTc8mtS; Thu, 21 Feb 2019 20:08:51 +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 4453sv1FN4z9v9DG; Thu, 21 Feb 2019 20:08:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1550776131; bh=rbzK6VyAdTHyLL0UVQmqZhhndDy082fNAq24IRLMG0k=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=Uy9Et/M/NrhE9m7eUiTKTVfE8Bh4zDV+1ceZy8gwREg85L6NRROZaTMq+mvAr4+0e 6Ls0OGQv2lhtzhyDv2sLBKYLk7SPsypUoxHB5sa+FagIXdEB2zpoOSK4SNFjHJ3F48 1vuASsKXgIgRqgCFTt30kvQjRgZRLm1m5QHZb8zk= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 31CFA8B86A; Thu, 21 Feb 2019 20:08:51 +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 2wozGkyj2itW; Thu, 21 Feb 2019 20:08:51 +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 05CDA8B852; Thu, 21 Feb 2019 20:08:51 +0100 (CET) Received: by po16846vm.idsi0.si.c-s.fr (Postfix, from userid 0) id B3E336EF61; Thu, 21 Feb 2019 19:08:50 +0000 (UTC) Message-Id: <7007a81052e383f15526153c18f8fd73f45da252.1550775950.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v5 14/16] powerpc/kconfig: make _etext and data areas alignment configurable on Book3s 32 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:50 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Depending on the number of available BATs for mapping the different kernel areas, it might be needed to increase the alignment of _etext and/or of data areas. This patchs allows the user to do it via Kconfig. Signed-off-by: Christophe Leroy --- arch/powerpc/Kconfig | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 640a7cfba9d0..20c4e3a62b90 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -725,16 +725,44 @@ 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_BOOL + bool "Set custom etext alignment" if STRICT_KERNEL_RWX && PPC_BOOK3S_32 + depends on ADVANCED_OPTIONS + help + This option allows you to set the kernel end of text alignment. When + RAM is mapped by blocks, the alignment needs to fit the size and + number of possible blocks. The default should be OK for most configs. + + Say N here unless you know what you are doing. + config ETEXT_SHIFT - int + int "_etext shift" if ETEXT_SHIFT_BOOL + range 17 28 if STRICT_KERNEL_RWX && PPC_BOOK3S_32 default 17 if STRICT_KERNEL_RWX && PPC_BOOK3S_32 default PPC_PAGE_SHIFT + help + On Book3S 32 (603+), IBATs are used to map kernel text. + Smaller is the alignment, greater is the number of necessary IBATs. + +config DATA_SHIFT_BOOL + bool "Set custom data alignment" if STRICT_KERNEL_RWX && PPC_BOOK3S_32 + depends on ADVANCED_OPTIONS + help + This option allows you to set the kernel data alignment. When + RAM is mapped by blocks, the alignment needs to fit the size and + number of possible blocks. The default should be OK for most configs. + + Say N here unless you know what you are doing. config DATA_SHIFT - int + int "Data shift" if DATA_SHIFT_BOOL default 24 if STRICT_KERNEL_RWX && PPC64 + range 17 28 if STRICT_KERNEL_RWX && PPC_BOOK3S_32 default 22 if STRICT_KERNEL_RWX && PPC_BOOK3S_32 default PPC_PAGE_SHIFT + help + On Book3S 32 (603+), DBATs are used to map kernel text and rodata RO. + Smaller is the alignment, greater is the number of necessary DBATs. config FORCE_MAX_ZONEORDER int "Maximum zone order" -- 2.13.3