Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Will Deacon <will@kernel.org>
To: Vladimir Murzin <vladimir.murzin@arm.com>
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
Date: Thu, 24 Feb 2022 09:49:51 +0000	[thread overview]
Message-ID: <20220224094950.GA18228@willie-the-truck> (raw)
In-Reply-To: <d3292b19-e6ea-1cd9-2e0d-24dbe92578a7@arm.com>

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 <vladimir.murzin@arm.com>
> >>>> ---
> > 
> > [...]
> > 
> >>>> @@ -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

  reply	other threads:[~2022-02-24  9:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-31 17:06 [PATCH v2 0/4] arm64: Support of PAuth QARMA3 architected algorithm Vladimir Murzin
2022-01-31 17:06 ` [PATCH v2 1/4] arm64: cpufeature: Account min_field_value when cheking secondaries for PAuth Vladimir Murzin
2022-02-04 18:13   ` Catalin Marinas
2022-01-31 17:06 ` [PATCH v2 2/4] arm64: cpufeature: Warn if mutually exclusive PAuth algorithms detected Vladimir Murzin
2022-02-04 18:16   ` Catalin Marinas
2022-01-31 17:06 ` [PATCH v2 3/4] arm64: cpufeature: Mark existing PAuth architected algorithm as QARMA5 Vladimir Murzin
2022-02-04 18:18   ` Catalin Marinas
2022-01-31 17:06 ` [PATCH v2 4/4] arm64: Add support of PAuth QARMA3 architected algorithm Vladimir Murzin
2022-02-04 18:42   ` Catalin Marinas
2022-02-15 18:21   ` Will Deacon
2022-02-21 14:47     ` Vladimir Murzin
2022-02-22 21:50       ` Will Deacon
2022-02-23 11:20         ` Vladimir Murzin
2022-02-24  9:49           ` Will Deacon [this message]
2022-01-31 17:38 ` [PATCH v2 0/4] arm64: Support " Vladimir Murzin
2022-02-05 10:27 ` Marc Zyngier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220224094950.GA18228@willie-the-truck \
    --to=will@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=vladimir.murzin@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox