linux-stable/arch/arm64/kernel
Alexandru Elisei 490d7b7c08 arm64: perf: Add missing ISB in armv8pmu_enable_counter()
Writes to the PMXEVTYPER_EL0 register are not self-synchronising. In
armv8pmu_enable_event(), the PE can reorder configuring the event type
after we have enabled the counter and the interrupt. This can lead to an
interrupt being asserted because of the previous event type that we were
counting using the same counter, not the one that we've just configured.

The same rationale applies to writes to the PMINTENSET_EL1 register. The PE
can reorder enabling the interrupt at any point in the future after we have
enabled the event.

Prevent both situations from happening by adding an ISB just before we
enable the event counter.

Fixes: 030896885a ("arm64: Performance counters support")
Reported-by: Julien Thierry <julien.thierry@arm.com>
Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
Tested-by: Sumit Garg <sumit.garg@linaro.org> (Developerbox)
Cc: Julien Thierry <julien.thierry.kdev@gmail.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20200924110706.254996-2-alexandru.elisei@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
2020-09-28 19:00:16 +01:00
..
probes vmalloc: fix the owner argument for the new __vmalloc_node_range callers 2020-07-03 16:15:25 -07:00
vdso arm64/vdso: Add time namespace page 2020-07-24 13:15:20 +01:00
vdso32 ARM64: vdso32: Install vdso32 from vdso_install 2020-08-21 19:11:44 +01:00
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
acpi.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
acpi_numa.c
acpi_parking_protocol.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234 2019-06-19 17:09:07 +02:00
alternative.c arm64/alternatives: don't patch up internal branches 2020-07-09 14:57:59 +01:00
armv8_deprecated.c sysctl: pass kernel pointers to ->proc_handler 2020-04-27 02:07:40 -04:00
asm-offsets.c KVM: arm64: Make struct kvm_regs userspace-only 2020-07-07 09:28:38 +01:00
cacheinfo.c arm64 updates for 5.3: 2019-07-08 09:54:55 -07:00
cpu-reset.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
cpu-reset.S arm64: kernel: Convert to modern annotations for assembly functions 2020-05-04 12:46:03 +01:00
cpu_errata.c arm64: Allow booting of late CPUs affected by erratum 1418040 2020-08-21 11:39:56 +01:00
cpu_ops.c arm64: Introduce get_cpu_ops() helper function 2020-03-24 17:24:19 +00:00
cpufeature.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
cpuidle.c arm64: Introduce get_cpu_ops() helper function 2020-03-24 17:24:19 +00:00
cpuinfo.c arm64/cpuinfo: Remove unnecessary fallthrough annotation 2020-08-27 15:44:32 -05:00
crash_core.c arm64/crash_core: Export TCR_EL1.T1SZ in vmcoreinfo 2020-07-02 17:56:49 +01:00
crash_dump.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
debug-monitors.c arm64: Use test_tsk_thread_flag() for checking TIF_SINGLESTEP 2020-07-16 11:42:12 +01:00
efi-entry.S arm64 updates for 5.8 2020-06-01 15:18:27 -07:00
efi-header.S arm64 updates for 5.8 2020-06-01 15:18:27 -07:00
efi-rt-wrapper.S Merge branch 'for-next/scs' into for-next/core 2020-05-28 18:03:40 +01:00
efi.c mm/pgtable: drop pgtable_t variable from pte_fn_t functions 2019-07-12 11:05:46 -07:00
entry-common.c arm64: entry: Fix the typo in the comment of el1_dbg() 2020-07-08 21:44:40 +01:00
entry-fpsimd.S arm64: kernel: Convert to modern annotations for assembly functions 2020-05-04 12:46:03 +01:00
entry-ftrace.S arm64: entry-ftrace.S: Update comment to indicate that x18 is live 2020-05-18 17:47:50 +01:00
entry.S arm64: Move handling of erratum 1418040 into C code 2020-08-21 11:39:56 +01:00
fpsimd.c arm64: sve: Fix build failure when ARM64_SVE=y and SYSCTL=n 2020-06-16 18:29:11 +01:00
ftrace.c arm64: ftrace: Change CONFIG_FTRACE_WITH_REGS to CONFIG_DYNAMIC_FTRACE_WITH_REGS 2020-06-08 15:44:59 +01:00
head.S mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
hibernate-asm.S arm64: kernel: Convert to modern annotations for assembly functions 2020-05-04 12:46:03 +01:00
hibernate.c mm: consolidate pte_index() and pte_offset_*() definitions 2020-06-09 09:39:14 -07:00
hw_breakpoint.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
hyp-stub.S arm64: kernel: Convert to modern annotations for assembly functions 2020-05-04 12:46:03 +01:00
image-vars.h KVM: arm64: Add kvm_extable for vaxorcism code 2020-08-28 15:23:42 +01:00
image.h arm64/efi: Move variable assignments after SECTIONS 2019-08-14 17:18:15 +01:00
insn.c maccess: rename probe_kernel_{read,write} to copy_{from,to}_kernel_nofault 2020-06-17 10:57:41 -07:00
io.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234 2019-06-19 17:09:07 +02:00
irq.c arm64 updates for 5.3: 2019-07-08 09:54:55 -07:00
jump_label.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234 2019-06-19 17:09:07 +02:00
kaslr.c arm64: kaslr: Use standard early random function 2020-08-07 09:10:11 -07:00
kexec_image.c arm64: kexec_file: add crash dump support 2020-01-08 17:05:23 +00:00
kgdb.c arm64: kgdb: Fix single-step exception handling oops 2020-07-08 22:18:54 +01:00
kuser32.S docs: arm: convert docs to ReST and rename to *.rst 2019-07-15 09:20:24 -03:00
machine_kexec.c arm64: fix the flush_icache_range arguments in machine_kexec 2020-05-11 12:02:14 +01:00
machine_kexec_file.c arm64: kexec_file: Use struct_size() in kmalloc() 2020-06-18 10:45:20 +01:00
Makefile arm64: compat: Allow 32-bit vdso and sigpage to co-exist 2020-06-23 14:47:03 +01:00
module-plts.c arm64/module: Optimize module load time by optimizing PLT counting 2020-07-02 12:17:13 +01:00
module.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
module.lds
paravirt.c firmware: smccc: Drop smccc_version enum and use ARM_SMCCC_VERSION_1_x instead 2020-05-20 19:10:37 +01:00
pci.c PCI: Constify struct pci_ecam_ops 2020-05-01 16:28:59 +01:00
perf_callchain.c arm64: stacktrace: Factor out backtrace initialisation 2019-07-22 11:44:08 +01:00
perf_event.c arm64: perf: Add missing ISB in armv8pmu_enable_counter() 2020-09-28 19:00:16 +01:00
perf_regs.c arm64: perf: Report the PC value in REGS_ABI_32 mode 2020-06-25 14:47:04 +01:00
pointer_auth.c arm64: install user ptrauth keys at kernel exit time 2020-03-18 09:50:19 +00:00
process.c cpuidle: Move trace_cpu_idle() into generic code 2020-08-26 12:41:54 +02:00
psci.c arm64: psci: Reduce the waiting time for cpu_psci_cpu_kill() 2019-10-25 16:29:11 +01:00
ptrace.c Merge branch 'work.regset' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2020-08-07 09:29:25 -07:00
reloc_test_core.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
reloc_test_syms.S arm64: kernel: Convert to modern annotations for assembly functions 2020-05-04 12:46:03 +01:00
relocate_kernel.S arm64: kernel: Convert to modern annotations for assembly functions 2020-05-04 12:46:03 +01:00
return_address.c arm64: unwind: Prohibit probing on return_address() 2019-08-01 15:00:26 +01:00
scs.c scs: Move DEFINE_SCS macro into core code 2020-05-18 17:47:48 +01:00
sdei.c uaccess: add force_uaccess_{begin,end} helpers 2020-08-12 10:57:59 -07:00
setup.c - Fix tegra194-cpufreq module build failure caused __cpu_logical_map 2020-08-08 14:16:12 -07:00
signal.c arm64: ptrace: Consistently use pseudo-singlestep exceptions 2020-07-16 11:41:07 +01:00
signal32.c arm64: compat: Always use sigpage for sigreturn trampoline 2020-06-23 14:56:24 +01:00
sigreturn32.S arm64: compat: Split kuser32 2019-04-23 18:01:57 +01:00
sleep.S Merge branch 'for-next/bti' into for-next/core 2020-05-28 18:00:51 +01:00
smccc-call.S arm64: kernel: Convert to modern annotations for assembly functions 2020-05-04 12:46:03 +01:00
smp.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
smp_spin_table.c arm64: prefer __section from compiler_attributes.h 2019-08-13 18:32:15 +01:00
ssbd.c Return ENODEV when the selected speculation misfeature is unsupported 2020-01-08 17:27:41 +00:00
stacktrace.c arm64: stacktrace: Move export for save_stack_trace_tsk() 2020-07-14 19:16:25 +01:00
suspend.c mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
sys.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234 2019-06-19 17:09:07 +02:00
sys32.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 452 2019-06-19 17:09:08 +02:00
sys_compat.c arm64: Silence clang warning on mismatched value/register sizes 2019-10-28 09:13:21 +00:00
syscall.c arm64: syscall: Expand the comment about ptrace and syscall(-1) 2020-07-16 11:41:58 +01:00
time.c arm64: time: Replace <linux/clk-provider.h> by <linux/of_clk.h> 2020-02-12 17:26:38 +00:00
topology.c arm64: use activity monitors for frequency invariance 2020-03-06 16:02:50 +00:00
trace-events-emulation.h
traps.c arm64: use IRQ_STACK_SIZE instead of THREAD_SIZE for irq stack 2020-07-31 18:05:36 +01:00
vdso.c arm64/vdso: Restrict splitting VVAR VMA 2020-07-24 18:06:52 +01:00
vmlinux.lds.S KVM: arm64: Add kvm_extable for vaxorcism code 2020-08-28 15:23:42 +01:00