Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp720565ybv; Thu, 13 Feb 2020 08:18:34 -0800 (PST) X-Google-Smtp-Source: APXvYqzEmMjd3fiZynljPLjSZSIPj7eA+oBN8WDjk/6BSmyYvLBbX8pcHlLz2cuf0HUJQTbmbSrQ X-Received: by 2002:a9d:470a:: with SMTP id a10mr14224421otf.370.1581610714094; Thu, 13 Feb 2020 08:18:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581610714; cv=none; d=google.com; s=arc-20160816; b=a3Rt+knODDY+wNOPD99yqXURuAF0dSBjzEKDHWjiT4nREzq4mZ0iSDJ70aOjbfQoyB DFFQiqqXrvJhCzspZ32aRCBvGQxU5DKEAcwF2uzyQVPEyWIJqWwiI16GcQPcJJBvITdx SaxSGe+tLKwvwwa8At9OIUUUnRZBmfgb+qpny2qc3Te4LoCr0qHN7Zoln8o01qEs1MlL eAVgnxlKMBAYCkzvR2h4hSFRMw//ef99vbvivdSyt79vWEtp9DPx198RtudZDhfMuF+q ptvzJF+JfI09pv4aX+rkvtdTZKzPT5vrxmx2oKcx+UXP9WwfPIi9ef05TZWF0SV1JRH3 ocug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ZUkv1aA29l2h3nA7Jm4SPRYNnwszAUDgSfqo8SD3eB4=; b=EjRyR4uAWLtQdKKGz/TupmzQiRqTUg+ZPy7oFqEuh4SC/Uwtj6ePR90X7Di4j/w9fl ysfZZluoklDK5DKTvT6gignHFbCa2HC/SDBVETlgfHbfgLPx/Bycd7QmRZe2oMLTyips TdBz3TJP+LroMxTgd+8HuvEZi7AY3jDcz7XwePS132guenMka5cOSoHh04Nm1n0iZsie sgXRy7oftYq7+PWf/gVOSSxeGJSKc0FSMr5clHRqCVqx79M4dpiS+ij/4aGk8e450lLL BcVyPvghgBREChdD04bfBodWUVOtrCH1Z8EP5f7akDmp9Nx6cMjfUVVmAPyjn0hPBNWX e0Qg== 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 h16si1356495otk.193.2020.02.13.08.18.21; Thu, 13 Feb 2020 08:18:34 -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; 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 S1730437AbgBMQRW (ORCPT + 99 others); Thu, 13 Feb 2020 11:17:22 -0500 Received: from foss.arm.com ([217.140.110.172]:50054 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727754AbgBMQRQ (ORCPT ); Thu, 13 Feb 2020 11:17:16 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E53EB106F; Thu, 13 Feb 2020 08:17:15 -0800 (PST) Received: from e119884-lin.cambridge.arm.com (e119884-lin.cambridge.arm.com [10.1.196.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5B2333F6CF; Thu, 13 Feb 2020 08:17:13 -0800 (PST) From: Vincenzo Frascino To: linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, clang-built-linux@googlegroups.com, x86@kernel.org Cc: catalin.marinas@arm.com, will.deacon@arm.com, arnd@arndb.de, linux@armlinux.org.uk, paul.burton@mips.com, tglx@linutronix.de, luto@kernel.org, mingo@redhat.com, bp@alien8.de, sboyd@kernel.org, salyzyn@android.com, pcc@google.com, 0x7f454c46@gmail.com, ndesaulniers@google.com, avagin@openvz.org Subject: [PATCH 12/19] arm64: Introduce asm/common/processor.h Date: Thu, 13 Feb 2020 16:16:07 +0000 Message-Id: <20200213161614.23246-13-vincenzo.frascino@arm.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200213161614.23246-1-vincenzo.frascino@arm.com> References: <20200213161614.23246-1-vincenzo.frascino@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The vDSO library should only include the necessary headers required for a userspace library (UAPI and a minimal set of kernel headers). To make this possible it is necessary to isolate from the kernel headers the common parts that are strictly necessary to build the library. Introduce asm/common/processor.h to contain all the arm64 specific functions that are suitable for vDSO inclusion. Cc: Catalin Marinas Cc: Will Deacon Signed-off-by: Vincenzo Frascino --- arch/arm64/include/asm/common/processor.h | 31 +++++++++++++++++++++++ arch/arm64/include/asm/processor.h | 16 ++---------- 2 files changed, 33 insertions(+), 14 deletions(-) create mode 100644 arch/arm64/include/asm/common/processor.h diff --git a/arch/arm64/include/asm/common/processor.h b/arch/arm64/include/asm/common/processor.h new file mode 100644 index 000000000000..d02b0f392923 --- /dev/null +++ b/arch/arm64/include/asm/common/processor.h @@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (C) 2020 ARM Ltd. + */ +#ifndef __ASM_COMMON_PROCESSOR_H +#define __ASM_COMMON_PROCESSOR_H + +#ifndef __ASSEMBLY__ + +#include + +#ifdef CONFIG_COMPAT +#if defined(CONFIG_ARM64_64K_PAGES) && defined(CONFIG_KUSER_HELPERS) +/* + * With CONFIG_ARM64_64K_PAGES enabled, the last page is occupied + * by the compat vectors page. + */ +#define TASK_SIZE_32 UL(0x100000000) +#else +#define TASK_SIZE_32 (UL(0x100000000) - PAGE_SIZE) +#endif /* CONFIG_ARM64_64K_PAGES */ +#endif /* CONFIG_COMPAT */ + +static inline void cpu_relax(void) +{ + asm volatile("yield" ::: "memory"); +} + +#endif /* __ASSEMBLY__ */ + +#endif /* __ASM_COMMON_PROCESSOR_H */ diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h index 5ba63204d078..2866afc33f24 100644 --- a/arch/arm64/include/asm/processor.h +++ b/arch/arm64/include/asm/processor.h @@ -28,6 +28,8 @@ #include #include +#include + #include #include #include @@ -47,15 +49,6 @@ #define TASK_SIZE_64 (UL(1) << vabits_actual) #ifdef CONFIG_COMPAT -#if defined(CONFIG_ARM64_64K_PAGES) && defined(CONFIG_KUSER_HELPERS) -/* - * With CONFIG_ARM64_64K_PAGES enabled, the last page is occupied - * by the compat vectors page. - */ -#define TASK_SIZE_32 UL(0x100000000) -#else -#define TASK_SIZE_32 (UL(0x100000000) - PAGE_SIZE) -#endif /* CONFIG_ARM64_64K_PAGES */ #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) ? \ @@ -256,11 +249,6 @@ extern void release_thread(struct task_struct *); unsigned long get_wchan(struct task_struct *p); -static inline void cpu_relax(void) -{ - asm volatile("yield" ::: "memory"); -} - /* Thread switching */ extern struct task_struct *cpu_switch_to(struct task_struct *prev, struct task_struct *next); -- 2.25.0