Received: by 10.223.185.116 with SMTP id b49csp3488256wrg; Mon, 26 Feb 2018 00:24:10 -0800 (PST) X-Google-Smtp-Source: AH8x2256vwf99g90jdIgzw60E+UaE7PLpMGwKs2RV43Jk7kUjavcd3+qycxD/9YNRmbADuuARAIm X-Received: by 10.99.147.91 with SMTP id w27mr7405865pgm.208.1519633450496; Mon, 26 Feb 2018 00:24:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519633450; cv=none; d=google.com; s=arc-20160816; b=eQ6J4xMY/01x1sJrSdzu1f6XbZG2X5/B17qnV4rqUo/RCiAA0mQcBcSF0vcqAujcmn Se4gevS9rcHbuy38zDZldc2foJPwx/+O0WIu+EPRthPP4gm54PjVqcYnGr2roiWLvI8x PBAjUCk00TkBFWYKzcE6A4dcBkS0bIzhvwEC7AGJFs8orRN2afXoL952dfGLl3eqdPlN 5wwISiIt8R9VhFqzD3JwWf9qqHnU/w9ufcbeX08OPndZ8uUMcYJ39HAYLDiJMYwsHv9u zO8lfbwNBoP528M1l5PTtkeGtLkYZPsJUX5yAoXADYf7jd4CiSD5YWMB4PsKc6VEPvpI /zfg== 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:dkim-signature:arc-authentication-results; bh=5lK+ndVcYpPWXEM1yPl0Iv5G8Ce26XZw/h8DlWl28GE=; b=0EJcydULThujJ+r/x++eyngeEYGQ5vPbx2l9Y0r6wnt2WA97W/z40J065rTMwOhFtG RWhaEuX+To3sLZcq0LuS79OCxBvqmYZiyWSQ3wdwt8BySewV6Raa3yNHYhxfjs72Lll8 C/GuN4bimedIRKJ6++WQTRjdRP2A9aVmHXUz1SSPsnYgghz5McvuVb6XmYNvMlzzmhgM mehIBDvTmZlTnMjoceqlYfenSSnUz8SlutGT3dqT3r2M8VnuE6+XGiXkS9NfHR1J8ONo mK0h0NJLJiIWeT0ctyrA+Q+1YIH21hfQYEXmovodsigGig9byie0h+kgBMjtV91NywF4 gjiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QGcL7VmY; 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; 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 94-v6si6399369pla.215.2018.02.26.00.23.56; Mon, 26 Feb 2018 00:24:10 -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=@linaro.org header.s=google header.b=QGcL7VmY; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752326AbeBZIVt (ORCPT + 99 others); Mon, 26 Feb 2018 03:21:49 -0500 Received: from mail-pl0-f67.google.com ([209.85.160.67]:45598 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752310AbeBZIVo (ORCPT ); Mon, 26 Feb 2018 03:21:44 -0500 Received: by mail-pl0-f67.google.com with SMTP id v9-v6so6856828plp.12 for ; Mon, 26 Feb 2018 00:21:44 -0800 (PST) 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; bh=5lK+ndVcYpPWXEM1yPl0Iv5G8Ce26XZw/h8DlWl28GE=; b=QGcL7VmYMOjABfHXklK5mYK9Dx7YInSEoSATxs//pCEz7WUGTamW7UV+x66x9HSRMw iauYrcy/MXQzEOYauWTMvPW9VusudthSGjfMtu74XEqMDdgR9OF6Tsy7dDy69BTQNYhp 1xp/MLFRWjS8cdCmBjPFO4PWd/ONRBVPz2e0I= 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; bh=5lK+ndVcYpPWXEM1yPl0Iv5G8Ce26XZw/h8DlWl28GE=; b=caqr8pft2B6tGSN7hh68e+c/twsTJtNBnkpxhvJOSrYOdacXHz4QwhwRfmxm+Iphvc PjDJM0csnou0CuOoD34/jM9ftHsFhLn1cx1iFZQAlfXkyhyO2Rh7+soIQbPPiIue8M7e KbD+dxyNFaY1YA6DrBcqv3luIZImxHDEKu+saVeHpv/rVa7gYgaPWNUKLT5AVkvse25D I0ZHFBVnmhe3IPR+o+rsjX4EhlDxO1a5FXvo1SgxvEqGETUIrbHJt3Y7RPNo/CcPUx3e ib6mdxT2gMiSMYs4Ghg58YaKWyKApMgx6XBsnNbqXFb5ZKINWpCrKlwxKD7CU8XXhAl7 f1bA== X-Gm-Message-State: APf1xPDpB9t3f2InltLUG0VS27Ykcu8SbmvqmSa4LqHcjNSGBfsyT5Oo nGPyOENzTnKPRkUUNH9xffcUOg== X-Received: by 2002:a17:902:7796:: with SMTP id o22-v6mr10074745pll.215.1519633303792; Mon, 26 Feb 2018 00:21:43 -0800 (PST) Received: from localhost.localdomain (176.122.172.82.16clouds.com. [176.122.172.82]) by smtp.gmail.com with ESMTPSA id o86sm1422706pfi.87.2018.02.26.00.21.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 26 Feb 2018 00:21:43 -0800 (PST) From: Alex Shi To: Marc Zyngier , Will Deacon , Ard Biesheuvel , Catalin Marinas , stable@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated list:ARM64 PORT (AARCH64 ARCHITECTURE)), linux-kernel@vger.kernel.org (open list) Cc: Yury Norov , Laura Abbott , James Morse Subject: [PATCH 05/52] arm64: move TASK_* definitions to Date: Mon, 26 Feb 2018 16:19:39 +0800 Message-Id: <1519633227-29832-6-git-send-email-alex.shi@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519633227-29832-1-git-send-email-alex.shi@linaro.org> References: <1519633227-29832-1-git-send-email-alex.shi@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yury Norov commit eef94a3d09aab 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: Alex Shi Conflicts: no ptrace.h in arch/arm64/kernel/entry.S --- 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 53211a0..269b979 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) << VA_BITS) @@ -74,19 +72,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 60e3482..4258f4d 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 b4c7db4..478f0fe 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.7.4