Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751800AbdHaIbR (ORCPT ); Thu, 31 Aug 2017 04:31:17 -0400 Received: from mail-cys01nam02on0075.outbound.protection.outlook.com ([104.47.37.75]:10896 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751388AbdHaIbL (ORCPT ); Thu, 31 Aug 2017 04:31:11 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@cavium.com; From: Yury Norov To: Mark Rutland , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Yury Norov , Will Deacon , Laura Abbott , Ard Biesheuvel , Catalin Marinas , James Morse Subject: [PATCH] arm64: move TASK_* definitions to Date: Thu, 31 Aug 2017 11:30:50 +0300 Message-Id: <20170831083050.15396-1-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [146.241.194.90] X-ClientProxiedBy: VI1P190CA0004.EURP190.PROD.OUTLOOK.COM (10.165.188.145) To CY1PR07MB1445.namprd07.prod.outlook.com (10.161.167.143) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4506afb0-0040-43ec-b870-08d4f04aa0e9 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:CY1PR07MB1445; X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB1445;3:QSc8POcuN1dxUUQJmbhJFyTwG6VYBluPC1sJsgZwPRfXx0LGenckXhnza77Q4KYoRpfy2px6pTY4JCuvIeCtr/0lHJhU35V0/u6s3E52K8YUAcQLcz2Ak01hKs2pSMZuq5XwN84HumzTs1FF5wo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X91DMjlDv3i9FMBBixr4VY2P3lGa2S9zdRk+aYyqP9vx4BDF9LQvgLOnyffgNmVOwlEKeaQmJiPRagsS/Uunz0N7bKfYkFL5S1sawaEMVw7JG1WsGRcsMgcfqij0hWKpjxiVc0Jbq1D6XQo6RxjVbh96ep704kNLcMZ8K+Yzi9PeTNF1/6Xm5Kjfy+5bGm2c9FCL0JPydWJSPrlCy/+hfjNr5r2khT6SzoHNvo0wXjplEs60uOVgiL4F/dkHP6OHFoJAh/ar6BDHst226sA/4Nv+JDXW1MCKCO6GDtHSx+wp0= X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(166708455590820); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(10201501046)(3002001)(93006095)(6041248)(20161123558100)(20161123562025)(20161123564025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY1PR07MB1445;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY1PR07MB1445; X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB1445;4:IvcQSY7uiQ6p2wolSIU6XdIT3MNozufg8FRGP3Wq68FbonUiLZGGXMDMoveIMcssOrlz/ZImdOn/1nPCtHFmdfmUYLmyKYQHSXPaaiInr8ZINqHhau/jmje+BkyLbSJyyYDbGdaVi0ySkN+KjzknFV2q2WGwmGvpXnxThFafy+tLbR+7/cRq0rXkSw2khxSr7VXd/BRXltehA9OlsTt4IyxCc/A3N/mF6D5WDnfjpe3TPP1aN7RujgMxMvzc+Hj5QD8h5Z7hCSApmfxMIOVYSkgjh7625eo35g6ePM9ePzewVOgtVJdtrg0tvKnRiASU8yygyz4vsHeH7uq4Sesd+Q== X-Forefront-PRVS: 04163EF38A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(6069001)(189002)(199003)(8676002)(50466002)(6496005)(48376002)(36756003)(6486002)(966005)(53936002)(1076002)(6116002)(3846002)(4326008)(72206003)(5660300001)(110136004)(42186005)(101416001)(76506005)(189998001)(50986999)(97736004)(105586002)(42882006)(6666003)(33646002)(106356001)(478600001)(25786009)(6306002)(54906002)(5003940100001)(66066001)(305945005)(7736002)(50226002)(2906002)(68736007)(81156014)(81166006)(47776003)(8936002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR07MB1445;H:localhost;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR07MB1445;23:RP/0bDi1Ft9l4YmHDdOMXRLCpIA0m0QVb/d9MkVgO?= =?us-ascii?Q?j1EkYgcbExqooaQqLMo5ZwzA/iptkvB7e3BllBsF72Rn/8uRT+6lCD8tupVl?= =?us-ascii?Q?m9OAl/msIbJLGV+h3a2MHWBFy9REX5V8Jz3YrgC7cJXav+9PdKE+kZUXCFoy?= =?us-ascii?Q?WsrkvBhEm+Ll70GIoAZHo2jEGh8bhGY5vNEKUv3UDrOmcaMNHJGkbJNYt/LN?= =?us-ascii?Q?803JMnxo+cFlA4Bvtm5uUxLMsHGjX7hOemcJVBHuUITmPmyQK1kYwvTkj6b5?= =?us-ascii?Q?IQaDKmFH19o/y0FG/l0bwS+Z5za7e+YLcEtzimGTHeDPQisk2DJneFBn2BXJ?= =?us-ascii?Q?nVYer3xO/iOJBa1OmoOHhAlzOIzKuax+tkMq17+34pOQmE8Sg0TVdOqN2+b3?= =?us-ascii?Q?T16E73Tptw4I1NbH/GjSDkZyBN4ZjhPZI0AwBn7CBb2AKYbT/ZaG9SkL2pb6?= =?us-ascii?Q?QQnlSMuOlEPLOSrjkxgBlyyX1oXXAL7g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wFhwa9krfi1epU23R6T6AMll+S7/qk/oP38QqAooMfWzjpzuKnliw==;5:2cSfJlwiv/EZglpeswlrAfWecUWOFqANreJyymjRqxg4jotrBfAboAI//peMeYeMShODr/l7JQg0aRB3ZE8Ot2+SXLH4bPNrDP8jPHQckdrUGQfiZU9LYQ1hAYzSG5yZIj9SN2pFIDn7skCWLY/7hw==;24:KCtVk0Pkmg0COjdWyLTQNsXlzd2XJAgd6bJZ382GqS8pwY76xp6ug6U0jopJ4clgYPrBg4ptqE3lpITY1R0tFj3l8oKIkCHJUDyAa7xx5sY=;7:TXFh0ZZ9PQdRLva6m3FKWFC2Be8KE7zdv+omv7EQY3GT+bdBvyRdMFUNndjyJEFeIJLHUIIY2OJhHWXKwZT1UEe1THg1AjgvbUGeZJzF+VepVad0vNQIAdtiZf+cBYXZji7TVoc1gnHN8S9BOHo77JcRRn8GubunB0B9H+0tIDqsW71KlVDIIEabNMp+okD6+jZ+BBg2tVD+7DrffsRkUN+8BexCj1IiVpS3f5QVghw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2017 08:31:07.8687 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB1445 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4044 Lines: 117 ILP32 series [1] introduces the dependency on for TASK_SIZE macro. Which in turn requires , and include , giving a circular dependency, because TASK_SIZE is currently located in . In other architectures, TASK_SIZE is defined in , and moving TASK_SIZE there fixes the problem. Discussion: https://patchwork.kernel.org/patch/9929107/ [1] https://github.com/norov/linux/tree/ilp32-next CC: Will Deacon CC: Laura Abbott Cc: Ard Biesheuvel Cc: Catalin Marinas Cc: James Morse Suggested-by: Mark Rutland Signed-off-by: Yury Norov --- arch/arm64/include/asm/memory.h | 15 --------------- arch/arm64/include/asm/processor.h | 21 +++++++++++++++++++++ arch/arm64/kernel/entry.S | 2 +- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h index 3585a5e26151..87296a6ed1b3 100644 --- a/arch/arm64/include/asm/memory.h +++ b/arch/arm64/include/asm/memory.h @@ -61,8 +61,6 @@ * KIMAGE_VADDR - the virtual address of the start of the kernel image * VA_BITS - the maximum number of bits for virtual addresses. * VA_START - the first kernel virtual address. - * TASK_SIZE - the maximum size of a user space task. - * TASK_UNMAPPED_BASE - the lower boundary of the mmap VM area. */ #define VA_BITS (CONFIG_ARM64_VA_BITS) #define VA_START (UL(0xffffffffffffffff) - \ @@ -77,19 +75,6 @@ #define PCI_IO_END (VMEMMAP_START - SZ_2M) #define PCI_IO_START (PCI_IO_END - PCI_IO_SIZE) #define FIXADDR_TOP (PCI_IO_START - SZ_2M) -#define TASK_SIZE_64 (UL(1) << VA_BITS) - -#ifdef CONFIG_COMPAT -#define TASK_SIZE_32 UL(0x100000000) -#define TASK_SIZE (test_thread_flag(TIF_32BIT) ? \ - TASK_SIZE_32 : TASK_SIZE_64) -#define TASK_SIZE_OF(tsk) (test_tsk_thread_flag(tsk, TIF_32BIT) ? \ - TASK_SIZE_32 : TASK_SIZE_64) -#else -#define TASK_SIZE TASK_SIZE_64 -#endif /* CONFIG_COMPAT */ - -#define TASK_UNMAPPED_BASE (PAGE_ALIGN(TASK_SIZE / 4)) #define KERNEL_START _text #define KERNEL_END _end diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h index 29adab8138c3..7dddca21fc64 100644 --- a/arch/arm64/include/asm/processor.h +++ b/arch/arm64/include/asm/processor.h @@ -19,6 +19,10 @@ #ifndef __ASM_PROCESSOR_H #define __ASM_PROCESSOR_H +#define TASK_SIZE_64 (UL(1) << VA_BITS) + +#ifndef __ASSEMBLY__ + /* * Default implementation of macro that returns current * instruction pointer ("program counter"). @@ -37,6 +41,22 @@ #include #include +/* + * TASK_SIZE - the maximum size of a user space task. + * TASK_UNMAPPED_BASE - the lower boundary of the mmap VM area. + */ +#ifdef CONFIG_COMPAT +#define TASK_SIZE_32 UL(0x100000000) +#define TASK_SIZE (test_thread_flag(TIF_32BIT) ? \ + TASK_SIZE_32 : TASK_SIZE_64) +#define TASK_SIZE_OF(tsk) (test_tsk_thread_flag(tsk, TIF_32BIT) ? \ + TASK_SIZE_32 : TASK_SIZE_64) +#else +#define TASK_SIZE TASK_SIZE_64 +#endif /* CONFIG_COMPAT */ + +#define TASK_UNMAPPED_BASE (PAGE_ALIGN(TASK_SIZE / 4)) + #define STACK_TOP_MAX TASK_SIZE_64 #ifdef CONFIG_COMPAT #define AARCH32_VECTORS_BASE 0xffff0000 @@ -194,4 +214,5 @@ static inline void spin_lock_prefetch(const void *ptr) int cpu_enable_pan(void *__unused); int cpu_enable_cache_maint_trap(void *__unused); +#endif /* __ASSEMBLY__ */ #endif /* __ASM_PROCESSOR_H */ diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index e1c59d4008a8..f5e851eeda4b 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include -- 2.11.0