Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3921542ybz; Mon, 20 Apr 2020 11:56:08 -0700 (PDT) X-Google-Smtp-Source: APiQypLWPbqazRVX196B8HCWXbDy4ap10zL2byW4XdgC0u1Spd4Z42/Y6uA7WXblstBElRgM3eMW X-Received: by 2002:a17:906:1502:: with SMTP id b2mr17637343ejd.359.1587408967901; Mon, 20 Apr 2020 11:56:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587408967; cv=none; d=google.com; s=arc-20160816; b=Pmjil1DaqzizI7ejt7b6BoYEcTdamcNGgNzdEzeOAjdVZ9QATNSEgjjlevU56giXNr xIJn/MQZd+Nw9ow26Wh2Nlf0D1pK8hnYi+FrmIno8M+4HiQ95L01WZXewIdIvfRpHzZl oojXbCqpW187Zrldt203t7NkEZ6F35rgghk0fiiLGMk7rGaWu/LZ2err1zhwG+v+lYrk EScU1DsIDcg9iAKRLgQQ8PRDu6DvahctVQLbAvrRgwTeA6W42WiOIqo0H4uLvzPpjrdl zKo601Uv/qqe2NTlQbeJC6ovkMULMlZLHlTM2f6UWOkH4mDRfdCcsAHapzmnG3Xj1/vW ggRA== 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=Rmwc0A7uZPaca2pYl3mLjUC2hKKmMsy4icLjoIOooDQ=; b=zqYLt69YjkpL/GDA6CC6uiZnYVAY1Vl/L4V7Y+yekcVUOxsGTtnmOp+v/HspG+vpUT 9aajhgIF9xock2HmxbmveD5lEU2lu1qOWnqKt0m6bOFhlCtzedNZ1pF8G85z/aDHdTN9 QCs9wmDnaOQbBr4kTuZC2/SjQNNhRrlvaVRXA9pvyRIKMZ5PEfxVu7Z2J4a2OJkrW/1J ZZDqlW1hNeatqEGqDfvkRPGpDfsy80u09aGjRiNZbe9vll2jolF5JhjgnG2uVS825uNi 1qmxg1usrPrISC8IkLATguNCaADA6XTOuls9wOiwEVtEK77Aj8CY5HbMFpbG3ME0jD6F lmMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=jYMQ2NaJ; 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 h21si193698edj.79.2020.04.20.11.55.44; Mon, 20 Apr 2020 11:56:07 -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=jYMQ2NaJ; 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 S1726662AbgDTQ4y (ORCPT + 99 others); Mon, 20 Apr 2020 12:56:54 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:54219 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726355AbgDTQ4e (ORCPT ); Mon, 20 Apr 2020 12:56:34 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 495XsQ4B5jz9txcx; Mon, 20 Apr 2020 18:56:26 +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=jYMQ2NaJ; 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 nxoBSgxzagXu; Mon, 20 Apr 2020 18:56:26 +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 495XsQ34M8z9txcs; Mon, 20 Apr 2020 18:56:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1587401786; bh=Rmwc0A7uZPaca2pYl3mLjUC2hKKmMsy4icLjoIOooDQ=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=jYMQ2NaJ0sxEQtD0Hq6taq8AhdfdoF/KVbA2viKgpX0CONSm0PWySqkYHgwIWModi Er/ggPaVhp2/7PY0PZNAF1yu8F3sToBMfWDRNPS2m6cWdGpijawOlAaVCUB7S4jC+F QIbBL8OdPSQtpJoL5xgxkQBXuXuT6hzMypmLhUoo= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 4437D8B78A; Mon, 20 Apr 2020 18:56:32 +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 ve2dH8--EoSC; Mon, 20 Apr 2020 18:56:32 +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 071AF8B784; Mon, 20 Apr 2020 18:56:32 +0200 (CEST) Received: by pc16570vm.idsi0.si.c-s.fr (Postfix, from userid 0) id D1C37657AE; Mon, 20 Apr 2020 16:56:31 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v7 4/7] 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 Date: Mon, 20 Apr 2020 16:56:31 +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 eedcbfb9a6ff..89c9eab8e45c 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