kernel-fxtec-pro1x/tools/perf/tests
Leo Yan c761b5edde perf tests: Disable bp_signal testing for arm64
[ Upstream commit 6a5f3d94cb69a185b921cb92c39888dc31009acb ]

As there are several discussions for enabling perf breakpoint signal
testing on arm64 platform: arm64 needs to rely on single-step to execute
the breakpointed instruction and then reinstall the breakpoint exception
handler.  But if we hook the breakpoint with a signal, the signal
handler will do the stepping rather than the breakpointed instruction,
this causes infinite loops as below:

         Kernel space              |            Userspace
  ---------------------------------|--------------------------------
                                   |  __test_function() -> hit
				   |                       breakpoint
  breakpoint_handler()             |
    `-> user_enable_single_step()  |
  do_signal()                      |
                                   |  sig_handler() -> Step one
				   |                instruction and
				   |                trap to kernel
  single_step_handler()            |
    `-> reinstall_suspended_bps()  |
                                   |  __test_function() -> hit
				   |     breakpoint again and
				   |     repeat up flow infinitely

As Will Deacon mentioned [1]: "that we require the overflow handler to
do the stepping on arm/arm64, which is relied upon by GDB/ptrace. The
hw_breakpoint code is a complete disaster so my preference would be to
rip out the perf part and just implement something directly in ptrace,
but it's a pretty horrible job".  Though Will commented this on arm
architecture, but the comment also can apply on arm64 architecture.

For complete information, I searched online and found a few years back,
Wang Nan sent one patch 'arm64: Store breakpoint single step state into
pstate' [2]; the patch tried to resolve this issue by avoiding single
stepping in signal handler and defer to enable the signal stepping when
return to __test_function().  The fixing was not merged due to the
concern for missing to handle different usage cases.

Based on the info, the most feasible way is to skip Perf breakpoint
signal testing for arm64 and this could avoid the duplicate
investigation efforts when people see the failure.  This patch skips
this case on arm64 platform, which is same with arm architecture.

[1] https://lkml.org/lkml/2018/11/15/205
[2] https://lkml.org/lkml/2015/12/23/477

Signed-off-by: Leo Yan <leo.yan@linaro.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Brajeswar Ghosh <brajeswar.linux@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Song Liu <songliubraving@fb.com>
Cc: Souptick Joarder <jrdr.linux@gmail.com>
Cc: Will Deacon <will@kernel.org>
Link: http://lore.kernel.org/lkml/20191018085531.6348-3-leo.yan@linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-12-31 16:35:21 +01:00
..
attr perf tools: Fix crash on synthesizing the unit 2018-12-17 09:24:31 +01:00
shell perf test vfs_getname: Disable ~/.perfconfig to get default output 2019-10-05 13:09:41 +02:00
.gitignore
attr.c
attr.py perf test: Fix perf_event_attr test failure 2019-02-12 19:47:11 +01:00
backward-ring-buffer.c
bitmap.c
bp_account.c
bp_signal.c perf tests: Disable bp_signal testing for arm64 2019-12-31 16:35:21 +01:00
bp_signal_overflow.c
bpf-script-example.c
bpf-script-test-kbuild.c
bpf-script-test-prologue.c
bpf-script-test-relocation.c
bpf.c
Build
builtin-test.c
clang.c
code-reading.c
cpumap.c
dso-data.c
dwarf-unwind.c
event-times.c
event_update.c
evsel-roundtrip-name.c
evsel-tp-sched.c perf tests: Fix a memory leak in test__perf_evsel__tp_sched_test() 2019-04-20 09:15:58 +02:00
expr.c perf tests: Fix memory leak by expr__find_other() in test__expr() 2019-04-20 09:15:58 +02:00
fdarray.c
hists_common.c
hists_common.h
hists_cumulate.c
hists_filter.c
hists_link.c
hists_output.c
is_printable_array.c
keep-tracking.c
kmod-path.c
llvm.c
llvm.h
make
mem.c
mem2node.c
mmap-basic.c
mmap-thread-lookup.c perf test mmap-thread-lookup: Initialize variable to suppress memory sanitizer warning 2019-07-31 07:27:06 +02:00
openat-syscall-all-cpus.c perf tests: Fix a memory leak of cpu_map object in the openat_syscall_event_on_all_cpus test 2019-04-20 09:15:58 +02:00
openat-syscall-tp-fields.c
openat-syscall.c
parse-events.c perf test 6: Fix missing kvm module load for s390 2019-07-26 09:14:05 +02:00
parse-no-sample-id-all.c
perf-hooks.c perf tests: Avoid raising SEGV using an obvious NULL dereference 2019-11-06 13:05:41 +01:00
perf-record.c
perf-targz-src-pkg
pmu.c
python-use.c
sample-parsing.c
sdt.c
stat.c
sw-clock.c
switch-tracking.c
task-exit.c perf test: Report failure for mmap events 2019-12-31 16:35:14 +01:00
tests.h
thread-map.c
thread-mg-share.c
topology.c
unit_number__scnprintf.c
vmlinux-kallsyms.c