From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0882EC433F5 for ; Thu, 24 Feb 2022 09:51:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TonPvnMggPrLaP54tvsgdy+JGnyr/lBwrRQcVwrtRTY=; b=ocOEk4Tj879rRH GwMEFyybQJTQHl3jMmlOICHAxH2HY53qW0WOMIKsQ6V9O6oiZJUnSVWlVc7/u0J1axzxhS2LJcfuJ 3Ra7Tec4GauAYgLqKAD+KHYfwJqxf6TgbaCZoKBuBuI529GMMDRYQGn5o6ZHjODNTwB4nG37jfR40 ddc8Td6BkIakidbhMLDc0ZwGmNZafdA2RtIr5M/ni/vdSgr6o1kTgK3E+LNG58NZ4lQaDthJaZ7X1 b1FiXmNi1Vpyc9vIZY/EuNL8U8ptRLtMfqP+Ntyt+NUlCyQyX626wD9TqJfIT0/eOxwk1T0yapYuH ofUdKqapvlW/kzV05YMw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nNAl9-000BSy-0D; Thu, 24 Feb 2022 09:50:03 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nNAl5-000BS8-Im for linux-arm-kernel@lists.infradead.org; Thu, 24 Feb 2022 09:50:01 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 89164B824F2; Thu, 24 Feb 2022 09:49:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E882C340E9; Thu, 24 Feb 2022 09:49:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645696196; bh=bYlePpP/8D1V7Ht7wybwKcI89AEewmyUlwzqBtcZdlY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Kb2HwvUIyOJXkey7koanvUmf1tNHi0rNaeaSI5I/YFRGpa9DgGwvULkoA9TNcfOHo pN5gsRPt6yJlyCo7see4iwjpSF3Txfihsn7UfbCRb0oJKHI8oFFCvll3rptAbT2n48 nfD0IFkvS7sbUN/dq9Snw9XXikhAm1zNEdV+VelwMms+HrJzN7KeqTHgGKb9q/8+Ll ssJ0iX3QTflR8uvLcIevhlU9TYUwKYNSfTd/A/dB/Ln2pXLOmTSia8qn/tUK7aHFrr xPRCAOmjCi+AiUDTqfxLRvrP9K2Pt4bN7EqXXhPWXFmhsU8k/qtsLMHgA77FajNK4a X1b1jeBmbPc2Q== Date: Thu, 24 Feb 2022 09:49:51 +0000 From: Will Deacon To: Vladimir Murzin Cc: linux-arm-kernel@lists.infradead.org, maz@kernel.org, catalin.marinas@arm.com, mark.rutland@arm.com Subject: Re: [PATCH v2 4/4] arm64: Add support of PAuth QARMA3 architected algorithm Message-ID: <20220224094950.GA18228@willie-the-truck> References: <20220131170654.62381-1-vladimir.murzin@arm.com> <20220131170654.62381-5-vladimir.murzin@arm.com> <20220215182154.GB8748@willie-the-truck> <0f0ede07-d2ac-e2e5-c2c3-65c237e60ff6@arm.com> <20220222215001.GA16710@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220224_014959_993666_57EE6E1B X-CRM114-Status: GOOD ( 26.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Feb 23, 2022 at 11:20:40AM +0000, Vladimir Murzin wrote: > On 2/22/22 9:50 PM, Will Deacon wrote: > > On Mon, Feb 21, 2022 at 02:47:02PM +0000, Vladimir Murzin wrote: > >> On 2/15/22 6:21 PM, Will Deacon wrote: > >>> On Mon, Jan 31, 2022 at 05:06:54PM +0000, Vladimir Murzin wrote: > >>>> QARMA3 is relaxed version of the QARMA5 algorithm which expected to > >>>> reduce the latency of calculation while still delivering a suitable > >>>> level of security. > >>>> > >>>> Support for QARMA3 can be discovered via ID_AA64ISAR2_EL1 > >>>> > >>>> APA3, bits [15:12] Indicates whether the QARMA3 algorithm is > >>>> implemented in the PE for address > >>>> authentication in AArch64 state. > >>>> > >>>> GPA3, bits [11:8] Indicates whether the QARMA3 algorithm is > >>>> implemented in the PE for generic code > >>>> authentication in AArch64 state. > >>>> > >>>> Signed-off-by: Vladimir Murzin > >>>> --- > > > > [...] > > > >>>> @@ -596,6 +600,7 @@ static const struct arm64_ftr_bits ftr_raz[] = { > >>>> struct arm64_ftr_override __ro_after_init id_aa64mmfr1_override; > >>>> struct arm64_ftr_override __ro_after_init id_aa64pfr1_override; > >>>> struct arm64_ftr_override __ro_after_init id_aa64isar1_override; > >>>> +struct arm64_ftr_override __ro_after_init id_aa64isar2_override; > >>>> > >>>> static const struct __ftr_reg_entry { > >>>> u32 sys_id; > >>>> @@ -644,6 +649,8 @@ static const struct __ftr_reg_entry { > >>>> ARM64_FTR_REG_OVERRIDE(SYS_ID_AA64ISAR1_EL1, ftr_id_aa64isar1, > >>>> &id_aa64isar1_override), > >>>> ARM64_FTR_REG(SYS_ID_AA64ISAR2_EL1, ftr_id_aa64isar2), > >>>> + ARM64_FTR_REG_OVERRIDE(SYS_ID_AA64ISAR2_EL1, ftr_id_aa64isar2, > >>>> + &id_aa64isar2_override), > >>>> > >>>> /* Op1 = 0, CRn = 0, CRm = 7 */ > >>>> ARM64_FTR_REG(SYS_ID_AA64MMFR0_EL1, ftr_id_aa64mmfr0), > >>>> @@ -1834,10 +1841,11 @@ static bool has_address_auth_metacap(const struct arm64_cpu_capabilities *entry, > >>>> { > >>>> bool api = has_address_auth_cpucap(cpu_hwcaps_ptrs[ARM64_HAS_ADDRESS_AUTH_IMP_DEF], scope); > >>>> bool apa = has_address_auth_cpucap(cpu_hwcaps_ptrs[ARM64_HAS_ADDRESS_AUTH_ARCH_QARMA5], scope); > >>>> + bool apa3 = has_address_auth_cpucap(cpu_hwcaps_ptrs[ARM64_HAS_ADDRESS_AUTH_ARCH_QARMA3], scope); > >>>> > >>>> - WARN_ON(apa && api); > >>>> + WARN_ON((apa && api) || (apa && apa3) || (api && apa3)); > >>> > >>> I don't really get the point in this warning, what is somebody supposed to > >>> do if they hit it? The kernel isn't the right place to make assertions about > >>> the CPU design. > >> > >> Right, there is nothing user can do other than reporting about that. It was > >> inspired by the similar check in cpu_has_fwb(), yet I was under impression > >> that assertion can be triggered via id regester override as well - now I see > >> that invalid override is ignored. I'm fine with removing assertion as long > >> as code base use assertions consistently... > > > > Yes, please send a version with these WARN_ON()s and I can queue it up. > ^^^^^^ > Sorry, Will, did you mean *without*? Urgh, yes, sorry about that. > Do you want separate patch to remove WARN_ON from cpu_has_fwb() as well? Yes, good thinking. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel