Skip to content

Commit 1df046a

Browse files
committed
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 fixes from Catalin Marinas: - Cortex-A55 errata workaround (repeat TLBI) - AMPERE1 added to the Spectre-BHB affected list - MTE fix to avoid setting PG_mte_tagged if no tags have been touched on a page - Fixed typo in the SCTLR_EL1.SPINTMASK bit naming (the commit log has other typos) - perf: return value check in ali_drw_pmu_probe(), ALIBABA_UNCORE_DRW_PMU dependency on ACPI * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: Add AMPERE1 to the Spectre-BHB affected list arm64: mte: Avoid setting PG_mte_tagged if no tags cleared or restored MAINTAINERS: rectify file entry in ALIBABA PMU DRIVER drivers/perf: ALIBABA_UNCORE_DRW_PMU should depend on ACPI drivers/perf: fix return value check in ali_drw_pmu_probe() arm64: errata: Add Cortex-A55 to the repeat tlbi list arm64/sysreg: Fix typo in SCTR_EL1.SPINTMASK
2 parents 5e714bf + 0e5d5ae commit 1df046a

File tree

11 files changed

+52
-8
lines changed

11 files changed

+52
-8
lines changed

Documentation/arm64/silicon-errata.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ stable kernels.
7676
+----------------+-----------------+-----------------+-----------------------------+
7777
| ARM | Cortex-A55 | #1530923 | ARM64_ERRATUM_1530923 |
7878
+----------------+-----------------+-----------------+-----------------------------+
79+
| ARM | Cortex-A55 | #2441007 | ARM64_ERRATUM_2441007 |
80+
+----------------+-----------------+-----------------+-----------------------------+
7981
| ARM | Cortex-A57 | #832075 | ARM64_ERRATUM_832075 |
8082
+----------------+-----------------+-----------------+-----------------------------+
8183
| ARM | Cortex-A57 | #852523 | N/A |

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ ALIBABA PMU DRIVER
752752
M: Shuai Xue <xueshuai@linux.alibaba.com>
753753
S: Supported
754754
F: Documentation/admin-guide/perf/alibaba_pmu.rst
755-
F: drivers/perf/alibaba_uncore_dwr_pmu.c
755+
F: drivers/perf/alibaba_uncore_drw_pmu.c
756756

757757
ALIENWARE WMI DRIVER
758758
L: Dell.Client.Kernel@dell.com

arch/arm64/Kconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,23 @@ config ARM64_ERRATUM_1530923
632632
config ARM64_WORKAROUND_REPEAT_TLBI
633633
bool
634634

635+
config ARM64_ERRATUM_2441007
636+
bool "Cortex-A55: Completion of affected memory accesses might not be guaranteed by completion of a TLBI"
637+
default y
638+
select ARM64_WORKAROUND_REPEAT_TLBI
639+
help
640+
This option adds a workaround for ARM Cortex-A55 erratum #2441007.
641+
642+
Under very rare circumstances, affected Cortex-A55 CPUs
643+
may not handle a race between a break-before-make sequence on one
644+
CPU, and another CPU accessing the same page. This could allow a
645+
store to a page that has been unmapped.
646+
647+
Work around this by adding the affected CPUs to the list that needs
648+
TLB sequences to be done twice.
649+
650+
If unsure, say Y.
651+
635652
config ARM64_ERRATUM_1286807
636653
bool "Cortex-A76: Modification of the translation table for a virtual address might lead to read-after-read ordering violation"
637654
default y

arch/arm64/include/asm/cputype.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
#define ARM_CPU_IMP_FUJITSU 0x46
6161
#define ARM_CPU_IMP_HISI 0x48
6262
#define ARM_CPU_IMP_APPLE 0x61
63+
#define ARM_CPU_IMP_AMPERE 0xC0
6364

6465
#define ARM_CPU_PART_AEM_V8 0xD0F
6566
#define ARM_CPU_PART_FOUNDATION 0xD00
@@ -123,6 +124,8 @@
123124
#define APPLE_CPU_PART_M1_ICESTORM_MAX 0x028
124125
#define APPLE_CPU_PART_M1_FIRESTORM_MAX 0x029
125126

127+
#define AMPERE_CPU_PART_AMPERE1 0xAC3
128+
126129
#define MIDR_CORTEX_A53 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A53)
127130
#define MIDR_CORTEX_A57 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A57)
128131
#define MIDR_CORTEX_A72 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A72)
@@ -172,6 +175,7 @@
172175
#define MIDR_APPLE_M1_FIRESTORM_PRO MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_FIRESTORM_PRO)
173176
#define MIDR_APPLE_M1_ICESTORM_MAX MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_ICESTORM_MAX)
174177
#define MIDR_APPLE_M1_FIRESTORM_MAX MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_FIRESTORM_MAX)
178+
#define MIDR_AMPERE1 MIDR_CPU_MODEL(ARM_CPU_IMP_AMPERE, AMPERE_CPU_PART_AMPERE1)
175179

176180
/* Fujitsu Erratum 010001 affects A64FX 1.0 and 1.1, (v0r0 and v1r0) */
177181
#define MIDR_FUJITSU_ERRATUM_010001 MIDR_FUJITSU_A64FX

arch/arm64/kernel/cpu_errata.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,11 @@ static const struct arm64_cpu_capabilities arm64_repeat_tlbi_list[] = {
230230
ERRATA_MIDR_RANGE(MIDR_QCOM_KRYO_4XX_GOLD, 0xc, 0xe, 0xf, 0xe),
231231
},
232232
#endif
233+
#ifdef CONFIG_ARM64_ERRATUM_2441007
234+
{
235+
ERRATA_MIDR_ALL_VERSIONS(MIDR_CORTEX_A55),
236+
},
237+
#endif
233238
#ifdef CONFIG_ARM64_ERRATUM_2441009
234239
{
235240
/* Cortex-A510 r0p0 -> r1p1. Fixed in r1p2 */

arch/arm64/kernel/mte.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,12 @@ static void mte_sync_page_tags(struct page *page, pte_t old_pte,
4848
if (!pte_is_tagged)
4949
return;
5050

51-
mte_clear_page_tags(page_address(page));
51+
/*
52+
* Test PG_mte_tagged again in case it was racing with another
53+
* set_pte_at().
54+
*/
55+
if (!test_and_set_bit(PG_mte_tagged, &page->flags))
56+
mte_clear_page_tags(page_address(page));
5257
}
5358

5459
void mte_sync_tags(pte_t old_pte, pte_t pte)
@@ -64,7 +69,7 @@ void mte_sync_tags(pte_t old_pte, pte_t pte)
6469

6570
/* if PG_mte_tagged is set, tags have already been initialised */
6671
for (i = 0; i < nr_pages; i++, page++) {
67-
if (!test_and_set_bit(PG_mte_tagged, &page->flags))
72+
if (!test_bit(PG_mte_tagged, &page->flags))
6873
mte_sync_page_tags(page, old_pte, check_swap,
6974
pte_is_tagged);
7075
}

arch/arm64/kernel/proton-pack.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,10 @@ u8 spectre_bhb_loop_affected(int scope)
868868
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N1),
869869
{},
870870
};
871+
static const struct midr_range spectre_bhb_k11_list[] = {
872+
MIDR_ALL_VERSIONS(MIDR_AMPERE1),
873+
{},
874+
};
871875
static const struct midr_range spectre_bhb_k8_list[] = {
872876
MIDR_ALL_VERSIONS(MIDR_CORTEX_A72),
873877
MIDR_ALL_VERSIONS(MIDR_CORTEX_A57),
@@ -878,6 +882,8 @@ u8 spectre_bhb_loop_affected(int scope)
878882
k = 32;
879883
else if (is_midr_in_range_list(read_cpuid_id(), spectre_bhb_k24_list))
880884
k = 24;
885+
else if (is_midr_in_range_list(read_cpuid_id(), spectre_bhb_k11_list))
886+
k = 11;
881887
else if (is_midr_in_range_list(read_cpuid_id(), spectre_bhb_k8_list))
882888
k = 8;
883889

arch/arm64/mm/mteswap.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ bool mte_restore_tags(swp_entry_t entry, struct page *page)
5353
if (!tags)
5454
return false;
5555

56-
mte_restore_page_tags(page_address(page), tags);
56+
/*
57+
* Test PG_mte_tagged again in case it was racing with another
58+
* set_pte_at().
59+
*/
60+
if (!test_and_set_bit(PG_mte_tagged, &page->flags))
61+
mte_restore_page_tags(page_address(page), tags);
5762

5863
return true;
5964
}

arch/arm64/tools/sysreg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ EndSysreg
732732

733733
Sysreg SCTLR_EL1 3 0 1 0 0
734734
Field 63 TIDCP
735-
Field 62 SPINMASK
735+
Field 62 SPINTMASK
736736
Field 61 NMI
737737
Field 60 EnTP2
738738
Res0 59:58

drivers/perf/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ config APPLE_M1_CPU_PMU
185185

186186
config ALIBABA_UNCORE_DRW_PMU
187187
tristate "Alibaba T-Head Yitian 710 DDR Sub-system Driveway PMU driver"
188-
depends on ARM64 || COMPILE_TEST
188+
depends on (ARM64 && ACPI) || COMPILE_TEST
189189
help
190190
Support for Driveway PMU events monitoring on Yitian 710 DDR
191191
Sub-system.

0 commit comments

Comments
 (0)