Go to file
Leo Yan 51a7821f05 perf tests: Disable bp_signal testing for arm64
BugLink: https://bugs.launchpad.net/bugs/1858428

[ Upstream commit 6a5f3d94cb ]

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>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
2020-01-06 08:16:01 -06:00
Documentation USB: documentation: flags on usb-storage versus UAS 2020-01-06 07:29:08 -06:00
LICENSES LICENSES: Rename other to deprecated 2019-05-03 06:34:32 -06:00
arch x86/mce: Lower throttling MCE messages' priority to warning 2020-01-06 08:16:00 -06:00
block block: fix "check bi_size overflow before merge" 2020-01-06 07:57:22 -06:00
certs UBUNTU: SAUCE: Dump stack when X.509 certificates cannot be loaded 2019-11-25 14:56:26 +01:00
crypto crypto: aegis128/simd - build 32-bit ARM for v8 architecture explicitly 2020-01-06 08:15:03 -06:00
debian UBUNTU: [Debian] Update linux source package name in debian/tests/* 2019-12-17 08:05:38 -06:00
debian.master UBUNTU: [Packaging] update variants 2019-12-17 08:05:38 -06:00
drivers power: supply: cpcap-battery: Check voltage before orderly_poweroff 2020-01-06 08:16:01 -06:00
fs Btrfs: fix removal logic of the tree mod log that leads to use-after-free issues 2020-01-06 08:14:50 -06:00
include block: Fix writeback throttling W=1 compiler warnings 2020-01-06 08:15:01 -06:00
init UBUNTU: SAUCE: Clear Linux: init: do_mounts: recreate /dev/root 2019-11-25 14:56:27 +01:00
ipc UBUNTU: SAUCE: binder: turn into module 2019-11-25 14:56:36 +01:00
kernel bpf/stackmap: Fix deadlock with rq_lock in bpf_get_stack() 2020-01-06 08:16:00 -06:00
lib lib: raid6: fix awk build warnings 2020-01-06 07:29:17 -06:00
mm mm/shmem.c: cast the type of unmap_start to u64 2020-01-06 07:39:22 -06:00
net Bluetooth: hci_core: fix init for HCI_USER_CHANNEL 2020-01-06 08:16:00 -06:00
samples samples: pktgen: fix proc_cmd command result check logic 2020-01-06 08:15:01 -06:00
scripts UBUNTU: SAUCE: Fix module signing exclusion in package builds 2019-11-25 14:56:30 +01:00
security UBUNTU: SAUCE: import aufs driver 2019-11-25 14:57:01 +01:00
sound ALSA: hda/ca0132 - Fix work handling in delayed HP detection 2020-01-06 08:14:51 -06:00
tools perf tests: Disable bp_signal testing for arm64 2020-01-06 08:16:01 -06:00
ubuntu UBUNTU: hio -- device_add_disk() grew a 'groups' argument in 4.20 2019-11-25 14:56:37 +01:00
usr kbuild: update compile-test header list for v5.4-rc2 2019-10-05 15:29:49 +09:00
virt KVM: arm/arm64: vgic: Don't rely on the wrong pending table 2019-12-16 09:32:34 -06:00
.clang-format clang-format: Update with the latest for_each macro list 2019-08-31 10:00:51 +02:00
.cocciconfig
.get_maintainer.ignore Opt out of scripts/get_maintainer.pl 2019-05-16 10:53:40 -07:00
.gitattributes
.gitignore UBUNTU: [debian] Initial debian and ubuntu directories 2019-11-25 14:56:22 +01:00
.mailmap ARM: SoC fixes 2019-11-10 13:41:59 -08:00
COPYING
CREDITS MAINTAINERS: Remove Simon as Renesas SoC Co-Maintainer 2019-10-10 08:12:51 -07:00
Kbuild kbuild: do not descend to ./Kbuild when cleaning 2019-08-21 21:03:58 +09:00
Kconfig UBUNTU: [debian] Initial debian and ubuntu directories 2019-11-25 14:56:22 +01:00
MAINTAINERS UBUNTU: SAUCE: import aufs driver 2019-11-25 14:56:45 +01:00
Makefile Linux 5.4.6 2020-01-06 07:57:38 -06:00
README Drop all 00-INDEX files from Documentation/ 2018-09-09 15:08:58 -06:00
dropped.txt UBUNTU: [debian] Initial debian and ubuntu directories 2019-11-25 14:56:22 +01:00
snapcraft.yaml UBUNTU: [debian] Initial debian and ubuntu directories 2019-11-25 14:56:22 +01:00
update-version-dkms UBUNTU: [debian] Initial debian and ubuntu directories 2019-11-25 14:56:22 +01:00

README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.