Skip to content

Commit 4f6cdf2

Browse files
committed
Merge branches 'for-next/acpi', 'for-next/cpufeatures', 'for-next/csum', 'for-next/e0pd', 'for-next/entry', 'for-next/kbuild', 'for-next/kexec/cleanup', 'for-next/kexec/file-kdump', 'for-next/misc', 'for-next/nofpsimd', 'for-next/perf' and 'for-next/scs' into for-next/core
* for-next/acpi: ACPI/IORT: Fix 'Number of IDs' handling in iort_id_map() * for-next/cpufeatures: (2 commits) arm64: Introduce ID_ISAR6 CPU register ... * for-next/csum: (2 commits) arm64: csum: Fix pathological zero-length calls ... * for-next/e0pd: (7 commits) arm64: kconfig: Fix alignment of E0PD help text ... * for-next/entry: (5 commits) arm64: entry: cleanup sp_el0 manipulation ... * for-next/kbuild: (4 commits) arm64: kbuild: remove compressed images on 'make ARCH=arm64 (dist)clean' ... * for-next/kexec/cleanup: (11 commits) Revert "arm64: kexec: make dtb_mem always enabled" ... * for-next/kexec/file-kdump: (2 commits) arm64: kexec_file: add crash dump support ... * for-next/misc: (12 commits) arm64: entry: Avoid empty alternatives entries ... * for-next/nofpsimd: (7 commits) arm64: nofpsmid: Handle TIF_FOREIGN_FPSTATE flag cleanly ... * for-next/perf: (2 commits) perf/imx_ddr: Fix cpu hotplug state cleanup ... * for-next/scs: (6 commits) arm64: kernel: avoid x18 in __cpu_soft_restart ...
12 parents 3c23b83 + 8e3747b + c2c24ed + e717d93 + 3e39341 + d7bbd6c + 1595fe2 + 3751e72 + 108eae2 + 52f73c3 + 9ee68b3 + 500d14a commit 4f6cdf2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+954
-382
lines changed

Documentation/arm64/cpu-feature-registers.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,12 @@ infrastructure:
200200
+------------------------------+---------+---------+
201201
| Name | bits | visible |
202202
+------------------------------+---------+---------+
203+
| I8MM | [55-52] | y |
204+
+------------------------------+---------+---------+
205+
| DGH | [51-48] | y |
206+
+------------------------------+---------+---------+
207+
| BF16 | [47-44] | y |
208+
+------------------------------+---------+---------+
203209
| SB | [39-36] | y |
204210
+------------------------------+---------+---------+
205211
| FRINTTS | [35-32] | y |
@@ -234,10 +240,18 @@ infrastructure:
234240
+------------------------------+---------+---------+
235241
| Name | bits | visible |
236242
+------------------------------+---------+---------+
243+
| F64MM | [59-56] | y |
244+
+------------------------------+---------+---------+
245+
| F32MM | [55-52] | y |
246+
+------------------------------+---------+---------+
247+
| I8MM | [47-44] | y |
248+
+------------------------------+---------+---------+
237249
| SM4 | [43-40] | y |
238250
+------------------------------+---------+---------+
239251
| SHA3 | [35-32] | y |
240252
+------------------------------+---------+---------+
253+
| BF16 | [23-20] | y |
254+
+------------------------------+---------+---------+
241255
| BitPerm | [19-16] | y |
242256
+------------------------------+---------+---------+
243257
| AES | [7-4] | y |

Documentation/arm64/elf_hwcaps.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,33 @@ HWCAP2_FRINT
204204

205205
Functionality implied by ID_AA64ISAR1_EL1.FRINTTS == 0b0001.
206206

207+
HWCAP2_SVEI8MM
208+
209+
Functionality implied by ID_AA64ZFR0_EL1.I8MM == 0b0001.
210+
211+
HWCAP2_SVEF32MM
212+
213+
Functionality implied by ID_AA64ZFR0_EL1.F32MM == 0b0001.
214+
215+
HWCAP2_SVEF64MM
216+
217+
Functionality implied by ID_AA64ZFR0_EL1.F64MM == 0b0001.
218+
219+
HWCAP2_SVEBF16
220+
221+
Functionality implied by ID_AA64ZFR0_EL1.BF16 == 0b0001.
222+
223+
HWCAP2_I8MM
224+
225+
Functionality implied by ID_AA64ISAR1_EL1.I8MM == 0b0001.
226+
227+
HWCAP2_BF16
228+
229+
Functionality implied by ID_AA64ISAR1_EL1.BF16 == 0b0001.
230+
231+
HWCAP2_DGH
232+
233+
Functionality implied by ID_AA64ISAR1_EL1.DGH == 0b0001.
207234

208235
4. Unused AT_HWCAP bits
209236
-----------------------

arch/arm64/Kconfig

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ config ARM64
161161
select HAVE_PERF_USER_STACK_DUMP
162162
select HAVE_REGS_AND_STACK_ACCESS_API
163163
select HAVE_FUNCTION_ARG_ACCESS_API
164+
select HAVE_FUTEX_CMPXCHG if FUTEX
164165
select HAVE_RCU_TABLE_FREE
165166
select HAVE_RSEQ
166167
select HAVE_STACKPROTECTOR
@@ -301,6 +302,9 @@ config ARCH_SUPPORTS_UPROBES
301302
config ARCH_PROC_KCORE_TEXT
302303
def_bool y
303304

305+
config BROKEN_GAS_INST
306+
def_bool !$(as-instr,1:\n.inst 0\n.rept . - 1b\n\nnop\n.endr\n)
307+
304308
config KASAN_SHADOW_OFFSET
305309
hex
306310
depends on KASAN
@@ -1363,6 +1367,11 @@ config ARM64_PAN
13631367
instruction if the cpu does not implement the feature.
13641368

13651369
config ARM64_LSE_ATOMICS
1370+
bool
1371+
default ARM64_USE_LSE_ATOMICS
1372+
depends on $(as-instr,.arch_extension lse)
1373+
1374+
config ARM64_USE_LSE_ATOMICS
13661375
bool "Atomic instructions"
13671376
depends on JUMP_LABEL
13681377
default y
@@ -1484,6 +1493,22 @@ config ARM64_PTR_AUTH
14841493

14851494
endmenu
14861495

1496+
menu "ARMv8.5 architectural features"
1497+
1498+
config ARM64_E0PD
1499+
bool "Enable support for E0PD"
1500+
default y
1501+
help
1502+
E0PD (part of the ARMv8.5 extensions) allows us to ensure
1503+
that EL0 accesses made via TTBR1 always fault in constant time,
1504+
providing similar benefits to KASLR as those provided by KPTI, but
1505+
with lower overhead and without disrupting legitimate access to
1506+
kernel memory such as SPE.
1507+
1508+
This option enables E0PD for TTBR1 where available.
1509+
1510+
endmenu
1511+
14871512
config ARM64_SVE
14881513
bool "ARM Scalable Vector Extension support"
14891514
default y
@@ -1544,7 +1569,7 @@ config ARM64_MODULE_PLTS
15441569

15451570
config ARM64_PSEUDO_NMI
15461571
bool "Support for NMI-like interrupts"
1547-
select CONFIG_ARM_GIC_V3
1572+
select ARM_GIC_V3
15481573
help
15491574
Adds support for mimicking Non-Maskable Interrupts through the use of
15501575
GIC interrupt priority. This support requires version 3 or later of

arch/arm64/Makefile

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,8 @@ LDFLAGS_vmlinux += --fix-cortex-a53-843419
3030
endif
3131
endif
3232

33-
# Check for binutils support for specific extensions
34-
lseinstr := $(call as-instr,.arch_extension lse,-DCONFIG_AS_LSE=1)
35-
36-
ifeq ($(CONFIG_ARM64_LSE_ATOMICS), y)
37-
ifeq ($(lseinstr),)
33+
ifeq ($(CONFIG_ARM64_USE_LSE_ATOMICS), y)
34+
ifneq ($(CONFIG_ARM64_LSE_ATOMICS), y)
3835
$(warning LSE atomics not supported by binutils)
3936
endif
4037
endif
@@ -45,19 +42,15 @@ cc_has_k_constraint := $(call try-run,echo \
4542
return 0; \
4643
}' | $(CC) -S -x c -o "$$TMP" -,,-DCONFIG_CC_HAS_K_CONSTRAINT=1)
4744

48-
ifeq ($(CONFIG_ARM64), y)
49-
brokengasinst := $(call as-instr,1:\n.inst 0\n.rept . - 1b\n\nnop\n.endr\n,,-DCONFIG_BROKEN_GAS_INST=1)
50-
51-
ifneq ($(brokengasinst),)
45+
ifeq ($(CONFIG_BROKEN_GAS_INST),y)
5246
$(warning Detected assembler with broken .inst; disassembly will be unreliable)
53-
endif
5447
endif
5548

56-
KBUILD_CFLAGS += -mgeneral-regs-only $(lseinstr) $(brokengasinst) \
49+
KBUILD_CFLAGS += -mgeneral-regs-only \
5750
$(compat_vdso) $(cc_has_k_constraint)
5851
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
5952
KBUILD_CFLAGS += $(call cc-disable-warning, psabi)
60-
KBUILD_AFLAGS += $(lseinstr) $(brokengasinst) $(compat_vdso)
53+
KBUILD_AFLAGS += $(compat_vdso)
6154

6255
KBUILD_CFLAGS += $(call cc-option,-mabi=lp64)
6356
KBUILD_AFLAGS += $(call cc-option,-mabi=lp64)

arch/arm64/boot/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
OBJCOPYFLAGS_Image :=-O binary -R .note -R .note.gnu.build-id -R .comment -S
1818

19-
targets := Image Image.gz
19+
targets := Image Image.bz2 Image.gz Image.lz4 Image.lzma Image.lzo
2020

2121
$(obj)/Image: vmlinux FORCE
2222
$(call if_changed,objcopy)

arch/arm64/include/asm/alternative.h

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,16 @@ void apply_alternatives_module(void *start, size_t length);
3535
static inline void apply_alternatives_module(void *start, size_t length) { }
3636
#endif
3737

38-
#define ALTINSTR_ENTRY(feature,cb) \
38+
#define ALTINSTR_ENTRY(feature) \
3939
" .word 661b - .\n" /* label */ \
40-
" .if " __stringify(cb) " == 0\n" \
4140
" .word 663f - .\n" /* new instruction */ \
42-
" .else\n" \
41+
" .hword " __stringify(feature) "\n" /* feature bit */ \
42+
" .byte 662b-661b\n" /* source len */ \
43+
" .byte 664f-663f\n" /* replacement len */
44+
45+
#define ALTINSTR_ENTRY_CB(feature, cb) \
46+
" .word 661b - .\n" /* label */ \
4347
" .word " __stringify(cb) "- .\n" /* callback */ \
44-
" .endif\n" \
4548
" .hword " __stringify(feature) "\n" /* feature bit */ \
4649
" .byte 662b-661b\n" /* source len */ \
4750
" .byte 664f-663f\n" /* replacement len */
@@ -62,33 +65,40 @@ static inline void apply_alternatives_module(void *start, size_t length) { }
6265
*
6366
* Alternatives with callbacks do not generate replacement instructions.
6467
*/
65-
#define __ALTERNATIVE_CFG(oldinstr, newinstr, feature, cfg_enabled, cb) \
68+
#define __ALTERNATIVE_CFG(oldinstr, newinstr, feature, cfg_enabled) \
6669
".if "__stringify(cfg_enabled)" == 1\n" \
6770
"661:\n\t" \
6871
oldinstr "\n" \
6972
"662:\n" \
7073
".pushsection .altinstructions,\"a\"\n" \
71-
ALTINSTR_ENTRY(feature,cb) \
74+
ALTINSTR_ENTRY(feature) \
7275
".popsection\n" \
73-
" .if " __stringify(cb) " == 0\n" \
7476
".pushsection .altinstr_replacement, \"a\"\n" \
7577
"663:\n\t" \
7678
newinstr "\n" \
7779
"664:\n\t" \
7880
".popsection\n\t" \
7981
".org . - (664b-663b) + (662b-661b)\n\t" \
8082
".org . - (662b-661b) + (664b-663b)\n" \
81-
".else\n\t" \
83+
".endif\n"
84+
85+
#define __ALTERNATIVE_CFG_CB(oldinstr, feature, cfg_enabled, cb) \
86+
".if "__stringify(cfg_enabled)" == 1\n" \
87+
"661:\n\t" \
88+
oldinstr "\n" \
89+
"662:\n" \
90+
".pushsection .altinstructions,\"a\"\n" \
91+
ALTINSTR_ENTRY_CB(feature, cb) \
92+
".popsection\n" \
8293
"663:\n\t" \
8394
"664:\n\t" \
84-
".endif\n" \
8595
".endif\n"
8696

8797
#define _ALTERNATIVE_CFG(oldinstr, newinstr, feature, cfg, ...) \
88-
__ALTERNATIVE_CFG(oldinstr, newinstr, feature, IS_ENABLED(cfg), 0)
98+
__ALTERNATIVE_CFG(oldinstr, newinstr, feature, IS_ENABLED(cfg))
8999

90100
#define ALTERNATIVE_CB(oldinstr, cb) \
91-
__ALTERNATIVE_CFG(oldinstr, "NOT_AN_INSTRUCTION", ARM64_CB_PATCH, 1, cb)
101+
__ALTERNATIVE_CFG_CB(oldinstr, ARM64_CB_PATCH, 1, cb)
92102
#else
93103

94104
#include <asm/assembler.h>

arch/arm64/include/asm/assembler.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@
4040
msr daif, \flags
4141
.endm
4242

43-
/* Only on aarch64 pstate, PSR_D_BIT is different for aarch32 */
44-
.macro inherit_daif, pstate:req, tmp:req
45-
and \tmp, \pstate, #(PSR_D_BIT | PSR_A_BIT | PSR_I_BIT | PSR_F_BIT)
46-
msr daif, \tmp
47-
.endm
48-
4943
/* IRQ is the lowest priority flag, unconditionally unmask the rest. */
5044
.macro enable_da_f
5145
msr daifclr, #(8 | 4 | 1)
@@ -85,13 +79,6 @@
8579
9990:
8680
.endm
8781

88-
/*
89-
* SMP data memory barrier
90-
*/
91-
.macro smp_dmb, opt
92-
dmb \opt
93-
.endm
94-
9582
/*
9683
* RAS Error Synchronization barrier
9784
*/

arch/arm64/include/asm/atomic_ll_sc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#include <linux/stringify.h>
1414

15-
#if IS_ENABLED(CONFIG_ARM64_LSE_ATOMICS) && IS_ENABLED(CONFIG_AS_LSE)
15+
#ifdef CONFIG_ARM64_LSE_ATOMICS
1616
#define __LL_SC_FALLBACK(asm_ops) \
1717
" b 3f\n" \
1818
" .subsection 1\n" \

0 commit comments

Comments
 (0)