Skip to content

Commit 6be2280

Browse files
committed
Merge branches 'for-next/elf-hwcap-docs', 'for-next/smccc-conduit-cleanup', 'for-next/zone-dma', 'for-next/relax-icc_pmr_el1-sync', 'for-next/double-page-fault', 'for-next/misc', 'for-next/kselftest-arm64-signal' and 'for-next/kaslr-diagnostics' into for-next/core
* for-next/elf-hwcap-docs: : Update the arm64 ELF HWCAP documentation docs/arm64: cpu-feature-registers: Rewrite bitfields that don't follow [e, s] docs/arm64: cpu-feature-registers: Documents missing visible fields docs/arm64: elf_hwcaps: Document HWCAP_SB docs/arm64: elf_hwcaps: sort the HWCAP{, 2} documentation by ascending value * for-next/smccc-conduit-cleanup: : SMC calling convention conduit clean-up firmware: arm_sdei: use common SMCCC_CONDUIT_* firmware/psci: use common SMCCC_CONDUIT_* arm: spectre-v2: use arm_smccc_1_1_get_conduit() arm64: errata: use arm_smccc_1_1_get_conduit() arm/arm64: smccc/psci: add arm_smccc_1_1_get_conduit() * for-next/zone-dma: : Reintroduction of ZONE_DMA for Raspberry Pi 4 support arm64: mm: reserve CMA and crashkernel in ZONE_DMA32 dma/direct: turn ARCH_ZONE_DMA_BITS into a variable arm64: Make arm64_dma32_phys_limit static arm64: mm: Fix unused variable warning in zone_sizes_init mm: refresh ZONE_DMA and ZONE_DMA32 comments in 'enum zone_type' arm64: use both ZONE_DMA and ZONE_DMA32 arm64: rename variables used to calculate ZONE_DMA32's size arm64: mm: use arm64_dma_phys_limit instead of calling max_zone_dma_phys() * for-next/relax-icc_pmr_el1-sync: : Relax ICC_PMR_EL1 (GICv3) accesses when ICC_CTLR_EL1.PMHE is clear arm64: Document ICC_CTLR_EL3.PMHE setting requirements arm64: Relax ICC_PMR_EL1 accesses when ICC_CTLR_EL1.PMHE is clear * for-next/double-page-fault: : Avoid a double page fault in __copy_from_user_inatomic() if hw does not support auto Access Flag mm: fix double page fault on arm64 if PTE_AF is cleared x86/mm: implement arch_faults_on_old_pte() stub on x86 arm64: mm: implement arch_faults_on_old_pte() on arm64 arm64: cpufeature: introduce helper cpu_has_hw_af() * for-next/misc: : Various fixes and clean-ups arm64: kpti: Add NVIDIA's Carmel core to the KPTI whitelist arm64: mm: Remove MAX_USER_VA_BITS definition arm64: mm: simplify the page end calculation in __create_pgd_mapping() arm64: print additional fault message when executing non-exec memory arm64: psci: Reduce the waiting time for cpu_psci_cpu_kill() arm64: pgtable: Correct typo in comment arm64: docs: cpu-feature-registers: Document ID_AA64PFR1_EL1 arm64: cpufeature: Fix typos in comment arm64/mm: Poison initmem while freeing with free_reserved_area() arm64: use generic free_initrd_mem() arm64: simplify syscall wrapper ifdeffery * for-next/kselftest-arm64-signal: : arm64-specific kselftest support with signal-related test-cases kselftest: arm64: fake_sigreturn_misaligned_sp kselftest: arm64: fake_sigreturn_bad_size kselftest: arm64: fake_sigreturn_duplicated_fpsimd kselftest: arm64: fake_sigreturn_missing_fpsimd kselftest: arm64: fake_sigreturn_bad_size_for_magic0 kselftest: arm64: fake_sigreturn_bad_magic kselftest: arm64: add helper get_current_context kselftest: arm64: extend test_init functionalities kselftest: arm64: mangle_pstate_invalid_mode_el[123][ht] kselftest: arm64: mangle_pstate_invalid_daif_bits kselftest: arm64: mangle_pstate_invalid_compat_toggle and common utils kselftest: arm64: extend toplevel skeleton Makefile * for-next/kaslr-diagnostics: : Provide diagnostics on boot for KASLR arm64: kaslr: Check command line before looking for a seed arm64: kaslr: Announce KASLR status on boot
9 parents 51effa6 + 478016c + e6ea465 + bff3b04 + 7e3a57f + 83d116c + 918e194 + 3f484ce + 2203e1a commit 6be2280

Some content is hidden

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

75 files changed

+2083
-240
lines changed

Documentation/arm64/booting.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,9 @@ Before jumping into the kernel, the following conditions must be met:
213213

214214
- ICC_SRE_EL3.Enable (bit 3) must be initialiased to 0b1.
215215
- ICC_SRE_EL3.SRE (bit 0) must be initialised to 0b1.
216+
- ICC_CTLR_EL3.PMHE (bit 6) must be set to the same value across
217+
all CPUs the kernel is executing on, and must stay constant
218+
for the lifetime of the kernel.
216219

217220
- If the kernel is entered at EL1:
218221

Documentation/arm64/cpu-feature-registers.rst

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,15 @@ infrastructure:
168168
+------------------------------+---------+---------+
169169

170170

171-
3) MIDR_EL1 - Main ID Register
171+
3) ID_AA64PFR1_EL1 - Processor Feature Register 1
172+
+------------------------------+---------+---------+
173+
| Name | bits | visible |
174+
+------------------------------+---------+---------+
175+
| SSBS | [7-4] | y |
176+
+------------------------------+---------+---------+
172177

178+
179+
4) MIDR_EL1 - Main ID Register
173180
+------------------------------+---------+---------+
174181
| Name | bits | visible |
175182
+------------------------------+---------+---------+
@@ -188,11 +195,15 @@ infrastructure:
188195
as available on the CPU where it is fetched and is not a system
189196
wide safe value.
190197

191-
4) ID_AA64ISAR1_EL1 - Instruction set attribute register 1
198+
5) ID_AA64ISAR1_EL1 - Instruction set attribute register 1
192199

193200
+------------------------------+---------+---------+
194201
| Name | bits | visible |
195202
+------------------------------+---------+---------+
203+
| SB | [39-36] | y |
204+
+------------------------------+---------+---------+
205+
| FRINTTS | [35-32] | y |
206+
+------------------------------+---------+---------+
196207
| GPI | [31-28] | y |
197208
+------------------------------+---------+---------+
198209
| GPA | [27-24] | y |
@@ -210,15 +221,15 @@ infrastructure:
210221
| DPB | [3-0] | y |
211222
+------------------------------+---------+---------+
212223

213-
5) ID_AA64MMFR2_EL1 - Memory model feature register 2
224+
6) ID_AA64MMFR2_EL1 - Memory model feature register 2
214225

215226
+------------------------------+---------+---------+
216227
| Name | bits | visible |
217228
+------------------------------+---------+---------+
218229
| AT | [35-32] | y |
219230
+------------------------------+---------+---------+
220231

221-
6) ID_AA64ZFR0_EL1 - SVE feature ID register 0
232+
7) ID_AA64ZFR0_EL1 - SVE feature ID register 0
222233

223234
+------------------------------+---------+---------+
224235
| Name | bits | visible |

Documentation/arm64/elf_hwcaps.rst

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,6 @@ HWCAP_LRCPC
119119
HWCAP_DCPOP
120120
Functionality implied by ID_AA64ISAR1_EL1.DPB == 0b0001.
121121

122-
HWCAP2_DCPODP
123-
124-
Functionality implied by ID_AA64ISAR1_EL1.DPB == 0b0010.
125-
126122
HWCAP_SHA3
127123
Functionality implied by ID_AA64ISAR0_EL1.SHA3 == 0b0001.
128124

@@ -141,30 +137,6 @@ HWCAP_SHA512
141137
HWCAP_SVE
142138
Functionality implied by ID_AA64PFR0_EL1.SVE == 0b0001.
143139

144-
HWCAP2_SVE2
145-
146-
Functionality implied by ID_AA64ZFR0_EL1.SVEVer == 0b0001.
147-
148-
HWCAP2_SVEAES
149-
150-
Functionality implied by ID_AA64ZFR0_EL1.AES == 0b0001.
151-
152-
HWCAP2_SVEPMULL
153-
154-
Functionality implied by ID_AA64ZFR0_EL1.AES == 0b0010.
155-
156-
HWCAP2_SVEBITPERM
157-
158-
Functionality implied by ID_AA64ZFR0_EL1.BitPerm == 0b0001.
159-
160-
HWCAP2_SVESHA3
161-
162-
Functionality implied by ID_AA64ZFR0_EL1.SHA3 == 0b0001.
163-
164-
HWCAP2_SVESM4
165-
166-
Functionality implied by ID_AA64ZFR0_EL1.SM4 == 0b0001.
167-
168140
HWCAP_ASIMDFHM
169141
Functionality implied by ID_AA64ISAR0_EL1.FHM == 0b0001.
170142

@@ -180,13 +152,12 @@ HWCAP_ILRCPC
180152
HWCAP_FLAGM
181153
Functionality implied by ID_AA64ISAR0_EL1.TS == 0b0001.
182154

183-
HWCAP2_FLAGM2
184-
185-
Functionality implied by ID_AA64ISAR0_EL1.TS == 0b0010.
186-
187155
HWCAP_SSBS
188156
Functionality implied by ID_AA64PFR1_EL1.SSBS == 0b0010.
189157

158+
HWCAP_SB
159+
Functionality implied by ID_AA64ISAR1_EL1.SB == 0b0001.
160+
190161
HWCAP_PACA
191162
Functionality implied by ID_AA64ISAR1_EL1.APA == 0b0001 or
192163
ID_AA64ISAR1_EL1.API == 0b0001, as described by
@@ -197,6 +168,38 @@ HWCAP_PACG
197168
ID_AA64ISAR1_EL1.GPI == 0b0001, as described by
198169
Documentation/arm64/pointer-authentication.rst.
199170

171+
HWCAP2_DCPODP
172+
173+
Functionality implied by ID_AA64ISAR1_EL1.DPB == 0b0010.
174+
175+
HWCAP2_SVE2
176+
177+
Functionality implied by ID_AA64ZFR0_EL1.SVEVer == 0b0001.
178+
179+
HWCAP2_SVEAES
180+
181+
Functionality implied by ID_AA64ZFR0_EL1.AES == 0b0001.
182+
183+
HWCAP2_SVEPMULL
184+
185+
Functionality implied by ID_AA64ZFR0_EL1.AES == 0b0010.
186+
187+
HWCAP2_SVEBITPERM
188+
189+
Functionality implied by ID_AA64ZFR0_EL1.BitPerm == 0b0001.
190+
191+
HWCAP2_SVESHA3
192+
193+
Functionality implied by ID_AA64ZFR0_EL1.SHA3 == 0b0001.
194+
195+
HWCAP2_SVESM4
196+
197+
Functionality implied by ID_AA64ZFR0_EL1.SM4 == 0b0001.
198+
199+
HWCAP2_FLAGM2
200+
201+
Functionality implied by ID_AA64ISAR0_EL1.TS == 0b0010.
202+
200203
HWCAP2_FRINT
201204

202205
Functionality implied by ID_AA64ISAR1_EL1.FRINTTS == 0b0001.

arch/arm/mm/proc-v7-bugs.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0
22
#include <linux/arm-smccc.h>
33
#include <linux/kernel.h>
4-
#include <linux/psci.h>
54
#include <linux/smp.h>
65

76
#include <asm/cp15.h>
@@ -75,11 +74,8 @@ static void cpu_v7_spectre_init(void)
7574
case ARM_CPU_PART_CORTEX_A72: {
7675
struct arm_smccc_res res;
7776

78-
if (psci_ops.smccc_version == SMCCC_VERSION_1_0)
79-
break;
80-
81-
switch (psci_ops.conduit) {
82-
case PSCI_CONDUIT_HVC:
77+
switch (arm_smccc_1_1_get_conduit()) {
78+
case SMCCC_CONDUIT_HVC:
8379
arm_smccc_1_1_hvc(ARM_SMCCC_ARCH_FEATURES_FUNC_ID,
8480
ARM_SMCCC_ARCH_WORKAROUND_1, &res);
8581
if ((int)res.a0 != 0)
@@ -90,7 +86,7 @@ static void cpu_v7_spectre_init(void)
9086
spectre_v2_method = "hypervisor";
9187
break;
9288

93-
case PSCI_CONDUIT_SMC:
89+
case SMCCC_CONDUIT_SMC:
9490
arm_smccc_1_1_smc(ARM_SMCCC_ARCH_FEATURES_FUNC_ID,
9591
ARM_SMCCC_ARCH_WORKAROUND_1, &res);
9692
if ((int)res.a0 != 0)

arch/arm64/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,10 @@ config GENERIC_CSUM
268268
config GENERIC_CALIBRATE_DELAY
269269
def_bool y
270270

271+
config ZONE_DMA
272+
bool "Support DMA zone" if EXPERT
273+
default y
274+
271275
config ZONE_DMA32
272276
bool "Support DMA32 zone" if EXPERT
273277
default y

arch/arm64/include/asm/barrier.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@
2929
SB_BARRIER_INSN"nop\n", \
3030
ARM64_HAS_SB))
3131

32+
#ifdef CONFIG_ARM64_PSEUDO_NMI
33+
#define pmr_sync() \
34+
do { \
35+
extern struct static_key_false gic_pmr_sync; \
36+
\
37+
if (static_branch_unlikely(&gic_pmr_sync)) \
38+
dsb(sy); \
39+
} while(0)
40+
#else
41+
#define pmr_sync() do {} while (0)
42+
#endif
43+
3244
#define mb() dsb(sy)
3345
#define rmb() dsb(ld)
3446
#define wmb() dsb(st)

arch/arm64/include/asm/cpufeature.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,20 @@ static inline u32 id_aa64mmfr0_parange_to_phys_shift(int parange)
659659
default: return CONFIG_ARM64_PA_BITS;
660660
}
661661
}
662+
663+
/* Check whether hardware update of the Access flag is supported */
664+
static inline bool cpu_has_hw_af(void)
665+
{
666+
u64 mmfr1;
667+
668+
if (!IS_ENABLED(CONFIG_ARM64_HW_AFDBM))
669+
return false;
670+
671+
mmfr1 = read_cpuid(ID_AA64MMFR1_EL1);
672+
return cpuid_feature_extract_unsigned_field(mmfr1,
673+
ID_AA64MMFR1_HADBS_SHIFT);
674+
}
675+
662676
#endif /* __ASSEMBLY__ */
663677

664678
#endif

arch/arm64/include/asm/daifflags.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <linux/irqflags.h>
99

1010
#include <asm/arch_gicv3.h>
11+
#include <asm/barrier.h>
1112
#include <asm/cpufeature.h>
1213
#include <asm/ptrace.h>
1314

@@ -66,7 +67,7 @@ static inline void local_daif_restore(unsigned long flags)
6667

6768
if (system_uses_irq_prio_masking()) {
6869
gic_write_pmr(GIC_PRIO_IRQON);
69-
dsb(sy);
70+
pmr_sync();
7071
}
7172
} else if (system_uses_irq_prio_masking()) {
7273
u64 pmr;

arch/arm64/include/asm/irqflags.h

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#define __ASM_IRQFLAGS_H
77

88
#include <asm/alternative.h>
9+
#include <asm/barrier.h>
910
#include <asm/ptrace.h>
1011
#include <asm/sysreg.h>
1112

@@ -34,14 +35,14 @@ static inline void arch_local_irq_enable(void)
3435
}
3536

3637
asm volatile(ALTERNATIVE(
37-
"msr daifclr, #2 // arch_local_irq_enable\n"
38-
"nop",
39-
__msr_s(SYS_ICC_PMR_EL1, "%0")
40-
"dsb sy",
38+
"msr daifclr, #2 // arch_local_irq_enable",
39+
__msr_s(SYS_ICC_PMR_EL1, "%0"),
4140
ARM64_HAS_IRQ_PRIO_MASKING)
4241
:
4342
: "r" ((unsigned long) GIC_PRIO_IRQON)
4443
: "memory");
44+
45+
pmr_sync();
4546
}
4647

4748
static inline void arch_local_irq_disable(void)
@@ -116,14 +117,14 @@ static inline unsigned long arch_local_irq_save(void)
116117
static inline void arch_local_irq_restore(unsigned long flags)
117118
{
118119
asm volatile(ALTERNATIVE(
119-
"msr daif, %0\n"
120-
"nop",
121-
__msr_s(SYS_ICC_PMR_EL1, "%0")
122-
"dsb sy",
123-
ARM64_HAS_IRQ_PRIO_MASKING)
120+
"msr daif, %0",
121+
__msr_s(SYS_ICC_PMR_EL1, "%0"),
122+
ARM64_HAS_IRQ_PRIO_MASKING)
124123
:
125124
: "r" (flags)
126125
: "memory");
126+
127+
pmr_sync();
127128
}
128129

129130
#endif /* __ASM_IRQFLAGS_H */

arch/arm64/include/asm/kvm_host.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,8 +600,7 @@ static inline void kvm_arm_vhe_guest_enter(void)
600600
* local_daif_mask() already sets GIC_PRIO_PSR_I_SET, we just need a
601601
* dsb to ensure the redistributor is forwards EL2 IRQs to the CPU.
602602
*/
603-
if (system_uses_irq_prio_masking())
604-
dsb(sy);
603+
pmr_sync();
605604
}
606605

607606
static inline void kvm_arm_vhe_guest_exit(void)

0 commit comments

Comments
 (0)