From patchwork Mon Aug 7 18:35:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 109586 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp1952647qge; Mon, 7 Aug 2017 11:38:26 -0700 (PDT) X-Received: by 10.99.95.200 with SMTP id t191mr1361743pgb.237.1502131105941; Mon, 07 Aug 2017 11:38:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502131105; cv=none; d=google.com; s=arc-20160816; b=F+eKe9EuKE/AUJE06mD9Enpa3z0Eem2kveuxNLwuA337wH0BS83B+lVhuJqRxC1ERS EemHcuGaWpJzTdQP7nmFk2nN8jmgLjhnof8Lz/7kmhV6Euv73gfyLbrXtOYJdnQ1Aurf 7GNTKRET3kn7d7Aqu1PsSgMJ+swJYLUy2hotbLPZMpRVqZ0Wj0Nx+L3FgJqtZ3sVOIsB p6+ksIit3KbdFN+U23A6NggaHHl35vS5HzJS++2OeirwFCjW1DmHU7uzxoOkn15HmVfK zO5TxjNUxfGF4pLFS8bppAnf4rNqY2i5Kq9rsV0tnYssX3/jIBXOJm/eDp46cYdLB37C IyAg== 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=2XsXVAq47T0IHR4AfXhnYMH+4vq/hKa7nsX+P2Jtqy0=; b=KZkp4K3HrHi6/P1AImZQY6voOmBPkGgxJxYxrrIiLIedP2EI655qtmpL/bTk87sd4S Yrs6qxbAQ3A17WH0pOTy8WPK7XZustevd4i2QSIcftSd6eooT1y56k0TjVRr0E92WO0m wtORW1FykJPr7EX33siZYvUY2vtWKpO954dRllH2Uf35hTasgBLCJMYMaTaptQg9tsr0 +zAit5mgokcx2gQos6gBlUUBkyoJwfb/L7+yqqi5bZIKFJO0OZeiUcE1ik9y/o/8NwCm d1WvH6UavekqvbczF0a0pPYhm1DvfArNjEd4QmIsYBnsIOLzfTAkuZU9eSFokeh4qPMe EKhw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b3si4879932pgc.821.2017.08.07.11.38.25; Mon, 07 Aug 2017 11:38:25 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752101AbdHGSiX (ORCPT + 25 others); Mon, 7 Aug 2017 14:38:23 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:52584 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752069AbdHGSiV (ORCPT ); Mon, 7 Aug 2017 14:38:21 -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 AD46E165D; Mon, 7 Aug 2017 11:38:20 -0700 (PDT) Received: from leverpostej.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 BDE323F577; Mon, 7 Aug 2017 11:38:18 -0700 (PDT) From: Mark Rutland To: linux-arm-kernel@lists.infradead.org Cc: ard.biesheuvel@linaro.org, catalin.marinas@arm.com, james.morse@arm.com, labbott@redhat.com, linux-kernel@vger.kernel.org, luto@amacapital.net, mark.rutland@arm.com, matt@codeblueprint.co.uk, will.deacon@arm.com, kernel-hardening@lists.openwall.com, keescook@chromium.org Subject: [PATCH 05/14] arm64: clean up THREAD_* definitions Date: Mon, 7 Aug 2017 19:35:56 +0100 Message-Id: <1502130965-18710-6-git-send-email-mark.rutland@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1502130965-18710-1-git-send-email-mark.rutland@arm.com> References: <1502130965-18710-1-git-send-email-mark.rutland@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently we define THREAD_SIZE and THREAD_SIZE order separately, with the latter dependent on particular CONFIG_ARM64_*K_PAGES definitions. This is somewhat opaque, and will get in the way of future modifications to THREAD_SIZE. This patch cleans this up, defining both in terms of a common THREAD_SHIFT, and using PAGE_SHIFT to calculate THREAD_SIZE_ORDER, rather than using a number of definitions dependent on config symbols. Subsequent patches will make use of this to alter the stack size used in some configurations. At the same time, these are moved into , which will avoid circular include issues in subsequent patches. To ensure that existing code isn't adversely affected, is updated to transitively include these definitions. Signed-off-by: Mark Rutland Cc: Ard Biesheuvel Cc: Catalin Marinas Cc: James Morse Cc: Laura Abbott Cc: Will Deacon --- arch/arm64/include/asm/memory.h | 8 ++++++++ arch/arm64/include/asm/thread_info.h | 9 +-------- 2 files changed, 9 insertions(+), 8 deletions(-) -- 1.9.1 diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h index 77d55dc..8ab4774 100644 --- a/arch/arm64/include/asm/memory.h +++ b/arch/arm64/include/asm/memory.h @@ -102,6 +102,14 @@ #define KASAN_SHADOW_SIZE (0) #endif +#define THREAD_SHIFT 14 + +#if THREAD_SHIFT >= PAGE_SHIFT +#define THREAD_SIZE_ORDER (THREAD_SHIFT - PAGE_SHIFT) +#endif + +#define THREAD_SIZE (UL(1) << THREAD_SHIFT) + /* * Memory types available. */ diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h index b29ab0e..aa04b73 100644 --- a/arch/arm64/include/asm/thread_info.h +++ b/arch/arm64/include/asm/thread_info.h @@ -23,18 +23,11 @@ #include -#ifdef CONFIG_ARM64_4K_PAGES -#define THREAD_SIZE_ORDER 2 -#elif defined(CONFIG_ARM64_16K_PAGES) -#define THREAD_SIZE_ORDER 0 -#endif - -#define THREAD_SIZE 16384 - #ifndef __ASSEMBLY__ struct task_struct; +#include #include #include