Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp816822imp; Wed, 20 Feb 2019 09:30:01 -0800 (PST) X-Google-Smtp-Source: AHgI3IZHqhrtDj+3H5FQTh0ZFIzcwAW1Oxc5F3UoMqHGwCFOdZ/iEjL3JS4LOpHMA7GG9wqTCJ/w X-Received: by 2002:a63:7e0e:: with SMTP id z14mr13163655pgc.436.1550683801820; Wed, 20 Feb 2019 09:30:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550683801; cv=none; d=google.com; s=arc-20160816; b=if582oNUNNHE8yd2R52pAanIzPQP7Mn+yTITxmFSbZKjyHRYJka5ZUnfyylT58jxay h/bBN3oGADR5+sLJiQuKiRO+N/SWouFRc96P71avMZughdFx0Efq0JiFxYGuS5TYyGjd QBUCrSUNwpSxHPt1lS5H5mXwkjw2M3cPwFjiXqWlB0aFd0oCgx5XtzG7hoov+EeBYg7+ LwbuYXT6RQKjDuumEND2y/Pn25sOcNtu3SYXmDBIWBae5F5UlblXJmpbxNqtQp1fv5vh RpfTUSmzbfSwQ/beCv/coCJyWmO5sM9CnRLuozlDzn5XcMK99LzzfALhdl8BoxbKGmCu Snbg== 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=ccf0q8MxveX5A/kD+EyhGHMgyOOsoAgRMM6RQCBw488=; b=onB63HK/z53Y65q8aBKVMgKekxmXV2AcFcoslaxnNWu77skot4Hgjrt6RvcV8bxpGe vVM2glPpMx8nUptnCWliyRuhNkvghmB0eTBdGqeqbhl2rTGRXQzklrBb93ZhYFxP5hag pjs1rr3Zk/1j/MDzmls6c1aHjkU8JdTOt6bL/1G8qBc5oy7L5R7jrAeT9CZMgkgqqfvI ZGSnUkkRTa3R7kKdXx52QrsTZP7BaCbqNlyZ3GECV7lvXXTDeTGsnEKQHW1R8lXQBj5u y0XCu6eROiwPXQ7F2j+6l4b0O5GGFTWlSvHdA4aBhp9Bj2wtVEqsB3y5XLVys7e/tpnW 6hvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=oJmQBgsH; 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 bj10si7345853plb.434.2019.02.20.09.29.46; Wed, 20 Feb 2019 09:30:01 -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; dkim=pass header.i=@c-s.fr header.s=mail header.b=oJmQBgsH; 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 S1726725AbfBTR3S (ORCPT + 99 others); Wed, 20 Feb 2019 12:29:18 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:63781 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726607AbfBTR3R (ORCPT ); Wed, 20 Feb 2019 12:29:17 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 444PjP5zDtz9v0gC; Wed, 20 Feb 2019 18:29:13 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=oJmQBgsH; 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 tfkIYFsUiAk0; Wed, 20 Feb 2019 18:29:13 +0100 (CET) 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 444PjP4vj2z9v0g0; Wed, 20 Feb 2019 18:29:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1550683753; bh=ccf0q8MxveX5A/kD+EyhGHMgyOOsoAgRMM6RQCBw488=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=oJmQBgsHOu9NxN4AbjaIdlItL+EET2PVy0gns0e/dMfCmcCtkYQfx86MN1WHv5wFI MWGB8k6W9I1S+sodtcayCJ5TJ+c6rhC0VSpZGeHmzGjwHDDt/Oia1CsK02oyu/hGrW ZD8y/u4C5K6I/PfHoLdO0Rd2iU9RVrJLTW2JNfpE= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 551388B84F; Wed, 20 Feb 2019 18:29:15 +0100 (CET) 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 g5tylpfk4P17; Wed, 20 Feb 2019 18:29:15 +0100 (CET) Received: from po16846vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.231.2]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 2E95E8B84A; Wed, 20 Feb 2019 18:29:15 +0100 (CET) Received: by po16846vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 17C9F6E85E; Wed, 20 Feb 2019 17:29:15 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v3 08/16] powerpc/32: add helper to write into segment registers To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , j.neuschaefer@gmx.net Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Wed, 20 Feb 2019 17:29:15 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch add an helper which wraps 'mtsrin' instruction to write into segment registers. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/reg.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index 1c98ef1f2d5b..a70cbaf5c26f 100644 --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/include/asm/reg.h @@ -1425,6 +1425,11 @@ static inline void msr_check_and_clear(unsigned long bits) #define mfsrin(v) ({unsigned int rval; \ asm volatile("mfsrin %0,%1" : "=r" (rval) : "r" (v)); \ rval;}) + +static inline void mtsrin(u32 val, u32 idx) +{ + asm volatile("mtsrin %0, %1" : : "r" (val), "r" (idx)); +} #endif #define proc_trap() asm volatile("trap") -- 2.13.3