From patchwork Thu Apr 12 11:10:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 133198 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp1571097ljb; Thu, 12 Apr 2018 04:12:01 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+AcFwPBNCL9u7uDGTu6Iy6XC6tTIy7zt85Q8pdHoABH96Md5IRqDTnUva6v1r10unrhnz1 X-Received: by 2002:a17:902:2941:: with SMTP id g59-v6mr534207plb.55.1523531521524; Thu, 12 Apr 2018 04:12:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523531521; cv=none; d=google.com; s=arc-20160816; b=aeLvmzkzShZTi/Otgk6CUHGD57OPpHgTln8cR8MvxsRwB97MC3cHkkwMN24xSjuiYX QGL0hJW45yS7LQ+VlROJnftCgpPiWmrli9TPcV8qjvRRJeLaVrwcWeTXgAloreSfTMyY sOwC+uXkcAydiYWnT0qUF+tEmndJ0hKD2e9/sjzsLNY/4Zxvqevlu3AHzEWH7eRqSgde t01A8x3/WE9kaO5FrjQXo2kA3GpZ96lPyBu0Qh5lhhV3ugTCRctJbw4nLNTsix6roMsM Dqqh68XV222TxjTLoky6TB6dc/HApFUcR2x3BmMQcGwvzsj/BpJw/EauJcpqADD6Tf8r stkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=+3sCCKjMBn7C5LSrqonMqaDx5R8bOX3vZuU2+nlkar8=; b=W+tbeFvir3qn+8CrDIIxch5imXzRGoXk8MruVg6XMfm/GaAcStC6zTqjZ5c6Vn2u32 ksuAgTXcblH5d/CtOP4pgRq2SeGDwJdGkZggpE0aFhv2YuHTqlbNVE7zl/C1iUHUNoRG TCPLODYD3jKmu3QspzYu2XDM4VXdOWT/2Wlcl34518jG+QoL9qu7TJ9rPCAW1ag3NZpz yT9o36QfkIcZs9HthEyXtyTYa48aah9H5i6C8jUSkXruwxPqSflBokM2hBZ6wxL/HWm0 x3kgyWtbR7i3ikPOJLsP3f8gRzRtDkkc0v4PYJyAJgokpLjL6fJe9DGW7R2lk4d4W9cK PhhQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bg3-v6si3001807plb.118.2018.04.12.04.12.01; Thu, 12 Apr 2018 04:12:01 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752678AbeDLLMA (ORCPT + 11 others); Thu, 12 Apr 2018 07:12:00 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:59316 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752428AbeDLLMA (ORCPT ); Thu, 12 Apr 2018 07:12:00 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 15CD880D; Thu, 12 Apr 2018 04:12:00 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 6D6DA3F24A; Thu, 12 Apr 2018 04:11:58 -0700 (PDT) From: Mark Rutland To: stable@vger.kernel.org Cc: mark.brown@linaro.org, ard.biesheuvel@linaro.org, marc.zyngier@arm.com, will.deacon@arm.com, catalin.marinas@arm.com, ghackmann@google.com, shankerd@codeaurora.org Subject: [PATCH v4.9.y 03/42] arm64: move TASK_* definitions to Date: Thu, 12 Apr 2018 12:10:59 +0100 Message-Id: <20180412111138.40990-4-mark.rutland@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180412111138.40990-1-mark.rutland@arm.com> References: <20180412111138.40990-1-mark.rutland@arm.com> 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 [v4.9: necessary for making USER_DS an inclusive limit] Signed-off-by: Mark Rutland [v4.9 backport] --- arch/arm64/include/asm/memory.h | 15 --------------- arch/arm64/include/asm/processor.h | 21 +++++++++++++++++++++ arch/arm64/kernel/entry.S | 1 + 3 files changed, 22 insertions(+), 15 deletions(-) -- 2.11.0 diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h index 5e3faba689e0..ba917be5565a 100644 --- a/arch/arm64/include/asm/memory.h +++ b/arch/arm64/include/asm/memory.h @@ -60,8 +60,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) - \ @@ -76,19 +74,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 60e34824e18c..4258f4d594b5 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 @@ -192,4 +212,5 @@ int cpu_enable_pan(void *__unused); int cpu_enable_uao(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 8d1600b18562..e10e9f2e48ad 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include