From patchwork Fri Jun 14 03:07:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 10994133 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B8B4914C0 for ; Fri, 14 Jun 2019 03:13:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A7BA426E3E for ; Fri, 14 Jun 2019 03:13:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9C4A527CF9; Fri, 14 Jun 2019 03:13:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1A85A26E3E for ; Fri, 14 Jun 2019 03:13:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=689Yf0rtjuxjEcdGmJWRXAj12w3oTx4SmOEwRUf2p6w=; b=sYCPTlnTfidaCQ i4p4uBW8ZDrWqzPNO4PFIUNC/3fjYwcfQJBbuwSATNoVE1LjPHD4e2L4DdFUaAD4Fhq5ZwJiIh540 aE2owY7vlegUVlhUKIyPhf4nIlRv2D9gwjNmFHabJy5c+ggtZjn/OEm/n9XsoEIccX4AkMD7Sw8c+ zoxpZ+gT1UWdVgF2AZ7daP9OXMTm3JEHOrJT8856LFjKHmvNBc3hWj3YNVYqWIXMkqPHJ2PSgCdkS GxI+5Fl+MPXRdpW2hi3BHb7Qxf4qBXLdBcLi4MfI8/4FiQmLNUwlfggQqhlx0QYEL+pHTv4dGues2 RiDQJJ3+lRgYKKyh7W3Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hbcex-0001GO-1p; Fri, 14 Jun 2019 03:13:47 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hbcdK-000055-H5 for linux-arm-kernel@lists.infradead.org; Fri, 14 Jun 2019 03:12:08 +0000 Received: by mail-pg1-x541.google.com with SMTP id s27so684936pgl.2 for ; Thu, 13 Jun 2019 20:12:06 -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=vMZj+hWBB8samdoJQ8dZeG0SPfvI6Nq94YHPh34WYvc=; b=qZTuV61HYt+mNEoxm47Arta+AvblJfpAXxtCf6Cy9Jj4OYBf9JT63spIYo7L/86a4z olm2CItSss1P/Qsl2f/9/OaCleH8YTNnNXwpDUztGYGNa04ADDli3hNx2gRukRBDF3cr puxxMINy4NvrMY1CXjJVzEazG7hiYpIv7CatQve8ja1UZsQ7Ju1j2lOgy8gB90Lvdqqv zNhIv9wDAvvABCdcA9VWXC4vifs1DMd9mZo7zIj7T7O5Ka3VgZX6An0RXDF54mBMCm6T eQSXsZ1vxFBb1gplCgCAZkENcz2Tandan0zhMICsIWRTrQAESmvjuwRE539lEHy1LqhE QahQ== 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=vMZj+hWBB8samdoJQ8dZeG0SPfvI6Nq94YHPh34WYvc=; b=OvHWYlDMbx6eOrag0Y0mqkGSk78vf3YH/zZA7fw6b3ZlX/uPpfpbqU5Zr4XjSozNzQ 0WMUzAE3ZFkTzRCbOTw2VFE0uGiz6cNLUbkdb7CptDfdzD4vVPU/YwcToYt3tuW+GDPK rJg8pqq6O3uYcrMrBv4ZKLZoTH3EOcfkiMu33PYLlczM7Cu8QDKU5lubnNbiSJLZoli/ J9fXQLMF5cL0qRumw29Wa/Wn3NFwdol2vyGUan9LLGgFilXFatj+MnofDeRXPPp0ycsp Zo2jQChilUkckA1Rw7hUDbUBk4wvIZMesW+X7KsVakMYu+11FNkJ9gIlQPOw1b9eh7ah +Ptg== X-Gm-Message-State: APjAAAXM32/ysaLDIh2Xr2VZTvCHLym91F96CsRoxXWXXOYCMRe5EhFx tKgwho7HjTHBZoV0WvA3Iz33jHXAwoc= X-Google-Smtp-Source: APXvYqwqQ0yet8UnqoAPnV8oW4AYrTo0RPoqjWqgR9pZ3WiS8ZrQ3aC619e+Z6q0Bmnv8ia0BZHdNA== X-Received: by 2002:aa7:8acb:: with SMTP id b11mr95598816pfd.115.1560481924997; Thu, 13 Jun 2019 20:12:04 -0700 (PDT) Received: from localhost ([122.172.66.84]) by smtp.gmail.com with ESMTPSA id z2sm579066pgg.58.2019.06.13.20.12.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Jun 2019 20:12:04 -0700 (PDT) From: Viresh Kumar To: linux-arm-kernel@lists.infradead.org, Julien Thierry Subject: [PATCH v4.4 04/45] arm64: move TASK_* definitions to Date: Fri, 14 Jun 2019 08:37:47 +0530 Message-Id: <8e205c0d0442af886efa2996d6149ce9dbec39ce.1560480942.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.21.0.rc0.269.g1a574e7a288b In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190613_201206_611803_104D8982 X-CRM114-Status: GOOD ( 14.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Marc Zyngier , Viresh Kumar , Will Deacon , stable@vger.kernel.org, mark.brown@arm.com, Catalin Marinas , Russell King Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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 b1126eea73ae..12d5b2b97f04 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"). @@ -35,6 +39,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 @@ -186,4 +206,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