Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp6838487ybf; Fri, 6 Mar 2020 05:34:37 -0800 (PST) X-Google-Smtp-Source: ADFU+vtfOQpQopv9qmMR+Nr7km33BY8ypAdgYdKeYD1yAyhVUdXfko++u50IwULHNkaf7l4aq7Rp X-Received: by 2002:a05:6830:1e0d:: with SMTP id s13mr2440375otr.234.1583501677270; Fri, 06 Mar 2020 05:34:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583501677; cv=none; d=google.com; s=arc-20160816; b=GuReBi7X0LOx7XT4m101C7CprF23YoDLk72rXZBB5ZReWZU4dk8UXzYxu/LrxLdYvP IDnyQv6SzcGGhMeBkcEXjjojTRSQ7Wrod5I+xtAFLFstMyBX5s/YaJn8YSS/i4dVLcDV i4pxtYJXYPZORsW1kydvhtcUULoYbWKVxoPdzyE15YM+KHFv3dawU9jo4FAg13qlyYaM J9CYOBBDcfezppEzizgILEMebjKRord4oswYl7qCDlV8X/iMkB96XvIIPweVqzUziycx HF+ntzY1gygiGoBxX1EjsevoZly+t3Sred6ih6PTxGGymM8T3aVhlh/mNR/xxKAZPUB5 gLew== 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=mAAhlGvY0DnAXEmTPMPHdr1Lbwi97W0NCLn/EpZRF3w=; b=bhQJ148UsjE7tahspqOJS8lLpT9tFUQzWwoD0QohXWxvtBzOy94H6r9jllGPmsvQMu OhVchfu9ocpzpULVAC5XZCa9R6v8hkQCgMEoQ1Z+r9ccCNs+gUp373ATZQW/EjB9qpds qJfPK8NO00qXxZwTJseFnrgA0vTzSILRpjfXXgn2T8OVS8GQD9s1J7zlYkrA6MKm2ilt TYJGrhOLk/So1TluTAWQPfTXlVo6zT+Hhh42VME+juwKRZFPtoEOX06m3OUfZSkeGSd3 2TROaGqEVLwrKy/ThUjnwmwAW0MbDcr2QKMDKTekmmHNH/i5c8l1WyGO4jRf2hxdp7MX iwmQ== 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 j9si1283466oiw.133.2020.03.06.05.34.22; Fri, 06 Mar 2020 05:34:37 -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 S1727548AbgCFNdn (ORCPT + 99 others); Fri, 6 Mar 2020 08:33:43 -0500 Received: from foss.arm.com ([217.140.110.172]:33792 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726490AbgCFNdn (ORCPT ); Fri, 6 Mar 2020 08:33:43 -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 5E0AA1063; Fri, 6 Mar 2020 05:33:42 -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 7F30B3F6CF; Fri, 6 Mar 2020 05:33:39 -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: 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 , Paul Burton Subject: [PATCH v2 16/20] mips: vdso: Enable mips to use common headers Date: Fri, 6 Mar 2020 13:32:38 +0000 Message-Id: <20200306133242.26279-17-vincenzo.frascino@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200306133242.26279-1-vincenzo.frascino@arm.com> References: <20200306133242.26279-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.1