Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

Commit 0e6774e

Browse files
D Scott Phillipsgregkh
D Scott Phillips
authored andcommittedOct 4, 2024
arm64: errata: Enable the AC03_CPU_38 workaround for ampere1a
commit db0d8a8 upstream. 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. Cc: <stable@vger.kernel.org> Signed-off-by: D Scott Phillips <scott@os.amperecomputing.com> Acked-by: Oliver Upton <oliver.upton@linux.dev> Link: https://lore.kernel.org/r/20240827211701.2216719-1-scott@os.amperecomputing.com Signed-off-by: Will Deacon <will@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 93e1215 commit 0e6774e

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed
 

‎Documentation/arch/arm64/silicon-errata.rst

+2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ stable kernels.
5454
+----------------+-----------------+-----------------+-----------------------------+
5555
| Ampere | AmpereOne | AC03_CPU_38 | AMPERE_ERRATUM_AC03_CPU_38 |
5656
+----------------+-----------------+-----------------+-----------------------------+
57+
| Ampere | AmpereOne AC04 | AC04_CPU_10 | AMPERE_ERRATUM_AC03_CPU_38 |
58+
+----------------+-----------------+-----------------+-----------------------------+
5759
+----------------+-----------------+-----------------+-----------------------------+
5860
| ARM | Cortex-A510 | #2457168 | ARM64_ERRATUM_2457168 |
5961
+----------------+-----------------+-----------------+-----------------------------+

‎arch/arm64/Kconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ config AMPERE_ERRATUM_AC03_CPU_38
420420
default y
421421
help
422422
This option adds an alternative code sequence to work around Ampere
423-
erratum AC03_CPU_38 on AmpereOne.
423+
errata AC03_CPU_38 and AC04_CPU_10 on AmpereOne.
424424

425425
The affected design reports FEAT_HAFDBS as not implemented in
426426
ID_AA64MMFR1_EL1.HAFDBS, but (V)TCR_ELx.{HA,HD} are not RES0

‎arch/arm64/include/asm/cputype.h

+2
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@
143143
#define APPLE_CPU_PART_M2_AVALANCHE_MAX 0x039
144144

145145
#define AMPERE_CPU_PART_AMPERE1 0xAC3
146+
#define AMPERE_CPU_PART_AMPERE1A 0xAC4
146147

147148
#define MICROSOFT_CPU_PART_AZURE_COBALT_100 0xD49 /* Based on r0p0 of ARM Neoverse N2 */
148149

@@ -212,6 +213,7 @@
212213
#define MIDR_APPLE_M2_BLIZZARD_MAX MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M2_BLIZZARD_MAX)
213214
#define MIDR_APPLE_M2_AVALANCHE_MAX MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M2_AVALANCHE_MAX)
214215
#define MIDR_AMPERE1 MIDR_CPU_MODEL(ARM_CPU_IMP_AMPERE, AMPERE_CPU_PART_AMPERE1)
216+
#define MIDR_AMPERE1A MIDR_CPU_MODEL(ARM_CPU_IMP_AMPERE, AMPERE_CPU_PART_AMPERE1A)
215217
#define MIDR_MICROSOFT_AZURE_COBALT_100 MIDR_CPU_MODEL(ARM_CPU_IMP_MICROSOFT, MICROSOFT_CPU_PART_AZURE_COBALT_100)
216218

217219
/* Fujitsu Erratum 010001 affects A64FX 1.0 and 1.1, (v0r0 and v1r0) */

‎arch/arm64/kernel/cpu_errata.c

+9-1
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,14 @@ static const struct midr_range erratum_spec_ssbs_list[] = {
472472
};
473473
#endif
474474

475+
#ifdef CONFIG_AMPERE_ERRATUM_AC03_CPU_38
476+
static const struct midr_range erratum_ac03_cpu_38_list[] = {
477+
MIDR_ALL_VERSIONS(MIDR_AMPERE1),
478+
MIDR_ALL_VERSIONS(MIDR_AMPERE1A),
479+
{},
480+
};
481+
#endif
482+
475483
const struct arm64_cpu_capabilities arm64_errata[] = {
476484
#ifdef CONFIG_ARM64_WORKAROUND_CLEAN_CACHE
477485
{
@@ -789,7 +797,7 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
789797
{
790798
.desc = "AmpereOne erratum AC03_CPU_38",
791799
.capability = ARM64_WORKAROUND_AMPERE_AC03_CPU_38,
792-
ERRATA_MIDR_ALL_VERSIONS(MIDR_AMPERE1),
800+
ERRATA_MIDR_RANGE_LIST(erratum_ac03_cpu_38_list),
793801
},
794802
#endif
795803
{

0 commit comments

Comments
 (0)