Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1867760ybh; Fri, 13 Mar 2020 08:47:01 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt+MG4W63GHJwVBcishrNrM1NQOg/SKpT/67jLceq9xX3aI2FdGI+c4B7YkVW7nw8ca0QW8 X-Received: by 2002:aca:b803:: with SMTP id i3mr5572688oif.92.1584114421837; Fri, 13 Mar 2020 08:47:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584114421; cv=none; d=google.com; s=arc-20160816; b=I8dZFFuSPPVBLvpGLt4u8rKYy7znID+Nt3CxZFoEnhMJeJjI38dutkp31eBjWFSOfV VC+c1jxT/57Ncv80nfG5tyB0qlfY4KrEQUz4rTlwN9Z07yr7d+iPt5/cAh4ng+SKyKyB +112RVRRiPq8/5qeboUwXSBhMVNQA+8X2Bg4kVBfScVA/0rRebcBJxF7PXq48I1/uUMA Grw/VqG2hlVGDuuN2ibxqv2v3TCMg+PsuwoaFvl5+a3vRwXDF9SrZl7AZmkuRJAyEgNX XgEUb6lqf0+sI1PIwvjtboIxdndaqPQB7DEYYJ+DY9KQGheRfBzU0ADNfZEHcHkUkMcT OAPw== 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=H9ud3561McR2A7n+WWxnhcf7Y1OOM8SKln8y7+PVhEA=; b=aaqlvEtru9A6ffj+C3d2jGuj5nDVIhw/2u5ASQyrykMLf+Y4l55vlHgCQLEu/UBVdo lbHXLBBOeuG7oLC7isWlMTNUK8YK6cs3DjyB4tjXA5J7YdrBl0Cr3vkv2cgNnUeX4/4Z U515S30QpC3l77yZTSbyijD0i0A3XdRa9BiP2i52HkdU/RMIjHyuKCuSA2wEUK+Q0ilh 1zsSXzVBYqs+pvpcUiqfaXc3crJimbblYG9APEcvd9yke+FtFBkvGCE/TL2AGGZZqmQ8 ykaL/wGO872/bsP90jsiqca3HGjuEjwcfz3zGyLyH+4eoGoA1+LwtaVir1+Vk2tQ//LT /oYQ== 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 f23si4901301oti.283.2020.03.13.08.46.49; Fri, 13 Mar 2020 08:47:01 -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 S1727383AbgCMPpF (ORCPT + 99 others); Fri, 13 Mar 2020 11:45:05 -0400 Received: from foss.arm.com ([217.140.110.172]:58874 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727369AbgCMPpE (ORCPT ); Fri, 13 Mar 2020 11:45:04 -0400 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 8764C31B; Fri, 13 Mar 2020 08:45:03 -0700 (PDT) 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 73A0E3F67D; Fri, 13 Mar 2020 08:45:00 -0700 (PDT) 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: Vincenzo Frascino , Catalin Marinas , Will Deacon , Arnd Bergmann , Russell King , Paul Burton , Thomas Gleixner , Andy Lutomirski , Ingo Molnar , Borislav Petkov , Stephen Boyd , Mark Salyzyn , Kees Cook , Peter Collingbourne , Dmitry Safonov <0x7f454c46@gmail.com>, Andrei Vagin , Nick Desaulniers , Marc Zyngier , Mark Rutland , Will Deacon Subject: [PATCH v3 18/26] arm64: Introduce asm/vdso/processor.h Date: Fri, 13 Mar 2020 15:43:37 +0000 Message-Id: <20200313154345.56760-19-vincenzo.frascino@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200313154345.56760-1-vincenzo.frascino@arm.com> References: <20200313154345.56760-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/vdso/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/processor.h | 16 ++----------- arch/arm64/include/asm/vdso/processor.h | 31 +++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 14 deletions(-) create mode 100644 arch/arm64/include/asm/vdso/processor.h diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h index 5ba63204d078..89ba2c5be504 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); diff --git a/arch/arm64/include/asm/vdso/processor.h b/arch/arm64/include/asm/vdso/processor.h new file mode 100644 index 000000000000..fb4883212a2d --- /dev/null +++ b/arch/arm64/include/asm/vdso/processor.h @@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (C) 2020 ARM Ltd. + */ +#ifndef __ASM_VDSO_PROCESSOR_H +#define __ASM_VDSO_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_VDSO_PROCESSOR_H */ -- 2.25.1