Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp720404ybv; Thu, 13 Feb 2020 08:18:24 -0800 (PST) X-Google-Smtp-Source: APXvYqzk0mbtxZLw9LS0DwqYagX/c7xsZOqSkb6AC9dtnnyVMd7Xtlx5ktkqtZuMErzRjqqbg710 X-Received: by 2002:a9d:2028:: with SMTP id n37mr14624815ota.127.1581610704348; Thu, 13 Feb 2020 08:18:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581610704; cv=none; d=google.com; s=arc-20160816; b=ukiFmlR7nfbIOg05etbmLwgO4gWHV9ylAMvr1xu3COQTvYVFFiK4+/+5giDwS0cOIZ Qt/pSwz/UbYO2Ga0uYqk8DoM29R3W/Y2sv/GrI0wTtlkpZi649dCerVCWYpMRRJFfWD5 qJGTW+vxhb8dDyVsAELybFo0iCbBDy/QWMW99+cnXqqFFUFrg5hKm8SSGSVFrkonCO7j pt9owOEjygj/u+UVw73uHre7BMwsSTPzdDePcFnkH3DInljWNGQaI+TdOzf+JufMe6dn +IoIN3YLyDgnx1jhRvlXXIqZodZ2LO9sGewP5wvZ+yq95H/DE1c4+RTu6uDKehibI3VH LvWg== 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=9cji4SC2/SbaPlsuagkz7NKsNsto5lG+/oXrTzCEabA=; b=A+pWOiGBzVRDB30pZ/bxTqh+mWXb9rl6i4PJgP1MwHiACxQxOkoqhsuby4bt1J3tP4 PgI/6GoFwyRe32lGQKugEwAiIBayXf3/SZPXt0uxdZVuZgJqM5zKfX/mhyVcpKTnk/mR Hj3k/nJpyvZXLgf9xz+jLY7rxtxj6If833p2Qf5lMgYdAeAmBE4Vh5P7pNHREsIWwiNX 47QKI1KpBgrpym42c50L3ASsUUoYj5xrsVms64InVlODh71UW7pMbgzMVCznc9tlUoyb uXigJdsBDyz0HoG5Ay69V32ck5dw4U8EBlq0MbYR8X90G/FGSexyi3LhSc9IHUPsrMBR Vdmw== 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 l13si1444701otq.30.2020.02.13.08.18.11; Thu, 13 Feb 2020 08:18:24 -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 S1730462AbgBMQR0 (ORCPT + 99 others); Thu, 13 Feb 2020 11:17:26 -0500 Received: from foss.arm.com ([217.140.110.172]:50152 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730451AbgBMQRY (ORCPT ); Thu, 13 Feb 2020 11:17:24 -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 2A7961063; Thu, 13 Feb 2020 08:17:24 -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 9E84F3F6CF; Thu, 13 Feb 2020 08:17:21 -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 15/19] mips: vdso: Enable mips to use common headers Date: Thu, 13 Feb 2020 16:16:10 +0000 Message-Id: <20200213161614.23246-16-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 Enable mips to use only the common headers in the implementation of the vDSO library. Cc: Paul Burton Signed-off-by: Vincenzo Frascino --- arch/mips/include/asm/common/processor.h | 27 +++++++++++++++++++++++ arch/mips/include/asm/processor.h | 16 +------------- arch/mips/include/asm/vdso/gettimeofday.h | 4 ---- 3 files changed, 28 insertions(+), 19 deletions(-) create mode 100644 arch/mips/include/asm/common/processor.h diff --git a/arch/mips/include/asm/common/processor.h b/arch/mips/include/asm/common/processor.h new file mode 100644 index 000000000000..d2ee5d397d2b --- /dev/null +++ b/arch/mips/include/asm/common/processor.h @@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (C) 2020 ARM Ltd. + */ +#ifndef __ASM_COMMON_PROCESSOR_H +#define __ASM_COMMON_PROCESSOR_H + +#ifndef __ASSEMBLY__ + +#ifdef CONFIG_CPU_LOONGSON64 +/* + * Loongson-3's SFB (Store-Fill-Buffer) may buffer writes indefinitely when a + * tight read loop is executed, because reads take priority over writes & the + * hardware (incorrectly) doesn't ensure that writes will eventually occur. + * + * Since spin loops of any kind should have a cpu_relax() in them, force an SFB + * flush from cpu_relax() such that any pending writes will become visible as + * expected. + */ +#define cpu_relax() smp_mb() +#else +#define cpu_relax() barrier() +#endif + +#endif /* __ASSEMBLY__ */ + +#endif /* __ASM_COMMON_PROCESSOR_H */ diff --git a/arch/mips/include/asm/processor.h b/arch/mips/include/asm/processor.h index 7619ad319400..b7eca25e2066 100644 --- a/arch/mips/include/asm/processor.h +++ b/arch/mips/include/asm/processor.h @@ -22,6 +22,7 @@ #include #include #include +#include /* * System setup and hardware flags.. @@ -385,21 +386,6 @@ unsigned long get_wchan(struct task_struct *p); #define KSTK_ESP(tsk) (task_pt_regs(tsk)->regs[29]) #define KSTK_STATUS(tsk) (task_pt_regs(tsk)->cp0_status) -#ifdef CONFIG_CPU_LOONGSON64 -/* - * Loongson-3's SFB (Store-Fill-Buffer) may buffer writes indefinitely when a - * tight read loop is executed, because reads take priority over writes & the - * hardware (incorrectly) doesn't ensure that writes will eventually occur. - * - * Since spin loops of any kind should have a cpu_relax() in them, force an SFB - * flush from cpu_relax() such that any pending writes will become visible as - * expected. - */ -#define cpu_relax() smp_mb() -#else -#define cpu_relax() barrier() -#endif - /* * Return_address is a replacement for __builtin_return_address(count) * which on certain architectures cannot reasonably be implemented in GCC diff --git a/arch/mips/include/asm/vdso/gettimeofday.h b/arch/mips/include/asm/vdso/gettimeofday.h index a58687e26c5d..e8ab2fafe067 100644 --- a/arch/mips/include/asm/vdso/gettimeofday.h +++ b/arch/mips/include/asm/vdso/gettimeofday.h @@ -13,12 +13,8 @@ #ifndef __ASSEMBLY__ -#include -#include - #include #include -#include #include #include -- 2.25.0