linux-stable/arch/arm64/kernel
Alexandru Elisei 5b418289b0 arm64: cpufeature: Allow different PMU versions in ID_DFR0_EL1
[ Upstream commit 506506cad3 ]

Commit b20d1ba3cf ("arm64: cpufeature: allow for version discrepancy in
PMU implementations") made it possible to run Linux on a machine with PMUs
with different versions without tainting the kernel. The patch relaxed the
restriction only for the ID_AA64DFR0_EL1.PMUVer field, and missed doing the
same for ID_DFR0_EL1.PerfMon , which also reports the PMU version, but for
the AArch32 state.

For example, with Linux running on two clusters with different PMU
versions, the kernel is tainted when bringing up secondaries with the
following message:

[    0.097027] smp: Bringing up secondary CPUs ...
[..]
[    0.142805] Detected PIPT I-cache on CPU4
[    0.142805] CPU features: SANITY CHECK: Unexpected variation in SYS_ID_DFR0_EL1. Boot CPU: 0x00000004011088, CPU4: 0x00000005011088
[    0.143555] CPU features: Unsupported CPU feature variation detected.
[    0.143702] GICv3: CPU4: found redistributor 10000 region 0:0x000000002f180000
[    0.143702] GICv3: CPU4: using allocated LPI pending table @0x00000008800d0000
[    0.144888] CPU4: Booted secondary processor 0x0000010000 [0x410fd0f0]

The boot CPU implements FEAT_PMUv3p1 (ID_DFR0_EL1.PerfMon, bits 27:24, is
0b0100), but CPU4, part of the other cluster, implements FEAT_PMUv3p4
(ID_DFR0_EL1.PerfMon = 0b0101).

Treat the PerfMon field as FTR_NONSTRICT and FTR_EXACT to pass the sanity
check and to match how PMUVer is treated for the 64bit ID register.

Fixes: b20d1ba3cf ("arm64: cpufeature: allow for version discrepancy in PMU implementations")
Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
Link: https://lore.kernel.org/r/20220617111332.203061-1-alexandru.elisei@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-08-17 14:23:08 +02:00
..
probes arm64 updates for 5.14 2021-06-28 14:04:24 -07:00
vdso arm64: vdso: fix makefile dependency on vdso.so 2022-05-18 10:26:50 +02:00
vdso32 arm64: vdso: fix makefile dependency on vdso.so 2022-05-18 10:26:50 +02:00
.gitignore
acpi.c Revert "ACPI: Add memory semantics to acpi_os_map_memory()" 2021-09-23 20:39:36 +02:00
acpi_numa.c arm64, numa: Change the numa init functions name to be generic 2021-01-14 15:08:54 -08:00
acpi_parking_protocol.c arm64: use function_nocfi with __pa_symbol 2021-04-08 16:04:22 -07:00
alternative.c arm64: alternatives: mark patch_alternative() as noinstr 2022-04-20 09:34:16 +02:00
armv8_deprecated.c arm64: fix oops in concurrently setting insn_emulation sysctls 2022-08-17 14:23:00 +02:00
asm-offsets.c arm64: mte: rename gcr_user_excl to mte_ctrl 2021-07-28 18:33:19 +01:00
cacheinfo.c drivers: base: cacheinfo: Get rid of DEFINE_SMP_CALL_CACHE_FUNCTION() 2021-09-01 10:29:10 +02:00
cpu-reset.h arm64: add __nocfi to functions that jump to a physical address 2021-04-08 16:04:22 -07:00
cpu-reset.S arm64: Use INIT_SCTLR_EL1_MMU_OFF to disable the MMU on CPU restart 2021-03-18 15:51:07 +00:00
cpu_errata.c arm64: Enable repeat tlbi workaround on KRYO4XX gold CPUs 2022-05-25 09:57:36 +02:00
cpu_ops.c
cpufeature.c arm64: cpufeature: Allow different PMU versions in ID_DFR0_EL1 2022-08-17 14:23:08 +02:00
cpuidle.c cpuidle: PSCI: Move the has_lpi check to the beginning of the function 2022-04-20 09:34:04 +02:00
cpuinfo.c arm64: cpufeature: add HWCAP for FEAT_RPRES 2022-03-11 12:22:33 +01:00
crash_core.c arm64/crash_core: Export TCR_EL1.T1SZ in vmcoreinfo 2020-07-02 17:56:49 +01:00
crash_dump.c arm64: kdump: update ppos when reading elfcorehdr 2021-03-22 12:46:38 +00:00
debug-monitors.c arm64: expose FAR_EL1 tag bits in siginfo 2020-11-23 18:17:39 +00:00
efi-entry.S arm64: Rename arm64-internal cache maintenance functions 2021-05-25 19:27:49 +01:00
efi-header.S arm64: head: tidy up the Image header definition 2020-11-17 16:14:20 +00:00
efi-rt-wrapper.S Merge branch 'for-next/scs' into for-next/core 2020-05-28 18:03:40 +01:00
efi.c arm64: efi: Export screen_info 2021-08-04 16:54:36 +00:00
entry-common.c arm64: entry: call exit_to_user_mode() from C 2021-08-05 14:10:32 +01:00
entry-fpsimd.S arm64/sve: Add some comments for sve_save/load_state() 2021-08-24 16:44:23 +01:00
entry-ftrace.S arm64: ftrace: add missing BTIs 2021-12-08 09:04:47 +01:00
entry.S arm64: Use the clearbhb instruction in mitigations 2022-03-11 12:22:35 +01:00
fpsimd.c arm64/sve: Use correct size when reinitialising SVE state 2021-09-16 17:34:46 +01:00
ftrace.c arm64: ftrace: consistently handle PLTs. 2022-06-22 14:22:01 +02:00
head.S arm64: set UXN on swapper page tables 2022-08-11 13:07:52 +02:00
hibernate-asm.S arm64: Rename arm64-internal cache maintenance functions 2021-05-25 19:27:49 +01:00
hibernate.c arm64: kasan: Revert "arm64: mte: reset the page tag in page->flags" 2022-08-17 14:23:00 +02:00
hw_breakpoint.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
hyp-stub.S Merge remote-tracking branch 'arm64/for-next/vhe-only' into kvmarm-master/next 2021-04-13 15:42:40 +01:00
idle.c Merge branch 'for-next/entry' into for-next/core 2021-06-24 14:01:55 +01:00
idreg-override.c arm64/cpufeature: Optionally disable MTE via command-line 2021-08-03 15:48:01 +01:00
image-vars.h arm64: Use the clearbhb instruction in mitigations 2022-03-11 12:22:35 +01:00
image.h arm64: get rid of TEXT_OFFSET 2020-09-07 15:00:52 +01:00
io.c
irq.c arm64: irq: allow FIQs to be handled 2021-03-24 20:19:30 +00:00
jump_label.c arm64: insn: decouple patching from insn code 2021-06-11 11:19:27 +01:00
kaslr.c arm64: fix the doc of RANDOMIZE_MODULE_REGION_FULL 2021-08-03 10:36:42 +01:00
kexec_image.c arm64: kexec_file: Fix sparse warning 2020-11-10 13:11:44 +00:00
kgdb.c arm64: insn: decouple patching from insn code 2021-06-11 11:19:27 +01:00
kuser32.S
machine_kexec.c set_memory: allow querying whether set_direct_map_*() is actually enabled 2021-07-08 11:48:20 -07:00
machine_kexec_file.c arm64: kexec: Fix missing error code 'ret' warning in load_other_segments() 2021-12-22 09:32:45 +01:00
Makefile arm64: vdso: fix makefile dependency on vdso.so 2022-05-18 10:26:50 +02:00
module-plts.c arm64: improve whitespace 2021-02-04 13:59:49 +00:00
module.c mm: defer kmemleak object creation of module_alloc() 2022-03-08 19:12:38 +01:00
mte.c arm64: kasan: Revert "arm64: mte: reset the page tag in page->flags" 2022-08-17 14:23:00 +02:00
paravirt.c arm64: paravirt: Use RCU read locks to guard stolen_time 2022-05-25 09:57:28 +02:00
patching.c arm64: patch_text: Fixup last cpu should be master 2022-04-13 20:59:23 +02:00
pci.c arm64: PCI: Support root bridge preparation for Hyper-V 2021-08-23 10:59:26 +01:00
perf_callchain.c perf: Protect perf_guest_cbs with RCU 2022-01-20 09:13:14 +01:00
perf_event.c arm64/perf: Replace '0xf' instances with ID_AA64DFR0_PMUVER_IMP_DEF 2021-08-11 11:02:12 +01:00
perf_regs.c perf/arch: Remove perf_sample_data::regs_user_copy 2020-11-09 18:12:34 +01:00
pointer_auth.c arm64: move preemption disablement to prctl handlers 2021-07-28 18:33:49 +01:00
process.c arm64: errata: Fix exec handling in erratum 1418040 workaround 2022-01-27 11:02:58 +01:00
proton-pack.c arm64: Add part number for Arm Cortex-A78AE 2022-04-13 20:59:20 +02:00
psci.c arm64: use function_nocfi with __pa_symbol 2021-04-08 16:04:22 -07:00
ptrace.c Merge remote-tracking branch 'tip/sched/arm64' into for-next/core 2021-08-31 09:10:00 +01:00
reloc_test_core.c
reloc_test_syms.S
relocate_kernel.S arm64: kexec: arm64_relocate_new_kernel don't use x0 as temp 2021-01-27 15:41:12 +00:00
return_address.c arm64: stacktrace: Make stack walk callback consistent with generic code 2020-09-18 14:24:16 +01:00
sdei.c Merge branch 'for-next/entry' into for-next/core 2021-06-24 14:01:55 +01:00
setup.c arm64: convert to setup_initial_init_mm() 2021-07-08 11:48:21 -07:00
signal.c signal: Deliver SIGTRAP on perf event asynchronously if blocked 2022-06-09 10:22:48 +02:00
signal32.c signal: Deliver SIGTRAP on perf event asynchronously if blocked 2022-06-09 10:22:48 +02:00
sigreturn32.S
sleep.S kasan: remove redundant config option 2021-04-16 16:10:36 -07:00
smccc-call.S arm64: smccc: Save lr before calling __arm_smccc_sve_check() 2021-07-21 11:23:25 +01:00
smp.c arch/arm64: Fix topology initialization for core scheduling 2022-04-13 20:59:17 +02:00
smp_spin_table.c arm64: Rename arm64-internal cache maintenance functions 2021-05-25 19:27:49 +01:00
stacktrace.c arm64: Mark start_backtrace() notrace and NOKPROBE_SYMBOL 2022-03-08 19:12:32 +01:00
suspend.c arm64: kasan: mte: use a constant kernel GCR_EL1 value 2021-08-02 18:14:21 +01:00
sys.c
sys32.c
sys_compat.c arm64: compat: Do not treat syscall number as ESR_ELx for a bad syscall 2022-06-09 10:22:35 +02:00
syscall.c arm64: fix compat syscall return truncation 2021-08-03 10:35:03 +01:00
time.c
topology.c arch_topology: Allow multiple entities to provide sched_freq_tick() callback 2021-03-10 10:55:37 +05:30
trace-events-emulation.h
traps.c arm64/bpf: Remove 128MB limit for BPF JIT programs 2022-01-29 10:58:25 +01:00
vdso-wrap.S arm64: do not descend to vdso directories twice 2021-01-20 12:18:46 +00:00
vdso.c Merge branches 'for-next/misc', 'for-next/kselftest', 'for-next/xntable', 'for-next/vdso', 'for-next/fiq', 'for-next/epan', 'for-next/kasan-vmalloc', 'for-next/fgt-boot-init', 'for-next/vhe-only' and 'for-next/neon-softirqs-disabled', remote-tracking branch 'arm64/for-next/perf' into for-next/core 2021-04-15 14:00:38 +01:00
vdso32-wrap.S arm64: do not descend to vdso directories twice 2021-01-20 12:18:46 +00:00
vmlinux.lds.S arm64: entry: Allow the trampoline text to occupy multiple pages 2022-03-11 12:22:34 +01:00