Re: [PATCH] arm64: errata: Add Cortex-A725 erratum 3821522 workaround

From: Catalin Marinas

Date: Thu Sep 24 2026 - 10:57:19 EST


Hi Beata,

On Tue, Sep 08, 2026 at 12:47:08PM +0200, Beata Michalska wrote:
> diff --git a/arch/arm64/include/asm/topology.h b/arch/arm64/include/asm/topology.h
> index b9eaf4ad70850..93f33ee078638 100644
> --- a/arch/arm64/include/asm/topology.h
> +++ b/arch/arm64/include/asm/topology.h
> @@ -17,6 +17,12 @@ int pcibus_to_node(struct pci_bus *bus);
>
> #include <linux/arch_topology.h>
>
> +static inline bool this_cpu_has_broken_amu_constcnt(void)
> +{
> + return this_cpu_has_cap(ARM64_WORKAROUND_2457168) ||
> + this_cpu_has_cap(ARM64_WORKAROUND_3821522);
> +}

Instead of this, please add ARM64_WORKAROUND_BROKEN_AMU_CONSTCNT and set
it in the .capability field of a multi-cap entry. We do the same with
ARM64_WORKAROUND_REPEAT_TLBI_SYNC.

--
Catalin