Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2677092imu; Thu, 29 Nov 2018 08:34:24 -0800 (PST) X-Google-Smtp-Source: AFSGD/XzSSCtkK0+iti2aPM1VnJv4Kw/MBq64fl/yGrEzxhCvn57VGD0QZk/UeH1PFztOLGKPCyV X-Received: by 2002:a63:ea15:: with SMTP id c21mr1685956pgi.361.1543509264732; Thu, 29 Nov 2018 08:34:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543509264; cv=none; d=google.com; s=arc-20160816; b=RFfpa2gamRQJy9lNDEabGUZVrAvadIAgJSJkgPE+F3TbkqtnXWGF+80rHgbxKVWvBq v1pa5O7/G5DGeOpcIz94drEnH9VeuldXQMrX/ukMo8UBK42BvIv7wtIrA2gU+zC9ekUf JpudPEJZexaDbHiMIGWvuLVMFZm4s3NEAem8xrC+F9M2wqZe/XzvVC9iWRANVzeBQSNI rEQkb74SMnbOU94QG3Mt3h/xAPpJVzjx70p+ri4EiXu1ucnZkZ93Eb+46vKnlKOk4hZm D7T0AUIQRGDwtNDue6w8Hhvz0e7wRiqpwUzqSvXGrq7/GXs6pImi9t+yBs6kT8/7wvo2 7c7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=JfgxZcyQHzLBYAVBDGk+k/U4sohmE6fJAIbo9b3UKmY=; b=0xIa7ycdJyAmI9gf5dgFxAZB+a5lUUPRS4iGwWqXh8S/djLBCln9m3eHlx57Xt2LfA CpnPT3nWiVyaEXFf4Z1o7GcaLN354GCT/PUDMdRXsOWLT3hBDmAwV5dVaYJ7C1yOGy0I 3v2fViK/LSMITr+kno7dXWSibuwgxBmiNsdRupLmRYkORKaC97cpeay7ZmGNf5mf8dsi rGqDNlipi4CT1Gxg1po0OCc7AJ3q9ICnRcu9EzAbKCRzPhwC1eC9JIcOMZ7JCDRUlcND kfAQlgZG3ZwifWVYRcDihRg//E6mWKH0SaUx4UPeMKOBHhspi/kAt3F+Q9O/hDTDlZN+ GW5g== 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 q2si2430244plr.204.2018.11.29.08.33.46; Thu, 29 Nov 2018 08:34: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 S1729301AbeK3Dii (ORCPT + 99 others); Thu, 29 Nov 2018 22:38:38 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:38732 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729064AbeK3Dih (ORCPT ); Thu, 29 Nov 2018 22:38:37 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CB900A78; Thu, 29 Nov 2018 08:32:41 -0800 (PST) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DB79E3F59C; Thu, 29 Nov 2018 08:32:39 -0800 (PST) Date: Thu, 29 Nov 2018 16:32:37 +0000 From: Mark Rutland To: Julien Thierry Cc: linux-arm-kernel@lists.infradead.org, daniel.thompson@linaro.org, marc.zyngier@arm.com, catalin.marinas@arm.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, christoffer.dall@arm.com, james.morse@arm.com, joel@joelfernandes.org, Russell King Subject: Re: [PATCH v6 04/24] arm/arm64: gic-v3: Add PMR and RPR accessors Message-ID: <20181129163237.dyppwn5ipkehv527@lakrids.cambridge.arm.com> References: <1542023835-21446-1-git-send-email-julien.thierry@arm.com> <1542023835-21446-5-git-send-email-julien.thierry@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1542023835-21446-5-git-send-email-julien.thierry@arm.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 12, 2018 at 11:56:55AM +0000, Julien Thierry wrote: > Add helper functions to access system registers related to interrupt > priorities: PMR and RPR. > > Signed-off-by: Julien Thierry > Cc: Russell King > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Marc Zyngier The AArch32 ICC_RPR encoding looks right per ARM DDI 0487D.a table G7-3, and the rest looks sane to me. Reviewed-by: Mark Rutland Mark. > --- > arch/arm/include/asm/arch_gicv3.h | 16 ++++++++++++++++ > arch/arm64/include/asm/arch_gicv3.h | 15 +++++++++++++++ > 2 files changed, 31 insertions(+) > > diff --git a/arch/arm/include/asm/arch_gicv3.h b/arch/arm/include/asm/arch_gicv3.h > index 0bd5307..bef0b5d 100644 > --- a/arch/arm/include/asm/arch_gicv3.h > +++ b/arch/arm/include/asm/arch_gicv3.h > @@ -34,6 +34,7 @@ > #define ICC_SRE __ACCESS_CP15(c12, 0, c12, 5) > #define ICC_IGRPEN1 __ACCESS_CP15(c12, 0, c12, 7) > #define ICC_BPR1 __ACCESS_CP15(c12, 0, c12, 3) > +#define ICC_RPR __ACCESS_CP15(c12, 0, c11, 3) > > #define __ICC_AP0Rx(x) __ACCESS_CP15(c12, 0, c8, 4 | x) > #define ICC_AP0R0 __ICC_AP0Rx(0) > @@ -245,6 +246,21 @@ static inline void gic_write_bpr1(u32 val) > write_sysreg(val, ICC_BPR1); > } > > +static inline u32 gic_read_pmr(void) > +{ > + return read_sysreg(ICC_PMR); > +} > + > +static inline void gic_write_pmr(u32 val) > +{ > + write_sysreg(val, ICC_PMR); > +} > + > +static inline u32 gic_read_rpr(void) > +{ > + return read_sysreg(ICC_RPR); > +} > + > /* > * Even in 32bit systems that use LPAE, there is no guarantee that the I/O > * interface provides true 64bit atomic accesses, so using strd/ldrd doesn't > diff --git a/arch/arm64/include/asm/arch_gicv3.h b/arch/arm64/include/asm/arch_gicv3.h > index e278f94..37193e2 100644 > --- a/arch/arm64/include/asm/arch_gicv3.h > +++ b/arch/arm64/include/asm/arch_gicv3.h > @@ -114,6 +114,21 @@ static inline void gic_write_bpr1(u32 val) > write_sysreg_s(val, SYS_ICC_BPR1_EL1); > } > > +static inline u32 gic_read_pmr(void) > +{ > + return read_sysreg_s(SYS_ICC_PMR_EL1); > +} > + > +static inline void gic_write_pmr(u32 val) > +{ > + write_sysreg_s(val, SYS_ICC_PMR_EL1); > +} > + > +static inline u32 gic_read_rpr(void) > +{ > + return read_sysreg_s(SYS_ICC_RPR_EL1); > +} > + > #define gic_read_typer(c) readq_relaxed(c) > #define gic_write_irouter(v, c) writeq_relaxed(v, c) > #define gic_read_lpir(c) readq_relaxed(c) > -- > 1.9.1 > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel