Skip to content

Commit c620f7b

Browse files
committed
Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 updates from Will Deacon: "Mostly just incremental improvements here: - Introduce AT_HWCAP2 for advertising CPU features to userspace - Expose SVE2 availability to userspace - Support for "data cache clean to point of deep persistence" (DC PODP) - Honour "mitigations=off" on the cmdline and advertise status via sysfs - CPU timer erratum workaround (Neoverse-N1 #1188873) - Introduce perf PMU driver for the SMMUv3 performance counters - Add config option to disable the kuser helpers page for AArch32 tasks - Futex modifications to ensure liveness under contention - Rework debug exception handling to seperate kernel and user handlers - Non-critical fixes and cleanup" * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (92 commits) Documentation: Add ARM64 to kernel-parameters.rst arm64/speculation: Support 'mitigations=' cmdline option arm64: ssbs: Don't treat CPUs with SSBS as unaffected by SSB arm64: enable generic CPU vulnerabilites support arm64: add sysfs vulnerability show for speculative store bypass arm64: Fix size of __early_cpu_boot_status clocksource/arm_arch_timer: Use arch_timer_read_counter to access stable counters clocksource/arm_arch_timer: Remove use of workaround static key clocksource/arm_arch_timer: Drop use of static key in arch_timer_reg_read_stable clocksource/arm_arch_timer: Direcly assign set_next_event workaround arm64: Use arch_timer_read_counter instead of arch_counter_get_cntvct watchdog/sbsa: Use arch_timer_read_counter instead of arch_counter_get_cntvct ARM: vdso: Remove dependency with the arch_timer driver internals arm64: Apply ARM64_ERRATUM_1188873 to Neoverse-N1 arm64: Add part number for Neoverse N1 arm64: Make ARM64_ERRATUM_1188873 depend on COMPAT arm64: Restrict ARM64_ERRATUM_1188873 mitigation to AArch32 arm64: mm: Remove pte_unmap_nested() arm64: Fix compiler warning from pte_unmap() with -Wunused-but-set-variable arm64: compat: Reduce address limit for 64K pages ...
2 parents dd4e5d6 + b33f908 commit c620f7b

Some content is hidden

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

93 files changed

+2537
-833
lines changed

Documentation/admin-guide/kernel-parameters.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ parameter is applicable::
8888
APIC APIC support is enabled.
8989
APM Advanced Power Management support is enabled.
9090
ARM ARM architecture is enabled.
91+
ARM64 ARM64 architecture is enabled.
9192
AX25 Appropriate AX.25 support is enabled.
9293
CLK Common clock infrastructure is enabled.
9394
CMA Contiguous Memory Area support is enabled.

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2548,8 +2548,8 @@
25482548
http://repo.or.cz/w/linux-2.6/mini2440.git
25492549

25502550
mitigations=
2551-
[X86,PPC,S390] Control optional mitigations for CPU
2552-
vulnerabilities. This is a set of curated,
2551+
[X86,PPC,S390,ARM64] Control optional mitigations for
2552+
CPU vulnerabilities. This is a set of curated,
25532553
arch-independent options, each of which is an
25542554
aggregation of existing arch-specific options.
25552555

@@ -2558,11 +2558,13 @@
25582558
improves system performance, but it may also
25592559
expose users to several CPU vulnerabilities.
25602560
Equivalent to: nopti [X86,PPC]
2561+
kpti=0 [ARM64]
25612562
nospectre_v1 [PPC]
25622563
nobp=0 [S390]
2563-
nospectre_v2 [X86,PPC,S390]
2564+
nospectre_v2 [X86,PPC,S390,ARM64]
25642565
spectre_v2_user=off [X86]
25652566
spec_store_bypass_disable=off [X86,PPC]
2567+
ssbd=force-off [ARM64]
25662568
l1tf=off [X86]
25672569

25682570
auto (default)
@@ -2908,10 +2910,10 @@
29082910
check bypass). With this option data leaks are possible
29092911
in the system.
29102912

2911-
nospectre_v2 [X86,PPC_FSL_BOOK3E] Disable all mitigations for the Spectre variant 2
2912-
(indirect branch prediction) vulnerability. System may
2913-
allow data leaks with this option, which is equivalent
2914-
to spectre_v2=off.
2913+
nospectre_v2 [X86,PPC_FSL_BOOK3E,ARM64] Disable all mitigations for
2914+
the Spectre variant 2 (indirect branch prediction)
2915+
vulnerability. System may allow data leaks with this
2916+
option.
29152917

29162918
nospec_store_bypass_disable
29172919
[HW] Disable all mitigations for the Speculative Store Bypass vulnerability

Documentation/arm64/cpu-feature-registers.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,22 @@ infrastructure:
209209
| AT | [35-32] | y |
210210
x--------------------------------------------------x
211211

212+
6) ID_AA64ZFR0_EL1 - SVE feature ID register 0
213+
214+
x--------------------------------------------------x
215+
| Name | bits | visible |
216+
|--------------------------------------------------|
217+
| SM4 | [43-40] | y |
218+
|--------------------------------------------------|
219+
| SHA3 | [35-32] | y |
220+
|--------------------------------------------------|
221+
| BitPerm | [19-16] | y |
222+
|--------------------------------------------------|
223+
| AES | [7-4] | y |
224+
|--------------------------------------------------|
225+
| SVEVer | [3-0] | y |
226+
x--------------------------------------------------x
227+
212228
Appendix I: Example
213229
---------------------------
214230

Documentation/arm64/elf_hwcaps.txt

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ architected discovery mechanism available to userspace code at EL0. The
1313
kernel exposes the presence of these features to userspace through a set
1414
of flags called hwcaps, exposed in the auxilliary vector.
1515

16-
Userspace software can test for features by acquiring the AT_HWCAP entry
17-
of the auxilliary vector, and testing whether the relevant flags are
18-
set, e.g.
16+
Userspace software can test for features by acquiring the AT_HWCAP or
17+
AT_HWCAP2 entry of the auxiliary vector, and testing whether the relevant
18+
flags are set, e.g.
1919

2020
bool floating_point_is_present(void)
2121
{
@@ -135,6 +135,10 @@ HWCAP_DCPOP
135135

136136
Functionality implied by ID_AA64ISAR1_EL1.DPB == 0b0001.
137137

138+
HWCAP2_DCPODP
139+
140+
Functionality implied by ID_AA64ISAR1_EL1.DPB == 0b0010.
141+
138142
HWCAP_SHA3
139143

140144
Functionality implied by ID_AA64ISAR0_EL1.SHA3 == 0b0001.
@@ -159,6 +163,30 @@ HWCAP_SVE
159163

160164
Functionality implied by ID_AA64PFR0_EL1.SVE == 0b0001.
161165

166+
HWCAP2_SVE2
167+
168+
Functionality implied by ID_AA64ZFR0_EL1.SVEVer == 0b0001.
169+
170+
HWCAP2_SVEAES
171+
172+
Functionality implied by ID_AA64ZFR0_EL1.AES == 0b0001.
173+
174+
HWCAP2_SVEPMULL
175+
176+
Functionality implied by ID_AA64ZFR0_EL1.AES == 0b0010.
177+
178+
HWCAP2_SVEBITPERM
179+
180+
Functionality implied by ID_AA64ZFR0_EL1.BitPerm == 0b0001.
181+
182+
HWCAP2_SVESHA3
183+
184+
Functionality implied by ID_AA64ZFR0_EL1.SHA3 == 0b0001.
185+
186+
HWCAP2_SVESM4
187+
188+
Functionality implied by ID_AA64ZFR0_EL1.SM4 == 0b0001.
189+
162190
HWCAP_ASIMDFHM
163191

164192
Functionality implied by ID_AA64ISAR0_EL1.FHM == 0b0001.
@@ -194,3 +222,10 @@ HWCAP_PACG
194222
Functionality implied by ID_AA64ISAR1_EL1.GPA == 0b0001 or
195223
ID_AA64ISAR1_EL1.GPI == 0b0001, as described by
196224
Documentation/arm64/pointer-authentication.txt.
225+
226+
227+
4. Unused AT_HWCAP bits
228+
-----------------------
229+
230+
For interoperation with userspace, the kernel guarantees that bits 62
231+
and 63 of AT_HWCAP will always be returned as 0.

Documentation/arm64/silicon-errata.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ stable kernels.
6161
| ARM | Cortex-A76 | #1188873 | ARM64_ERRATUM_1188873 |
6262
| ARM | Cortex-A76 | #1165522 | ARM64_ERRATUM_1165522 |
6363
| ARM | Cortex-A76 | #1286807 | ARM64_ERRATUM_1286807 |
64+
| ARM | Neoverse-N1 | #1188873 | ARM64_ERRATUM_1188873 |
6465
| ARM | MMU-500 | #841119,#826419 | N/A |
6566
| | | | |
6667
| Cavium | ThunderX ITS | #22375, #24313 | CAVIUM_ERRATUM_22375 |
@@ -77,6 +78,7 @@ stable kernels.
7778
| Hisilicon | Hip0{5,6,7} | #161010101 | HISILICON_ERRATUM_161010101 |
7879
| Hisilicon | Hip0{6,7} | #161010701 | N/A |
7980
| Hisilicon | Hip07 | #161600802 | HISILICON_ERRATUM_161600802 |
81+
| Hisilicon | Hip08 SMMU PMCG | #162001800 | N/A |
8082
| | | | |
8183
| Qualcomm Tech. | Kryo/Falkor v1 | E1003 | QCOM_FALKOR_ERRATUM_1003 |
8284
| Qualcomm Tech. | Falkor v1 | E1009 | QCOM_FALKOR_ERRATUM_1009 |

Documentation/arm64/sve.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,23 @@ model features for SVE is included in Appendix A.
3434
following sections: software that needs to verify that those interfaces are
3535
present must check for HWCAP_SVE instead.
3636

37+
* On hardware that supports the SVE2 extensions, HWCAP2_SVE2 will also
38+
be reported in the AT_HWCAP2 aux vector entry. In addition to this,
39+
optional extensions to SVE2 may be reported by the presence of:
40+
41+
HWCAP2_SVE2
42+
HWCAP2_SVEAES
43+
HWCAP2_SVEPMULL
44+
HWCAP2_SVEBITPERM
45+
HWCAP2_SVESHA3
46+
HWCAP2_SVESM4
47+
48+
This list may be extended over time as the SVE architecture evolves.
49+
50+
These extensions are also reported via the CPU ID register ID_AA64ZFR0_EL1,
51+
which userspace can read using an MRS instruction. See elf_hwcaps.txt and
52+
cpu-feature-registers.txt for details.
53+
3754
* Debuggers should restrict themselves to interacting with the target via the
3855
NT_ARM_SVE regset. The recommended way of detecting support for this regset
3956
is to connect to a target process first and then attempt a

Documentation/robust-futexes.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,5 +218,4 @@ All other architectures should build just fine too - but they won't have
218218
the new syscalls yet.
219219

220220
Architectures need to implement the new futex_atomic_cmpxchg_inatomic()
221-
inline function before writing up the syscalls (that function returns
222-
-ENOSYS right now).
221+
inline function before writing up the syscalls.

arch/arm/include/asm/arch_timer.h

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
#include <clocksource/arm_arch_timer.h>
1212

1313
#ifdef CONFIG_ARM_ARCH_TIMER
14+
/* 32bit ARM doesn't know anything about timer errata... */
15+
#define has_erratum_handler(h) (false)
16+
#define erratum_handler(h) (arch_timer_##h)
17+
1418
int arch_timer_arch_init(void);
1519

1620
/*
@@ -79,7 +83,7 @@ static inline u32 arch_timer_get_cntfrq(void)
7983
return val;
8084
}
8185

82-
static inline u64 arch_counter_get_cntpct(void)
86+
static inline u64 __arch_counter_get_cntpct(void)
8387
{
8488
u64 cval;
8589

@@ -88,7 +92,12 @@ static inline u64 arch_counter_get_cntpct(void)
8892
return cval;
8993
}
9094

91-
static inline u64 arch_counter_get_cntvct(void)
95+
static inline u64 __arch_counter_get_cntpct_stable(void)
96+
{
97+
return __arch_counter_get_cntpct();
98+
}
99+
100+
static inline u64 __arch_counter_get_cntvct(void)
92101
{
93102
u64 cval;
94103

@@ -97,6 +106,11 @@ static inline u64 arch_counter_get_cntvct(void)
97106
return cval;
98107
}
99108

109+
static inline u64 __arch_counter_get_cntvct_stable(void)
110+
{
111+
return __arch_counter_get_cntvct();
112+
}
113+
100114
static inline u32 arch_timer_get_cntkctl(void)
101115
{
102116
u32 cntkctl;

arch/arm/include/asm/cp15.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@
6868
#define BPIALL __ACCESS_CP15(c7, 0, c5, 6)
6969
#define ICIALLU __ACCESS_CP15(c7, 0, c5, 0)
7070

71+
#define CNTVCT __ACCESS_CP15_64(1, c14)
72+
7173
extern unsigned long cr_alignment; /* defined in entry-armv.S */
7274

7375
static inline unsigned long get_cr(void)

arch/arm/include/asm/stage2_pgtable.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@
3232
#define stage2_pgd_present(kvm, pgd) pgd_present(pgd)
3333
#define stage2_pgd_populate(kvm, pgd, pud) pgd_populate(NULL, pgd, pud)
3434
#define stage2_pud_offset(kvm, pgd, address) pud_offset(pgd, address)
35-
#define stage2_pud_free(kvm, pud) pud_free(NULL, pud)
35+
#define stage2_pud_free(kvm, pud) do { } while (0)
3636

3737
#define stage2_pud_none(kvm, pud) pud_none(pud)
3838
#define stage2_pud_clear(kvm, pud) pud_clear(pud)
3939
#define stage2_pud_present(kvm, pud) pud_present(pud)
4040
#define stage2_pud_populate(kvm, pud, pmd) pud_populate(NULL, pud, pmd)
4141
#define stage2_pmd_offset(kvm, pud, address) pmd_offset(pud, address)
42-
#define stage2_pmd_free(kvm, pmd) pmd_free(NULL, pmd)
42+
#define stage2_pmd_free(kvm, pmd) free_page((unsigned long)pmd)
4343

4444
#define stage2_pud_huge(kvm, pud) pud_huge(pud)
4545

0 commit comments

Comments
 (0)