From mboxrd@z Thu Jan 1 00:00:00 1970 From: Will Deacon Subject: Re: [PATCH v5 01/17] arm64: add pointer authentication register bits Date: Fri, 12 Oct 2018 09:56:05 +0100 Message-ID: <20181012085605.GB11847@arm.com> References: <20181005084754.20950-1-kristina.martsenko@arm.com> <20181005084754.20950-2-kristina.martsenko@arm.com> <20181011162814.GC17000@arm.com> <20181012085352.xi6rkcpm62iqd6ru@lakrids.cambridge.arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20181012085352.xi6rkcpm62iqd6ru@lakrids.cambridge.arm.com> Sender: linux-kernel-owner@vger.kernel.org To: Mark Rutland Cc: Kristina Martsenko , linux-arm-kernel@lists.infradead.org, Adam Wallis , Amit Kachhap , Andrew Jones , Ard Biesheuvel , Arnd Bergmann , Catalin Marinas , Christoffer Dall , Dave P Martin , Jacob Bramley , Kees Cook , Marc Zyngier , Ramana Radhakrishnan , "Suzuki K . Poulose" , kvmarm@lists.cs.columbia.edu, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org List-Id: linux-arch.vger.kernel.org On Fri, Oct 12, 2018 at 09:53:54AM +0100, Mark Rutland wrote: > On Thu, Oct 11, 2018 at 05:28:14PM +0100, Will Deacon wrote: > > On Fri, Oct 05, 2018 at 09:47:38AM +0100, Kristina Martsenko wrote: > > > > +#define ESR_ELx_EC_PAC (0x09) > > > > Really minor nit: but shouldn't this be ESR_EL2_EC_PAC, since this trap > > can't occur at EL1 afaict? > > It can also be taken to EL3 dependent on SCR_EL3.API. > > We use ESR_ELx_EC_ for other exceptions that can't be taken to EL1 > (e.g. ESR_ELx_EC_SMC{32,64}), so I think it would be more consistent to > leave this as ESR_ELx_EC_PAC rather than ESR_EL2_EC_PAC. Fair enough, but if we grow a different EC for ESR_EL1 that uses encoding 0x09, this all falls apart. At the very list, maybe we should comment those that are EL2 or higher with /* EL2 and above */ or just fix the misnomer and drop the useless _ELx_ part of the names completely. Will From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com ([217.140.101.70]:48060 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727705AbeJLQ1b (ORCPT ); Fri, 12 Oct 2018 12:27:31 -0400 Date: Fri, 12 Oct 2018 09:56:05 +0100 From: Will Deacon Subject: Re: [PATCH v5 01/17] arm64: add pointer authentication register bits Message-ID: <20181012085605.GB11847@arm.com> References: <20181005084754.20950-1-kristina.martsenko@arm.com> <20181005084754.20950-2-kristina.martsenko@arm.com> <20181011162814.GC17000@arm.com> <20181012085352.xi6rkcpm62iqd6ru@lakrids.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181012085352.xi6rkcpm62iqd6ru@lakrids.cambridge.arm.com> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Mark Rutland Cc: Kristina Martsenko , linux-arm-kernel@lists.infradead.org, Adam Wallis , Amit Kachhap , Andrew Jones , Ard Biesheuvel , Arnd Bergmann , Catalin Marinas , Christoffer Dall , Dave P Martin , Jacob Bramley , Kees Cook , Marc Zyngier , Ramana Radhakrishnan , "Suzuki K . Poulose" , kvmarm@lists.cs.columbia.edu, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Message-ID: <20181012085605.4cvqpTkQA3hmZQZBTG5liGjVhNiAx2wQp2l7mv77GQo@z> On Fri, Oct 12, 2018 at 09:53:54AM +0100, Mark Rutland wrote: > On Thu, Oct 11, 2018 at 05:28:14PM +0100, Will Deacon wrote: > > On Fri, Oct 05, 2018 at 09:47:38AM +0100, Kristina Martsenko wrote: > > > > +#define ESR_ELx_EC_PAC (0x09) > > > > Really minor nit: but shouldn't this be ESR_EL2_EC_PAC, since this trap > > can't occur at EL1 afaict? > > It can also be taken to EL3 dependent on SCR_EL3.API. > > We use ESR_ELx_EC_ for other exceptions that can't be taken to EL1 > (e.g. ESR_ELx_EC_SMC{32,64}), so I think it would be more consistent to > leave this as ESR_ELx_EC_PAC rather than ESR_EL2_EC_PAC. Fair enough, but if we grow a different EC for ESR_EL1 that uses encoding 0x09, this all falls apart. At the very list, maybe we should comment those that are EL2 or higher with /* EL2 and above */ or just fix the misnomer and drop the useless _ELx_ part of the names completely. Will