Skip to content

Commit 041b106

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: - Expand the speculative SSBS errata workaround to more CPUs - Ensure jump label changes are visible to all CPUs with a kick_all_cpus_sync() (and also enable jump label batching as part of the fix) - The shadow call stack sanitiser is currently incompatible with Rust, make CONFIG_RUST conditional on !CONFIG_SHADOW_CALL_STACK * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: jump_label: Ensure patched jump_labels are visible to all CPUs rust: SHADOW_CALL_STACK is incompatible with Rust arm64: errata: Expand speculative SSBS workaround (again) arm64: cputype: Add Cortex-A725 definitions arm64: cputype: Add Cortex-X1C definitions
2 parents 1c42462 + cfb00a3 commit 041b106

File tree

7 files changed

+59
-9
lines changed

7 files changed

+59
-9
lines changed

Documentation/arch/arm64/silicon-errata.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,18 @@ stable kernels.
122122
+----------------+-----------------+-----------------+-----------------------------+
123123
| ARM | Cortex-A76 | #1490853 | N/A |
124124
+----------------+-----------------+-----------------+-----------------------------+
125+
| ARM | Cortex-A76 | #3324349 | ARM64_ERRATUM_3194386 |
126+
+----------------+-----------------+-----------------+-----------------------------+
125127
| ARM | Cortex-A77 | #1491015 | N/A |
126128
+----------------+-----------------+-----------------+-----------------------------+
127129
| ARM | Cortex-A77 | #1508412 | ARM64_ERRATUM_1508412 |
128130
+----------------+-----------------+-----------------+-----------------------------+
131+
| ARM | Cortex-A77 | #3324348 | ARM64_ERRATUM_3194386 |
132+
+----------------+-----------------+-----------------+-----------------------------+
133+
| ARM | Cortex-A78 | #3324344 | ARM64_ERRATUM_3194386 |
134+
+----------------+-----------------+-----------------+-----------------------------+
135+
| ARM | Cortex-A78C | #3324346,3324347| ARM64_ERRATUM_3194386 |
136+
+----------------+-----------------+-----------------+-----------------------------+
129137
| ARM | Cortex-A710 | #2119858 | ARM64_ERRATUM_2119858 |
130138
+----------------+-----------------+-----------------+-----------------------------+
131139
| ARM | Cortex-A710 | #2054223 | ARM64_ERRATUM_2054223 |
@@ -138,8 +146,14 @@ stable kernels.
138146
+----------------+-----------------+-----------------+-----------------------------+
139147
| ARM | Cortex-A720 | #3456091 | ARM64_ERRATUM_3194386 |
140148
+----------------+-----------------+-----------------+-----------------------------+
149+
| ARM | Cortex-A725 | #3456106 | ARM64_ERRATUM_3194386 |
150+
+----------------+-----------------+-----------------+-----------------------------+
141151
| ARM | Cortex-X1 | #1502854 | N/A |
142152
+----------------+-----------------+-----------------+-----------------------------+
153+
| ARM | Cortex-X1 | #3324344 | ARM64_ERRATUM_3194386 |
154+
+----------------+-----------------+-----------------+-----------------------------+
155+
| ARM | Cortex-X1C | #3324346 | ARM64_ERRATUM_3194386 |
156+
+----------------+-----------------+-----------------+-----------------------------+
143157
| ARM | Cortex-X2 | #2119858 | ARM64_ERRATUM_2119858 |
144158
+----------------+-----------------+-----------------+-----------------------------+
145159
| ARM | Cortex-X2 | #2224489 | ARM64_ERRATUM_2224489 |
@@ -160,6 +174,8 @@ stable kernels.
160174
+----------------+-----------------+-----------------+-----------------------------+
161175
| ARM | Neoverse-N1 | #1542419 | ARM64_ERRATUM_1542419 |
162176
+----------------+-----------------+-----------------+-----------------------------+
177+
| ARM | Neoverse-N1 | #3324349 | ARM64_ERRATUM_3194386 |
178+
+----------------+-----------------+-----------------+-----------------------------+
163179
| ARM | Neoverse-N2 | #2139208 | ARM64_ERRATUM_2139208 |
164180
+----------------+-----------------+-----------------+-----------------------------+
165181
| ARM | Neoverse-N2 | #2067961 | ARM64_ERRATUM_2067961 |
@@ -170,6 +186,8 @@ stable kernels.
170186
+----------------+-----------------+-----------------+-----------------------------+
171187
| ARM | Neoverse-V1 | #1619801 | N/A |
172188
+----------------+-----------------+-----------------+-----------------------------+
189+
| ARM | Neoverse-V1 | #3324341 | ARM64_ERRATUM_3194386 |
190+
+----------------+-----------------+-----------------+-----------------------------+
173191
| ARM | Neoverse-V2 | #3324336 | ARM64_ERRATUM_3194386 |
174192
+----------------+-----------------+-----------------+-----------------------------+
175193
| ARM | Neoverse-V3 | #3312417 | ARM64_ERRATUM_3194386 |

arch/arm64/Kconfig

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,30 +1069,40 @@ config ARM64_ERRATUM_3117295
10691069
If unsure, say Y.
10701070

10711071
config ARM64_ERRATUM_3194386
1072-
bool "Cortex-{A720,X4,X925}/Neoverse-V3: workaround for MSR SSBS not self-synchronizing"
1072+
bool "Cortex-*/Neoverse-*: workaround for MSR SSBS not self-synchronizing"
10731073
default y
10741074
help
10751075
This option adds the workaround for the following errata:
10761076

1077+
* ARM Cortex-A76 erratum 3324349
1078+
* ARM Cortex-A77 erratum 3324348
1079+
* ARM Cortex-A78 erratum 3324344
1080+
* ARM Cortex-A78C erratum 3324346
1081+
* ARM Cortex-A78C erratum 3324347
10771082
* ARM Cortex-A710 erratam 3324338
10781083
* ARM Cortex-A720 erratum 3456091
1084+
* ARM Cortex-A725 erratum 3456106
1085+
* ARM Cortex-X1 erratum 3324344
1086+
* ARM Cortex-X1C erratum 3324346
10791087
* ARM Cortex-X2 erratum 3324338
10801088
* ARM Cortex-X3 erratum 3324335
10811089
* ARM Cortex-X4 erratum 3194386
10821090
* ARM Cortex-X925 erratum 3324334
1091+
* ARM Neoverse-N1 erratum 3324349
10831092
* ARM Neoverse N2 erratum 3324339
1093+
* ARM Neoverse-V1 erratum 3324341
10841094
* ARM Neoverse V2 erratum 3324336
10851095
* ARM Neoverse-V3 erratum 3312417
10861096

10871097
On affected cores "MSR SSBS, #0" instructions may not affect
10881098
subsequent speculative instructions, which may permit unexepected
10891099
speculative store bypassing.
10901100

1091-
Work around this problem by placing a speculation barrier after
1092-
kernel changes to SSBS. The presence of the SSBS special-purpose
1093-
register is hidden from hwcaps and EL0 reads of ID_AA64PFR1_EL1, such
1094-
that userspace will use the PR_SPEC_STORE_BYPASS prctl to change
1095-
SSBS.
1101+
Work around this problem by placing a Speculation Barrier (SB) or
1102+
Instruction Synchronization Barrier (ISB) after kernel changes to
1103+
SSBS. The presence of the SSBS special-purpose register is hidden
1104+
from hwcaps and EL0 reads of ID_AA64PFR1_EL1, such that userspace
1105+
will use the PR_SPEC_STORE_BYPASS prctl to change SSBS.
10961106

10971107
If unsure, say Y.
10981108

arch/arm64/include/asm/cputype.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,14 @@
8686
#define ARM_CPU_PART_CORTEX_X2 0xD48
8787
#define ARM_CPU_PART_NEOVERSE_N2 0xD49
8888
#define ARM_CPU_PART_CORTEX_A78C 0xD4B
89+
#define ARM_CPU_PART_CORTEX_X1C 0xD4C
8990
#define ARM_CPU_PART_CORTEX_X3 0xD4E
9091
#define ARM_CPU_PART_NEOVERSE_V2 0xD4F
9192
#define ARM_CPU_PART_CORTEX_A720 0xD81
9293
#define ARM_CPU_PART_CORTEX_X4 0xD82
9394
#define ARM_CPU_PART_NEOVERSE_V3 0xD84
9495
#define ARM_CPU_PART_CORTEX_X925 0xD85
96+
#define ARM_CPU_PART_CORTEX_A725 0xD87
9597

9698
#define APM_CPU_PART_XGENE 0x000
9799
#define APM_CPU_VAR_POTENZA 0x00
@@ -165,12 +167,14 @@
165167
#define MIDR_CORTEX_X2 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X2)
166168
#define MIDR_NEOVERSE_N2 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_N2)
167169
#define MIDR_CORTEX_A78C MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A78C)
170+
#define MIDR_CORTEX_X1C MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X1C)
168171
#define MIDR_CORTEX_X3 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X3)
169172
#define MIDR_NEOVERSE_V2 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_V2)
170173
#define MIDR_CORTEX_A720 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A720)
171174
#define MIDR_CORTEX_X4 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X4)
172175
#define MIDR_NEOVERSE_V3 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_V3)
173176
#define MIDR_CORTEX_X925 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X925)
177+
#define MIDR_CORTEX_A725 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A725)
174178
#define MIDR_THUNDERX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX)
175179
#define MIDR_THUNDERX_81XX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX_81XX)
176180
#define MIDR_THUNDERX_83XX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX_83XX)

arch/arm64/include/asm/jump_label.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <linux/types.h>
1414
#include <asm/insn.h>
1515

16+
#define HAVE_JUMP_LABEL_BATCH
1617
#define JUMP_LABEL_NOP_SIZE AARCH64_INSN_SIZE
1718

1819
#define JUMP_TABLE_ENTRY(key, label) \

arch/arm64/kernel/cpu_errata.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,15 +434,24 @@ static const struct midr_range erratum_spec_unpriv_load_list[] = {
434434

435435
#ifdef CONFIG_ARM64_ERRATUM_3194386
436436
static const struct midr_range erratum_spec_ssbs_list[] = {
437+
MIDR_ALL_VERSIONS(MIDR_CORTEX_A76),
438+
MIDR_ALL_VERSIONS(MIDR_CORTEX_A77),
439+
MIDR_ALL_VERSIONS(MIDR_CORTEX_A78),
440+
MIDR_ALL_VERSIONS(MIDR_CORTEX_A78C),
437441
MIDR_ALL_VERSIONS(MIDR_CORTEX_A710),
438442
MIDR_ALL_VERSIONS(MIDR_CORTEX_A720),
443+
MIDR_ALL_VERSIONS(MIDR_CORTEX_A725),
444+
MIDR_ALL_VERSIONS(MIDR_CORTEX_X1),
445+
MIDR_ALL_VERSIONS(MIDR_CORTEX_X1C),
439446
MIDR_ALL_VERSIONS(MIDR_CORTEX_X2),
440447
MIDR_ALL_VERSIONS(MIDR_CORTEX_X3),
441448
MIDR_ALL_VERSIONS(MIDR_CORTEX_X4),
442449
MIDR_ALL_VERSIONS(MIDR_CORTEX_X925),
450+
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N1),
443451
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N2),
444-
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V3),
452+
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V1),
445453
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V2),
454+
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V3),
446455
{}
447456
};
448457
#endif

arch/arm64/kernel/jump_label.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@
77
*/
88
#include <linux/kernel.h>
99
#include <linux/jump_label.h>
10+
#include <linux/smp.h>
1011
#include <asm/insn.h>
1112
#include <asm/patching.h>
1213

13-
void arch_jump_label_transform(struct jump_entry *entry,
14-
enum jump_label_type type)
14+
bool arch_jump_label_transform_queue(struct jump_entry *entry,
15+
enum jump_label_type type)
1516
{
1617
void *addr = (void *)jump_entry_code(entry);
1718
u32 insn;
@@ -25,4 +26,10 @@ void arch_jump_label_transform(struct jump_entry *entry,
2526
}
2627

2728
aarch64_insn_patch_text_nosync(addr, insn);
29+
return true;
30+
}
31+
32+
void arch_jump_label_transform_apply(void)
33+
{
34+
kick_all_cpus_sync();
2835
}

init/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1902,6 +1902,7 @@ config RUST
19021902
depends on !MODVERSIONS
19031903
depends on !GCC_PLUGINS
19041904
depends on !RANDSTRUCT
1905+
depends on !SHADOW_CALL_STACK
19051906
depends on !DEBUG_INFO_BTF || PAHOLE_HAS_LANG_EXCLUDE
19061907
help
19071908
Enables Rust support in the kernel.

0 commit comments

Comments
 (0)