Skip to content

hw-breakpoints: new hardware breakpoints API

Frederic Weisbecker lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest12 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12hw-breakpoints: prepare the code for Hardware Breakpoint interfacesarch/x86/include/asm/a.out-core.h arch/x86/include/asm/debugreg.h arch/x86/include/asm/hw_breakpoint.h +6 more+255 -320 replies
2/12hw-breakpoints: introducing generic hardware breakpoint handler interfacesarch/Kconfig kernel/Makefile kernel/hw_breakpoint.c+383 -00 replies
3/12hw-breakpoints: x86 architecture implementation of Hardware Breakpoint interfacesarch/x86/Kconfig arch/x86/kernel/Makefile arch/x86/kernel/hw_breakpoint.c+384 -10 replies
4/12hw-breakpoints: modifying generic debug exception to use thread-specific debug registersarch/x86/kernel/traps.c+24 -450 replies
5/12hw-breakpoints: use wrapper routines around debug registers in processor related functionsarch/x86/kernel/smpboot.c arch/x86/power/cpu_32.c arch/x86/power/cpu_64.c+9 -190 replies
6/12hw-breakpoints: use the new wrapper routines to access debug registers in process/thread codearch/x86/kernel/process.c arch/x86/kernel/process_32.c arch/x86/kernel/process_64.c+65 -160 replies
7/12hw-breakpoints: modify signal handling code to refrain from re-enabling HW Breakpointsarch/x86/kernel/signal.c+0 -90 replies
8/12hw-breakpoints: modify Ptrace routines to access breakpoint registersarch/x86/kernel/ptrace.c+141 -900 replies
9/12hw-breakpoints: cleanup HW Breakpoint registers before kexecarch/x86/kernel/machine_kexec_32.c arch/x86/kernel/machine_kexec_64.c+4 -00 replies
10/12hw-breakpoints: sample HW breakpoint over kernel data addresssamples/Kconfig samples/Makefile samples/hw_breakpoint/Makefile +1 more+92 -10 replies
11/12hw-breakpoints: ftrace plugin for kernel symbol tracing using HW Breakpoint interfaceskernel/trace/Kconfig kernel/trace/Makefile kernel/trace/trace.h +2 more+623 -07 replies
12/12hw-breakpoints: reset bits in dr6 after the corresponding exception is handledarch/x86/kernel/hw_breakpoint.c arch/x86/kernel/kgdb.c arch/x86/kernel/kprobes.c +2 more+34 -60 replies

Reviews trailers per patch

9 of 12 patches have a Reviewed-by or Acked-by.

PatchAlan Stern
1/12Original-patch-by R-b
2/12Original-patch-by R-b
3/12Original-patch-by R-b
4/12Original-patch-by R-b
5/12Original-patch-by R-b
6/12Original-patch-by R-b
7/12Original-patch-by R-b
8/12Original-patch-by R-b
9/12Original-patch-by R-b
10/12
11/12
12/12

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/12] hw-breakpoints: new hardware breakpoints API

Hi Ingo,

The new hardware breakpoint API has benefit from deep reviews since its first iteration several months ago, and Prasad has addressed most (all?) of them.

After a small reorg and few fixes that were done recently, it seems ready for integration on -tip.

I've tested it successfully for both kernel (ftrace) and user (gdb) hardware breakpoints.

Thanks!

Frederic.

The following changes since commit 43bd1236234cacbc18d1476a9b57e7a306efddf5:
Frederic Weisbecker (1):
tracing/stat: remove unappropriate safe walk on list

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing.git hw-breakpoints

K.Prasad (12):
hw-breakpoints: prepare the code for Hardware Breakpoint interfaces
hw-breakpoints: introducing generic hardware breakpoint handler interfaces
hw-breakpoints: x86 architecture implementation of Hardware Breakpoint interfaces
hw-breakpoints: modifying generic debug exception to use thread-specific debug registers
hw-breakpoints: use wrapper routines around debug registers in processor related functions
hw-breakpoints: use the new wrapper routines to access debug registers in process/thread code
hw-breakpoints: modify signal handling code to refrain from re-enabling HW Breakpoints
hw-breakpoints: modify Ptrace routines to access breakpoint registers
hw-breakpoints: cleanup HW Breakpoint registers before kexec
hw-breakpoints: sample HW breakpoint over kernel data address
hw-breakpoints: ftrace plugin for kernel symbol tracing using HW Breakpoint interfaces
hw-breakpoints: reset bits in dr6 after the corresponding exception is handled

 arch/Kconfig                            |    4 +
 arch/x86/Kconfig                        |    1 +
 arch/x86/include/asm/a.out-core.h       |    8 +-
 arch/x86/include/asm/debugreg.h         |   29 ++
 arch/x86/include/asm/hw_breakpoint.h    |   55 ++++
 arch/x86/include/asm/processor.h        |    8 +-
 arch/x86/kernel/Makefile                |    2 +-
 arch/x86/kernel/hw_breakpoint.c         |  391 +++++++++++++++++++++++
 arch/x86/kernel/kgdb.c                  |    6 +
 arch/x86/kernel/kprobes.c               |    9 +-
 arch/x86/kernel/machine_kexec_32.c      |    2 +
 arch/x86/kernel/machine_kexec_64.c      |    2 +
 arch/x86/kernel/process.c               |   22 +-
 arch/x86/kernel/process_32.c            |   28 ++
 arch/x86/kernel/process_64.c            |   31 ++
 arch/x86/kernel/ptrace.c                |  231 +++++++++------
 arch/x86/kernel/signal.c                |    9 -
 arch/x86/kernel/smpboot.c               |    3 +
 arch/x86/kernel/traps.c                 |   71 ++---
 arch/x86/mm/kmmio.c                     |    8 +-
 arch/x86/power/cpu_32.c                 |   13 +-
 arch/x86/power/cpu_64.c                 |   12 +-
 include/asm-generic/hw_breakpoint.h     |  139 ++++++++
 kernel/Makefile                         |    1 +
 kernel/hw_breakpoint.c                  |  378 ++++++++++++++++++++++
 kernel/trace/Kconfig                    |   21 ++
 kernel/trace/Makefile                   |    1 +
 kernel/trace/trace.h                    |   23 ++
 kernel/trace/trace_ksym.c               |  525 +++++++++++++++++++++++++++++++
 kernel/trace/trace_selftest.c           |   53 +++
 samples/Kconfig                         |    6 +
 samples/Makefile                        |    3 +-
 samples/hw_breakpoint/Makefile          |    1 +
 samples/hw_breakpoint/data_breakpoint.c |   83 +++++
 34 files changed, 1987 insertions(+), 192 deletions(-)
 create mode 100644 arch/x86/include/asm/hw_breakpoint.h
 create mode 100644 arch/x86/kernel/hw_breakpoint.c
 create mode 100644 include/asm-generic/hw_breakpoint.h
 create mode 100644 kernel/hw_breakpoint.c
 create mode 100644 kernel/trace/trace_ksym.c
 create mode 100644 samples/hw_breakpoint/Makefile
 create mode 100644 samples/hw_breakpoint/data_breakpoint.c