* [PATCH v2] arm64: errata: Enable the AC03_CPU_38 workaround for ampere1a
@ 2024-08-27 21:17 D Scott Phillips
2024-08-28 20:21 ` Oliver Upton
2024-08-30 16:12 ` Will Deacon
0 siblings, 2 replies; 3+ messages in thread
From: D Scott Phillips @ 2024-08-27 21:17 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon, Jonathan Corbet, Mark Rutland,
Anshuman Khandual, Oliver Upton, linux-arm-kernel, linux-doc
Cc: Besar Wicaksono, Easwar Hariharan, Rob Herring, Andre Przywara,
linux-kernel, patches, Marc Zyngier, kvmarm, James Morse,
Suzuki K Poulose, Zenghui Yu
The ampere1a cpu is affected by erratum AC04_CPU_10 which is the same
bug as AC03_CPU_38. Add ampere1a to the AC03_CPU_38 workaround midr list.
Signed-off-by: D Scott Phillips <scott@os.amperecomputing.com>
---
Changes since v1:
- Link: https://lore.kernel.org/lkml/20240826215933.1263453-1-scott@os.amperecomputing.com/
- Used ERRATA_MIDR_RANGE_LIST so both midrs are properly covered. (Oliver)
Documentation/arch/arm64/silicon-errata.rst | 2 ++
arch/arm64/Kconfig | 2 +-
arch/arm64/include/asm/cputype.h | 2 ++
arch/arm64/kernel/cpu_errata.c | 10 +++++++++-
4 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/Documentation/arch/arm64/silicon-errata.rst b/Documentation/arch/arm64/silicon-errata.rst
index 50327c05be8d1..39c52385f11fb 100644
--- a/Documentation/arch/arm64/silicon-errata.rst
+++ b/Documentation/arch/arm64/silicon-errata.rst
@@ -55,6 +55,8 @@ stable kernels.
+----------------+-----------------+-----------------+-----------------------------+
| Ampere | AmpereOne | AC03_CPU_38 | AMPERE_ERRATUM_AC03_CPU_38 |
+----------------+-----------------+-----------------+-----------------------------+
+| Ampere | AmpereOne AC04 | AC04_CPU_10 | AMPERE_ERRATUM_AC03_CPU_38 |
++----------------+-----------------+-----------------+-----------------------------+
+----------------+-----------------+-----------------+-----------------------------+
| ARM | Cortex-A510 | #2457168 | ARM64_ERRATUM_2457168 |
+----------------+-----------------+-----------------+-----------------------------+
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index a2f8ff354ca67..c8cba20a4d11b 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -423,7 +423,7 @@ config AMPERE_ERRATUM_AC03_CPU_38
default y
help
This option adds an alternative code sequence to work around Ampere
- erratum AC03_CPU_38 on AmpereOne.
+ errata AC03_CPU_38 and AC04_CPU_10 on AmpereOne.
The affected design reports FEAT_HAFDBS as not implemented in
ID_AA64MMFR1_EL1.HAFDBS, but (V)TCR_ELx.{HA,HD} are not RES0
diff --git a/arch/arm64/include/asm/cputype.h b/arch/arm64/include/asm/cputype.h
index 5fd7caea44193..5a7dfeb8e8eb5 100644
--- a/arch/arm64/include/asm/cputype.h
+++ b/arch/arm64/include/asm/cputype.h
@@ -143,6 +143,7 @@
#define APPLE_CPU_PART_M2_AVALANCHE_MAX 0x039
#define AMPERE_CPU_PART_AMPERE1 0xAC3
+#define AMPERE_CPU_PART_AMPERE1A 0xAC4
#define MICROSOFT_CPU_PART_AZURE_COBALT_100 0xD49 /* Based on r0p0 of ARM Neoverse N2 */
@@ -212,6 +213,7 @@
#define MIDR_APPLE_M2_BLIZZARD_MAX MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M2_BLIZZARD_MAX)
#define MIDR_APPLE_M2_AVALANCHE_MAX MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M2_AVALANCHE_MAX)
#define MIDR_AMPERE1 MIDR_CPU_MODEL(ARM_CPU_IMP_AMPERE, AMPERE_CPU_PART_AMPERE1)
+#define MIDR_AMPERE1A MIDR_CPU_MODEL(ARM_CPU_IMP_AMPERE, AMPERE_CPU_PART_AMPERE1A)
#define MIDR_MICROSOFT_AZURE_COBALT_100 MIDR_CPU_MODEL(ARM_CPU_IMP_MICROSOFT, MICROSOFT_CPU_PART_AZURE_COBALT_100)
/* Fujitsu Erratum 010001 affects A64FX 1.0 and 1.1, (v0r0 and v1r0) */
diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c
index f6b6b45073571..dfefbdf4073a6 100644
--- a/arch/arm64/kernel/cpu_errata.c
+++ b/arch/arm64/kernel/cpu_errata.c
@@ -456,6 +456,14 @@ static const struct midr_range erratum_spec_ssbs_list[] = {
};
#endif
+#ifdef CONFIG_AMPERE_ERRATUM_AC03_CPU_38
+static const struct midr_range erratum_ac03_cpu_38_list[] = {
+ MIDR_ALL_VERSIONS(MIDR_AMPERE1),
+ MIDR_ALL_VERSIONS(MIDR_AMPERE1A),
+ {},
+};
+#endif
+
const struct arm64_cpu_capabilities arm64_errata[] = {
#ifdef CONFIG_ARM64_WORKAROUND_CLEAN_CACHE
{
@@ -772,7 +780,7 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
{
.desc = "AmpereOne erratum AC03_CPU_38",
.capability = ARM64_WORKAROUND_AMPERE_AC03_CPU_38,
- ERRATA_MIDR_ALL_VERSIONS(MIDR_AMPERE1),
+ ERRATA_MIDR_RANGE_LIST(erratum_ac03_cpu_38_list),
},
#endif
{
--
2.46.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] arm64: errata: Enable the AC03_CPU_38 workaround for ampere1a
2024-08-27 21:17 [PATCH v2] arm64: errata: Enable the AC03_CPU_38 workaround for ampere1a D Scott Phillips
@ 2024-08-28 20:21 ` Oliver Upton
2024-08-30 16:12 ` Will Deacon
1 sibling, 0 replies; 3+ messages in thread
From: Oliver Upton @ 2024-08-28 20:21 UTC (permalink / raw)
To: D Scott Phillips
Cc: Catalin Marinas, Will Deacon, Jonathan Corbet, Mark Rutland,
Anshuman Khandual, linux-arm-kernel, linux-doc, Besar Wicaksono,
Easwar Hariharan, Rob Herring, Andre Przywara, linux-kernel,
patches, Marc Zyngier, kvmarm, James Morse, Suzuki K Poulose,
Zenghui Yu
On Tue, Aug 27, 2024 at 02:17:01PM -0700, D Scott Phillips wrote:
> The ampere1a cpu is affected by erratum AC04_CPU_10 which is the same
> bug as AC03_CPU_38. Add ampere1a to the AC03_CPU_38 workaround midr list.
>
> Signed-off-by: D Scott Phillips <scott@os.amperecomputing.com>
You'll probably want to cc this to stable, that can be handled when the
patch is applied though.
Acked-by: Oliver Upton <oliver.upton@linux.dev>
--
Thanks,
Oliver
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] arm64: errata: Enable the AC03_CPU_38 workaround for ampere1a
2024-08-27 21:17 [PATCH v2] arm64: errata: Enable the AC03_CPU_38 workaround for ampere1a D Scott Phillips
2024-08-28 20:21 ` Oliver Upton
@ 2024-08-30 16:12 ` Will Deacon
1 sibling, 0 replies; 3+ messages in thread
From: Will Deacon @ 2024-08-30 16:12 UTC (permalink / raw)
To: Catalin Marinas, Jonathan Corbet, Mark Rutland, Anshuman Khandual,
Oliver Upton, linux-arm-kernel, linux-doc, D Scott Phillips
Cc: kernel-team, Will Deacon, Besar Wicaksono, Easwar Hariharan,
Rob Herring, Andre Przywara, linux-kernel, patches, Marc Zyngier,
kvmarm, James Morse, Suzuki K Poulose, Zenghui Yu
On Tue, 27 Aug 2024 14:17:01 -0700, D Scott Phillips wrote:
> The ampere1a cpu is affected by erratum AC04_CPU_10 which is the same
> bug as AC03_CPU_38. Add ampere1a to the AC03_CPU_38 workaround midr list.
>
>
Applied to arm64 (for-next/errata), thanks!
[1/1] arm64: errata: Enable the AC03_CPU_38 workaround for ampere1a
https://git.kernel.org/arm64/c/db0d8a84348b
Cheers,
--
Will
https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-08-30 16:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-27 21:17 [PATCH v2] arm64: errata: Enable the AC03_CPU_38 workaround for ampere1a D Scott Phillips
2024-08-28 20:21 ` Oliver Upton
2024-08-30 16:12 ` Will Deacon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).