Skip to content

Commit 3ae8cef

Browse files
committed
Merge branches 'for-next/livepatch', 'for-next/user-contig-bbml2', 'for-next/misc', 'for-next/acpi', 'for-next/debug-entry', 'for-next/feat_mte_tagged_far', 'for-next/kselftest', 'for-next/mdscr-cleanup' and 'for-next/vmap-stack', remote-tracking branch 'arm64/for-next/perf' into for-next/core
* arm64/for-next/perf: (23 commits) drivers/perf: hisi: Support PMUs with no interrupt drivers/perf: hisi: Relax the event number check of v2 PMUs drivers/perf: hisi: Add support for HiSilicon SLLC v3 PMU driver drivers/perf: hisi: Use ACPI driver_data to retrieve SLLC PMU information drivers/perf: hisi: Add support for HiSilicon DDRC v3 PMU driver drivers/perf: hisi: Simplify the probe process for each DDRC version perf/arm-ni: Support sharing IRQs within an NI instance perf/arm-ni: Consolidate CPU affinity handling perf/cxlpmu: Fix typos in cxl_pmu.c comments and documentation perf/cxlpmu: Remove unintended newline from IRQ name format string perf/cxlpmu: Fix devm_kcalloc() argument order in cxl_pmu_probe() perf: arm_spe: Relax period restriction perf: arm_pmuv3: Add support for the Branch Record Buffer Extension (BRBE) KVM: arm64: nvhe: Disable branch generation in nVHE guests arm64: Handle BRBE booting requirements arm64/sysreg: Add BRBE registers and fields perf/arm: Add missing .suppress_bind_attrs perf/arm-cmn: Reduce stack usage during discovery perf: imx9_perf: make the read-only array mask static const perf/arm-cmn: Broaden module description for wider interconnect support ... * for-next/livepatch: : Support for HAVE_LIVEPATCH on arm64 arm64: Kconfig: Keep selects somewhat alphabetically ordered arm64: Implement HAVE_LIVEPATCH arm64: stacktrace: Implement arch_stack_walk_reliable() arm64: stacktrace: Check kretprobe_find_ret_addr() return value arm64/module: Use text-poke API for late relocations. * for-next/user-contig-bbml2: : Optimise the TLBI when folding/unfolding contigous PTEs on hardware with BBML2 and no TLB conflict aborts arm64/mm: Elide tlbi in contpte_convert() under BBML2 iommu/arm: Add BBM Level 2 smmu feature arm64: Add BBM Level 2 cpu feature arm64: cpufeature: Introduce MATCH_ALL_EARLY_CPUS capability type * for-next/misc: : Miscellaneous arm64 patches arm64/gcs: task_gcs_el0_enable() should use passed task arm64: signal: Remove ISB when resetting POR_EL0 arm64/mm: Drop redundant addr increment in set_huge_pte_at() arm64: Mark kernel as tainted on SAE and SError panic arm64/gcs: Don't call gcs_free() when releasing task_struct arm64: fix unnecessary rebuilding when CONFIG_DEBUG_EFI=y arm64/mm: Optimize loop to reduce redundant operations of contpte_ptep_get arm64: pi: use 'targets' instead of extra-y in Makefile * for-next/acpi: : Various ACPI arm64 changes ACPI: Suppress misleading SPCR console message when SPCR table is absent ACPI: Return -ENODEV from acpi_parse_spcr() when SPCR support is disabled * for-next/debug-entry: : Simplify the debug exception entry path arm64: debug: remove debug exception registration infrastructure arm64: debug: split bkpt32 exception entry arm64: debug: split brk64 exception entry arm64: debug: split hardware watchpoint exception entry arm64: debug: split single stepping exception entry arm64: debug: refactor reinstall_suspended_bps() arm64: debug: split hardware breakpoint exception entry arm64: entry: Add entry and exit functions for debug exceptions arm64: debug: remove break/step handler registration infrastructure arm64: debug: call step handlers statically arm64: debug: call software breakpoint handlers statically arm64: refactor aarch32_break_handler() arm64: debug: clean up single_step_handler logic * for-next/feat_mte_tagged_far: : Support for reporting the non-address bits during a synchronous MTE tag check fault kselftest/arm64/mte: Add mtefar tests on check_mmap_options kselftest/arm64/mte: Refactor check_mmap_option test kselftest/arm64/mte: Add verification for address tag in signal handler kselftest/arm64/mte: Add address tag related macro and function kselftest/arm64/mte: Check MTE_FAR feature is supported kselftest/arm64/mte: Register mte signal handler with SA_EXPOSE_TAGBITS kselftest/arm64: Add MTE_FAR hwcap test KVM: arm64: Expose FEAT_MTE_TAGGED_FAR feature to guest arm64: Report address tag when FEAT_MTE_TAGGED_FAR is supported arm64/cpufeature: Add FEAT_MTE_TAGGED_FAR feature * for-next/kselftest: : Kselftest updates for arm64 kselftest/arm64: Handle attempts to disable SM on SME only systems kselftest/arm64: Fix SVE write data generation for SME only systems kselftest/arm64: Test SME on SME only systems in fp-ptrace kselftest/arm64: Test FPSIMD format data writes via NT_ARM_SVE in fp-ptrace kselftest/arm64: Allow sve-ptrace to run on SME only systems kselftest/arm4: Provide local defines for AT_HWCAP3 kselftest/arm64: Specify SVE data when testing VL set in sve-ptrace kselftest/arm64: Fix test for streaming FPSIMD write in sve-ptrace kselftest/arm64: Fix check for setting new VLs in sve-ptrace kselftest/arm64: Convert tpidr2 test to use kselftest.h * for-next/mdscr-cleanup: : Drop redundant DBG_MDSCR_* macros KVM: selftests: Change MDSCR_EL1 register holding variables as uint64_t arm64/debug: Drop redundant DBG_MDSCR_* macros * for-next/vmap-stack: : Force VMAP_STACK on arm64 arm64: remove CONFIG_VMAP_STACK checks from entry code arm64: remove CONFIG_VMAP_STACK checks from SDEI stack handling arm64: remove CONFIG_VMAP_STACK checks from stacktrace overflow logic arm64: remove CONFIG_VMAP_STACK conditionals from traps overflow stack arm64: remove CONFIG_VMAP_STACK conditionals from irq stack setup arm64: Remove CONFIG_VMAP_STACK conditionals from THREAD_SHIFT and THREAD_ALIGN arm64: efi: Remove CONFIG_VMAP_STACK check arm64: Mandate VMAP_STACK arm64: efi: Fix KASAN false positive for EFI runtime stack arm64/ptrace: Fix stack-out-of-bounds read in regs_get_kernel_stack_nth() arm64/gcs: Don't call gcs_free() during flush_gcs() arm64: Restrict pagetable teardown to avoid false warning docs: arm64: Fix ICC_SRE_EL2 register typo in booting.rst
10 parents e480898 + 8e7a67c + 83bbd6b + cbbcfb9 + bad3fa2 + a8b8cce + d09674f + 4752dcc + 30ff3c9 + 9d1869f commit 3ae8cef

Some content is hidden

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

71 files changed

+1545
-850
lines changed

Documentation/arch/arm64/booting.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ Before jumping into the kernel, the following conditions must be met:
234234

235235
- If the kernel is entered at EL1:
236236

237-
- ICC.SRE_EL2.Enable (bit 3) must be initialised to 0b1
237+
- ICC_SRE_EL2.Enable (bit 3) must be initialised to 0b1
238238
- ICC_SRE_EL2.SRE (bit 0) must be initialised to 0b1.
239239

240240
- The DT or ACPI tables must describe a GICv3 interrupt controller.

Documentation/arch/arm64/elf_hwcaps.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,9 @@ HWCAP2_SME_SF8DP4
435435
HWCAP2_POE
436436
Functionality implied by ID_AA64MMFR3_EL1.S1POE == 0b0001.
437437

438+
HWCAP3_MTE_FAR
439+
Functionality implied by ID_AA64PFR2_EL1.MTEFAR == 0b0001.
440+
438441
4. Unused AT_HWCAP bits
439442
-----------------------
440443

Documentation/arch/arm64/tagged-pointers.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,12 @@ that signal handlers in applications making use of tags cannot rely
6060
on the tag information for user virtual addresses being maintained
6161
in these fields unless the flag was set.
6262

63-
Due to architecture limitations, bits 63:60 of the fault address
64-
are not preserved in response to synchronous tag check faults
65-
(SEGV_MTESERR) even if SA_EXPOSE_TAGBITS was set. Applications should
66-
treat the values of these bits as undefined in order to accommodate
67-
future architecture revisions which may preserve the bits.
63+
If FEAT_MTE_TAGGED_FAR (Armv8.9) is supported, bits 63:60 of the fault address
64+
are preserved in response to synchronous tag check faults (SEGV_MTESERR)
65+
otherwise not preserved even if SA_EXPOSE_TAGBITS was set.
66+
Applications should interpret the values of these bits based on
67+
the support for the HWCAP3_MTE_FAR. If the support is not present,
68+
the values of these bits should be considered as undefined otherwise valid.
6869

6970
For signals raised in response to watchpoint debug exceptions, the
7071
tag information will be preserved regardless of the SA_EXPOSE_TAGBITS

arch/arm64/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ config ARM64
234234
select HAVE_HW_BREAKPOINT if PERF_EVENTS
235235
select HAVE_IOREMAP_PROT
236236
select HAVE_IRQ_TIME_ACCOUNTING
237+
select HAVE_LIVEPATCH
237238
select HAVE_MOD_ARCH_SPECIFIC
238239
select HAVE_NMI
239240
select HAVE_PERF_EVENTS
@@ -242,6 +243,7 @@ config ARM64
242243
select HAVE_PERF_USER_STACK_DUMP
243244
select HAVE_PREEMPT_DYNAMIC_KEY
244245
select HAVE_REGS_AND_STACK_ACCESS_API
246+
select HAVE_RELIABLE_STACKTRACE
245247
select HAVE_POSIX_CPU_TIMERS_TASK_WORK
246248
select HAVE_FUNCTION_ARG_ACCESS_API
247249
select MMU_GATHER_RCU_TABLE_FREE
@@ -279,6 +281,7 @@ config ARM64
279281
select HAVE_SOFTIRQ_ON_OWN_STACK
280282
select USER_STACKTRACE_SUPPORT
281283
select VDSO_GETRANDOM
284+
select VMAP_STACK
282285
help
283286
ARM 64-bit (AArch64) Linux support.
284287

@@ -2499,3 +2502,4 @@ source "drivers/acpi/Kconfig"
24992502

25002503
source "arch/arm64/kvm/Kconfig"
25012504

2505+
source "kernel/livepatch/Kconfig"

arch/arm64/include/asm/assembler.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
.macro disable_step_tsk, flgs, tmp
5454
tbz \flgs, #TIF_SINGLESTEP, 9990f
5555
mrs \tmp, mdscr_el1
56-
bic \tmp, \tmp, #DBG_MDSCR_SS
56+
bic \tmp, \tmp, #MDSCR_EL1_SS
5757
msr mdscr_el1, \tmp
5858
isb // Take effect before a subsequent clear of DAIF.D
5959
9990:
@@ -63,7 +63,7 @@
6363
.macro enable_step_tsk, flgs, tmp
6464
tbz \flgs, #TIF_SINGLESTEP, 9990f
6565
mrs \tmp, mdscr_el1
66-
orr \tmp, \tmp, #DBG_MDSCR_SS
66+
orr \tmp, \tmp, #MDSCR_EL1_SS
6767
msr mdscr_el1, \tmp
6868
9990:
6969
.endm

arch/arm64/include/asm/cpufeature.h

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,14 @@ extern struct arm64_ftr_reg arm64_ftr_reg_ctrel0;
275275
#define ARM64_CPUCAP_OPTIONAL_FOR_LATE_CPU ((u16)BIT(5))
276276
/* Panic when a conflict is detected */
277277
#define ARM64_CPUCAP_PANIC_ON_CONFLICT ((u16)BIT(6))
278+
/*
279+
* When paired with SCOPE_LOCAL_CPU, all early CPUs must satisfy the
280+
* condition. This is different from SCOPE_SYSTEM where the check is performed
281+
* only once at the end of the SMP boot on the sanitised ID registers.
282+
* SCOPE_SYSTEM is not suitable for cases where the capability depends on
283+
* properties local to a CPU like MIDR_EL1.
284+
*/
285+
#define ARM64_CPUCAP_MATCH_ALL_EARLY_CPUS ((u16)BIT(7))
278286

279287
/*
280288
* CPU errata workarounds that need to be enabled at boot time if one or
@@ -304,6 +312,16 @@ extern struct arm64_ftr_reg arm64_ftr_reg_ctrel0;
304312
(ARM64_CPUCAP_SCOPE_LOCAL_CPU | \
305313
ARM64_CPUCAP_OPTIONAL_FOR_LATE_CPU | \
306314
ARM64_CPUCAP_PERMITTED_FOR_LATE_CPU)
315+
/*
316+
* CPU feature detected at boot time and present on all early CPUs. Late CPUs
317+
* are permitted to have the feature even if it hasn't been enabled, although
318+
* the feature will not be used by Linux in this case. If all early CPUs have
319+
* the feature, then every late CPU must have it.
320+
*/
321+
#define ARM64_CPUCAP_EARLY_LOCAL_CPU_FEATURE \
322+
(ARM64_CPUCAP_SCOPE_LOCAL_CPU | \
323+
ARM64_CPUCAP_PERMITTED_FOR_LATE_CPU | \
324+
ARM64_CPUCAP_MATCH_ALL_EARLY_CPUS)
307325

308326
/*
309327
* CPU feature detected at boot time, on one or more CPUs. A late CPU
@@ -391,6 +409,11 @@ static inline int cpucap_default_scope(const struct arm64_cpu_capabilities *cap)
391409
return cap->type & ARM64_CPUCAP_SCOPE_MASK;
392410
}
393411

412+
static inline bool cpucap_match_all_early_cpus(const struct arm64_cpu_capabilities *cap)
413+
{
414+
return cap->type & ARM64_CPUCAP_MATCH_ALL_EARLY_CPUS;
415+
}
416+
394417
/*
395418
* Generic helper for handling capabilities with multiple (match,enable) pairs
396419
* of call backs, sharing the same capability bit.
@@ -848,6 +871,11 @@ static inline bool system_supports_pmuv3(void)
848871
return cpus_have_final_cap(ARM64_HAS_PMUV3);
849872
}
850873

874+
static inline bool system_supports_bbml2_noabort(void)
875+
{
876+
return alternative_has_cap_unlikely(ARM64_HAS_BBML2_NOABORT);
877+
}
878+
851879
int do_emulate_mrs(struct pt_regs *regs, u32 sys_reg, u32 rt);
852880
bool try_emulate_mrs(struct pt_regs *regs, u32 isn);
853881

arch/arm64/include/asm/debug-monitors.h

Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,8 @@
1313
#include <asm/ptrace.h>
1414

1515
/* Low-level stepping controls. */
16-
#define DBG_MDSCR_SS (1 << 0)
1716
#define DBG_SPSR_SS (1 << 21)
1817

19-
/* MDSCR_EL1 enabling bits */
20-
#define DBG_MDSCR_KDE (1 << 13)
21-
#define DBG_MDSCR_MDE (1 << 15)
22-
#define DBG_MDSCR_MASK ~(DBG_MDSCR_KDE | DBG_MDSCR_MDE)
23-
2418
#define DBG_ESR_EVT(x) (((x) >> 27) & 0x7)
2519

2620
/* AArch64 */
@@ -62,30 +56,6 @@ struct task_struct;
6256
#define DBG_HOOK_HANDLED 0
6357
#define DBG_HOOK_ERROR 1
6458

65-
struct step_hook {
66-
struct list_head node;
67-
int (*fn)(struct pt_regs *regs, unsigned long esr);
68-
};
69-
70-
void register_user_step_hook(struct step_hook *hook);
71-
void unregister_user_step_hook(struct step_hook *hook);
72-
73-
void register_kernel_step_hook(struct step_hook *hook);
74-
void unregister_kernel_step_hook(struct step_hook *hook);
75-
76-
struct break_hook {
77-
struct list_head node;
78-
int (*fn)(struct pt_regs *regs, unsigned long esr);
79-
u16 imm;
80-
u16 mask; /* These bits are ignored when comparing with imm */
81-
};
82-
83-
void register_user_break_hook(struct break_hook *hook);
84-
void unregister_user_break_hook(struct break_hook *hook);
85-
86-
void register_kernel_break_hook(struct break_hook *hook);
87-
void unregister_kernel_break_hook(struct break_hook *hook);
88-
8959
u8 debug_monitors_arch(void);
9060

9161
enum dbg_active_el {
@@ -108,17 +78,15 @@ void kernel_rewind_single_step(struct pt_regs *regs);
10878
void kernel_fastforward_single_step(struct pt_regs *regs);
10979

11080
#ifdef CONFIG_HAVE_HW_BREAKPOINT
111-
int reinstall_suspended_bps(struct pt_regs *regs);
81+
bool try_step_suspended_breakpoints(struct pt_regs *regs);
11282
#else
113-
static inline int reinstall_suspended_bps(struct pt_regs *regs)
83+
static inline bool try_step_suspended_breakpoints(struct pt_regs *regs)
11484
{
115-
return -ENODEV;
85+
return false;
11686
}
11787
#endif
11888

119-
int aarch32_break_handler(struct pt_regs *regs);
120-
121-
void debug_traps_init(void);
89+
bool try_handle_aarch32_break(struct pt_regs *regs);
12290

12391
#endif /* __ASSEMBLY */
12492
#endif /* __ASM_DEBUG_MONITORS_H */

arch/arm64/include/asm/exception.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,20 @@ void do_el0_bti(struct pt_regs *regs);
5959
void do_el1_bti(struct pt_regs *regs, unsigned long esr);
6060
void do_el0_gcs(struct pt_regs *regs, unsigned long esr);
6161
void do_el1_gcs(struct pt_regs *regs, unsigned long esr);
62-
void do_debug_exception(unsigned long addr_if_watchpoint, unsigned long esr,
62+
#ifdef CONFIG_HAVE_HW_BREAKPOINT
63+
void do_breakpoint(unsigned long esr, struct pt_regs *regs);
64+
void do_watchpoint(unsigned long addr, unsigned long esr,
6365
struct pt_regs *regs);
66+
#else
67+
static inline void do_breakpoint(unsigned long esr, struct pt_regs *regs) {}
68+
static inline void do_watchpoint(unsigned long addr, unsigned long esr,
69+
struct pt_regs *regs) {}
70+
#endif /* CONFIG_HAVE_HW_BREAKPOINT */
71+
void do_el0_softstep(unsigned long esr, struct pt_regs *regs);
72+
void do_el1_softstep(unsigned long esr, struct pt_regs *regs);
73+
void do_el0_brk64(unsigned long esr, struct pt_regs *regs);
74+
void do_el1_brk64(unsigned long esr, struct pt_regs *regs);
75+
void do_bkpt32(unsigned long esr, struct pt_regs *regs);
6476
void do_fpsimd_acc(unsigned long esr, struct pt_regs *regs);
6577
void do_sve_acc(unsigned long esr, struct pt_regs *regs);
6678
void do_sme_acc(unsigned long esr, struct pt_regs *regs);

arch/arm64/include/asm/gcs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static inline u64 gcsss2(void)
5858

5959
static inline bool task_gcs_el0_enabled(struct task_struct *task)
6060
{
61-
return current->thread.gcs_el0_mode & PR_SHADOW_STACK_ENABLE;
61+
return task->thread.gcs_el0_mode & PR_SHADOW_STACK_ENABLE;
6262
}
6363

6464
void gcs_set_el0_mode(struct task_struct *task);

arch/arm64/include/asm/hwcap.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@
176176
#define KERNEL_HWCAP_POE __khwcap2_feature(POE)
177177

178178
#define __khwcap3_feature(x) (const_ilog2(HWCAP3_ ## x) + 128)
179+
#define KERNEL_HWCAP_MTE_FAR __khwcap3_feature(MTE_FAR)
179180

180181
/*
181182
* This yields a mask that user programs can use to figure out what

0 commit comments

Comments
 (0)