From patchwork Mon Feb 26 08:19:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 129561 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp3355805lja; Mon, 26 Feb 2018 00:21:53 -0800 (PST) X-Google-Smtp-Source: AH8x226MaoaKmHZRKJY3nvhpIgNdHT6SSkx7pzPOrDGOn5vxiDY/STgTzmgNqMtHVqH98Ail3zLh X-Received: by 10.101.81.132 with SMTP id h4mr7902607pgq.332.1519633313208; Mon, 26 Feb 2018 00:21:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519633313; cv=none; d=google.com; s=arc-20160816; b=xxevric9ok0indKYUCm32mO2o3habHx+Ga/o1Y5KqhwnVBXs3xksmUKtv79Jei2n5T 0BVTQq52JogSD5kax7LxIKdfrlojrpzDS41niPoEAs6KTi6OoWJfN4iOl/FtE42MIppi mlIcFz2JRK1Ua7PUPGOzuX0ksThomT/GMJPK6YJQksiNhw6ZoKYRq+JPXt2qWkLaGSn8 SypA4VpjPan4nC49nugSfONDu5LUvOWRTFBPh7MNh+cOh4bFjfZkmmP0sNMyMBlVwwRm ouO5U7fYIqcBtqR3bzvKQ/tQLO4o9au9nEuNmU8DEPFSO0qNFl7gx4G+C/hltOc05yHr eV9Q== 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 y8si5246129pgp.602.2018.02.26.00.21.52; Mon, 26 Feb 2018 00:21:53 -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 S1752330AbeBZIVt (ORCPT + 28 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(-) -- 2.7.4 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