From patchwork Fri Jul 12 05:27:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 168862 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp394351ilk; Thu, 11 Jul 2019 22:29:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqzFlRFrsWpVRHDTzZmcC8Mi+WIwef5p9tKhMMrER4KXBtPtB14GnB2/9WC+qvBWQZFLfUVZ X-Received: by 2002:a17:902:1e7:: with SMTP id b94mr9324200plb.333.1562909349828; Thu, 11 Jul 2019 22:29:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562909349; cv=none; d=google.com; s=arc-20160816; b=lp370Ior2hI5m1WqBGGLQwpzJfItn/dzjPMrNsjkFztydMusqeuPuC8b4vD41A8aRe x9Th4lJE034Mnl/gESl9xJOqVLP/NVX3+RuSQ0vb2Qei+mbyvd9o6Og+M4T2dd30rndd gggb6xfThDgc0DmxY3tYcmj36puqAXzcLvgu6p/RuDiVor5w4jbdszxzJ6JbOShBLZ9W lZM12dzP1koU9bmAI3VRBOFl6LUAIGf2221ZlxTU6EaxAsYgKdU3PSwaRtgC/s5zvOta 5EUcZt8NvrMS5EAISWXaB39eMqYBcPUj66Zhdc4mwWlNHe8XcFf75C8VDvaGu/RxtXOe 1cgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ES6KJwQvdOYp/ZF0zdgUUsDi+h2pkDI/v1RQA0OQPVY=; b=SWq90apWG3zwKlw61Q9KbhSqrAk4xap242jTh9VRwJyA9Q34zoocxLo/NPUPxkQ13N j49qt5OupH5tOBkMob3yMXdRmVp2cV2WNG71rC+qcx+B3X+oP58Ap9tvDXu7yip5+ucX nlyzmKgSH532MGtXyvQBcV658Zz7LQyu7BcLGBpmEsZor8qLvUjQ1KtqEvZEvuESlnox tadyi3Rdwit+dsOowvT3RjLLlff6A94aVeNlz5pUM8XBhxEGg+MKJOrkvc3VqOB6QvNe ZnBJ6kj4IyyRla0S8KtCevaOP+7VGLDhWnW+HHU3s4XEFjr4Dmv5lnEy/gnGL5e2CqN3 FBTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tmwltFcg; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e36si5303191pgm.17.2019.07.11.22.29.09; Thu, 11 Jul 2019 22:29:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=@linaro.org header.s=google header.b=tmwltFcg; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726025AbfGLF3J (ORCPT + 13 others); Fri, 12 Jul 2019 01:29:09 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:33239 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725791AbfGLF3J (ORCPT ); Fri, 12 Jul 2019 01:29:09 -0400 Received: by mail-pg1-f195.google.com with SMTP id m4so4010527pgk.0 for ; Thu, 11 Jul 2019 22:29:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ES6KJwQvdOYp/ZF0zdgUUsDi+h2pkDI/v1RQA0OQPVY=; b=tmwltFcg11BComY5zOAw8U//kYuDnhwsBHYjvOdsbZqTgJ5Id3gL5+Ajk+Nf+99t0v cKAm1+okktz4oy5g8Y9Qt81vbaUbIQ7noZVvtk3HSxB72w6+rHQbtYFoPBtZRofPyPWm aqeqe59em/UaytGZ/SM2ScjksqxhmXmTvYgumAVaWkGB5Z3moF0IqDRMQ0GJOq+ZdauP fqSwueqQT5umFL1tyGAjyiRNH4En80WhQzaeubt+gxBunRvZlUql1u8KzNqFMCLgq5I7 sJ7C7MHmGv4nOeGxmoQgWcXAJ6eF4sgorFYTdfnY55ZMgGVDv3zTCHNCEnJsJUPoYtBh sGvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ES6KJwQvdOYp/ZF0zdgUUsDi+h2pkDI/v1RQA0OQPVY=; b=frlIwpVFxitpz4AJZIiBTHwf78z0tLAnXNEM4h0A1TIyzv5LxVgq0TMxHgfHBBDxsN dUbnEZcUKGy8DYfLcXvHPSCBDvfESuOquWm1Qe15i9itkqplmc7Lfons2pcmfLTzSm4+ yP/wy3JTmpJCoJHQGYHCpMZ/A2MGCEY1NRc+onFLdIOQ4TeDg4sjJO3fJNMlfUyLQjYe /dmJhpniNKdgdB4SGvIZwXqA+ObopUZD8QQd64Ik+0QGHcoAPN8v9P6F8KTfr2eORf+E lRLQcvcPLJJI6hKUuCb59UzsJbbK3fi0NX13lb8s/yMrNXyABYicsCvmFwLUQFcwYCOJ CHag== X-Gm-Message-State: APjAAAWvNAn5Ez2L42jcW2ttyNUV5L28XqJU7Qhyv9mgHpZH99tSAWWF yYnEuOztLsxYspgYgCGgyg70pmZJwgQ= X-Received: by 2002:a17:90a:eb08:: with SMTP id j8mr9632470pjz.72.1562909347630; Thu, 11 Jul 2019 22:29:07 -0700 (PDT) Received: from localhost ([122.172.28.117]) by smtp.gmail.com with ESMTPSA id a25sm6920396pfn.1.2019.07.11.22.29.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Jul 2019 22:29:06 -0700 (PDT) From: Viresh Kumar To: stable@vger.kernel.org, Julien Thierry Cc: Viresh Kumar , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Marc Zyngier , Mark Rutland , Will Deacon , Russell King , Vincent Guittot , mark.brown@arm.com Subject: [PATCH v4.4 V2 03/43] arm64: move TASK_* definitions to Date: Fri, 12 Jul 2019 10:57:51 +0530 Message-Id: X-Mailer: git-send-email 2.21.0.rc0.269.g1a574e7a288b In-Reply-To: References: MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Yury Norov commit eef94a3d09aab437c8c254de942d8b1aa76455e2 upstream. 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 Signed-off-by: Will Deacon Signed-off-by: Viresh Kumar --- 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(-) -- 2.21.0.rc0.269.g1a574e7a288b diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h index b42b930cc19a..959a1e9188fe 100644 --- a/arch/arm64/include/asm/memory.h +++ b/arch/arm64/include/asm/memory.h @@ -43,8 +43,6 @@ * (VA_BITS - 1)) * 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. * The module space lives between the addresses given by TASK_SIZE * and PAGE_OFFSET - it must be within 128MB of the kernel text. */ @@ -58,19 +56,6 @@ #define PCI_IO_END (MODULES_VADDR - 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)) /* * Physical vs virtual RAM address space conversion. These are diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h index d08559528927..75d9ef6c457c 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"). @@ -36,6 +40,22 @@ #include #ifdef __KERNEL__ +/* + * 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 @@ -188,4 +208,5 @@ static inline void spin_lock_prefetch(const void *x) int cpu_enable_pan(void *__unused); +#endif /* __ASSEMBLY__ */ #endif /* __ASM_PROCESSOR_H */ diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index 586326981769..c849be9231bb 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include