Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4132137ybz; Tue, 28 Apr 2020 06:21:41 -0700 (PDT) X-Google-Smtp-Source: APiQypLLdcyUYd0SnYr/LZtlyjoksuAf7R1v7s+QcCsg92jD46JS33IMLYARNPRuwRr6Mt3G2PFX X-Received: by 2002:a05:6402:4:: with SMTP id d4mr22119018edu.344.1588080101813; Tue, 28 Apr 2020 06:21:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588080101; cv=none; d=google.com; s=arc-20160816; b=ecjE7pVlI7pfEXiVaJoC9jmAPuHnYmxpp29eR9LXnog4nQ9Wks5vB7CHOvddtuXuRp L0Y4QSmdL9kyDhmyTbhiq6jvfT06Ve6cZJ80NxM/RW7CAJvhkZst5YM2LdU2vQWQKiwA ZS9AJtYHci9m+D07xCnZW2dSPdLzHGmIKZ7CoJVg2sEbVDzgsmHsrPNB+dE6wNMg4+3V 4Kg9XX0v3pfJBrjxhsSpAii5eNcgNCcGV5irZ/lNwThUzk8fe9UEsSSIdiHHZD+MgQQG Zxc8T+JfD0y4KFmyUXj+EP+jXS9XEIWQRea/X7VVx2Y3TxJMe5NHY7Wrl84F1Jevz+Io UoQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:references :in-reply-to:message-id:dkim-signature; bh=WKIJIRaf8oXkf9VgP9fXf8zvNImGk/BdmYQq2UVHkpg=; b=XES2zfldbNvKxV5Lz2TI3pGjdKeCqG81sMIis1B0UzmzWcXIznSknGcQLfkRwPaBmC LX8KAo6eDlhko/MzW/3glipjjzpkn27aDw2IsFCZpmDW7RRTLYsPw9SjeNRqZRmJzBit DIsYRkQ7OUBGjDt6rmgeKkU+zayBzI4h1Zp8xzOHZla/EJel3jRUpegtsU1Jd0SLlT/6 piF4JLHx4q0kptEyItBBivbCuNGGndGy3MVmednS5GhsIN/y7x7TpmyNzYMNHohib0zF UvG9MpKgQtsbetf3Lo8g0OJzo3u3/kXsWdgACB0lSpP0mkthVKekoBuZL16eU6UQd9oV FwtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=BBzGvZ8k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h4si1840450edn.445.2020.04.28.06.21.18; Tue, 28 Apr 2020 06:21:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=BBzGvZ8k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726924AbgD1NRO (ORCPT + 99 others); Tue, 28 Apr 2020 09:17:14 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:51161 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727060AbgD1NQx (ORCPT ); Tue, 28 Apr 2020 09:16:53 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 49BMcK4Mfpz9v0D7; Tue, 28 Apr 2020 15:16:49 +0200 (CEST) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=BBzGvZ8k; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id X5Vvr4pVF-Uy; Tue, 28 Apr 2020 15:16:49 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 49BMcK3FSkz9v0D5; Tue, 28 Apr 2020 15:16:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1588079809; bh=WKIJIRaf8oXkf9VgP9fXf8zvNImGk/BdmYQq2UVHkpg=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=BBzGvZ8k5MkcBDY21UwgDiYY3heRye8kpjdyWbxYMe0uMznI9X58y0+5UD01ucImS 5kNhWHi4oz6Wc6jOZyqRJOsN2zKjBeH+eZ9mOJA0+6MFBvlNqM/XBR3KiFSiKSf3vL 4N6vdo22QwgExfcx4hb6g9bGVGd1flBMusfoblKM= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id DEFD58B814; Tue, 28 Apr 2020 15:16:50 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id 3yNGiFGztxKf; Tue, 28 Apr 2020 15:16:50 +0200 (CEST) Received: from pc16570vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 8F5158B82D; Tue, 28 Apr 2020 15:16:50 +0200 (CEST) Received: by pc16570vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 577D0658AD; Tue, 28 Apr 2020 13:16:50 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v8 4/8] powerpc/processor: Move cpu_relax() into asm/vdso/processor.h To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , nathanl@linux.ibm.com Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, arnd@arndb.de, tglx@linutronix.de, vincenzo.frascino@arm.com, luto@kernel.org, linux-arch@vger.kernel.org Date: Tue, 28 Apr 2020 13:16:50 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org cpu_relax() need to be in asm/vdso/processor.h to be used by the C VDSO generic library. Move it there. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/processor.h | 10 ++-------- arch/powerpc/include/asm/vdso/processor.h | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 arch/powerpc/include/asm/vdso/processor.h diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h index bfa336fbcfeb..8390503c44a2 100644 --- a/arch/powerpc/include/asm/processor.h +++ b/arch/powerpc/include/asm/processor.h @@ -6,6 +6,8 @@ * Copyright (C) 2001 PPC 64 Team, IBM Corp */ +#include + #include #ifdef CONFIG_VSX @@ -63,14 +65,6 @@ extern int _chrp_type; #endif /* defined(__KERNEL__) && defined(CONFIG_PPC32) */ -/* Macros for adjusting thread priority (hardware multi-threading) */ -#define HMT_very_low() asm volatile("or 31,31,31 # very low priority") -#define HMT_low() asm volatile("or 1,1,1 # low priority") -#define HMT_medium_low() asm volatile("or 6,6,6 # medium low priority") -#define HMT_medium() asm volatile("or 2,2,2 # medium priority") -#define HMT_medium_high() asm volatile("or 5,5,5 # medium high priority") -#define HMT_high() asm volatile("or 3,3,3 # high priority") - #ifdef __KERNEL__ #ifdef CONFIG_PPC64 diff --git a/arch/powerpc/include/asm/vdso/processor.h b/arch/powerpc/include/asm/vdso/processor.h new file mode 100644 index 000000000000..39b9beace9ca --- /dev/null +++ b/arch/powerpc/include/asm/vdso/processor.h @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_VDSO_PROCESSOR_H +#define __ASM_VDSO_PROCESSOR_H + +#ifndef __ASSEMBLY__ + +/* Macros for adjusting thread priority (hardware multi-threading) */ +#define HMT_very_low() asm volatile("or 31, 31, 31 # very low priority") +#define HMT_low() asm volatile("or 1, 1, 1 # low priority") +#define HMT_medium_low() asm volatile("or 6, 6, 6 # medium low priority") +#define HMT_medium() asm volatile("or 2, 2, 2 # medium priority") +#define HMT_medium_high() asm volatile("or 5, 5, 5 # medium high priority") +#define HMT_high() asm volatile("or 3, 3, 3 # high priority") + +#ifdef CONFIG_PPC64 +#define cpu_relax() do { HMT_low(); HMT_medium(); barrier(); } while (0) +#else +#define cpu_relax() barrier() +#endif + +#endif /* __ASSEMBLY__ */ + +#endif /* __ASM_VDSO_PROCESSOR_H */ -- 2.25.0