Skip to content

hw_breakpoint: Fix and simplify local address updates for wprobe

Jinchao Wang linux-doc linux-edac linux-perf-users linux-trace-kernel lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3x86/hw_breakpoints: Make DR7 updates NMI safearch/x86/include/asm/debugreg.h arch/x86/kernel/cpu/mce/core.c arch/x86/kernel/hw_breakpoint.c +2 more+101 -730 replies
2/3x86/hw_breakpoints: Add arch_modify_local_hw_breakpoint_addr() APIarch/x86/include/asm/hw_breakpoint.h arch/x86/kernel/hw_breakpoint.c+22 -00 replies
3/3HWBP: Add modify_local_hw_breakpoint_addr() APIarch/Kconfig arch/x86/Kconfig include/linux/hw_breakpoint.h +1 more+45 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] hw_breakpoint: Fix and simplify local address updates for wprobe

Hi Masami,

While reviewing wprobe v10, I prepared three patches to fix and simplify the HWBP support required by wprobe.

This series is based on linux-trace/probes/for-next, the same base used by wprobe v10. It is intended to replace patches 5-7 in v10, so it should not be applied on top of topic/wprobe-v2.

Patch 1 fixes the x86 HWBP slot and DR7 races when an operation is interrupted by an NMI.

Patch 2 adds arch_modify_local_hw_breakpoint_addr(), which updates only the watched address of an installed breakpoint on the local CPU.

Patch 3 adds the matching generic modify_local_hw_breakpoint_addr() API. It keeps the original patch structure and Masami's authorship, while removing attribute parsing, type/length updates and rollback.

With the address-only interface, the install/uninstall refactoring in the old patch 5 is no longer needed.

I can take care of follow-up maintenance related to fast local HWBP watched-address updates.

The patches passed checkpatch and the relevant x86_32 and x86_64 object builds.

Jinchao Wang (2):
x86/hw_breakpoints: Make DR7 updates NMI safe x86/hw_breakpoints: Add arch_modify_local_hw_breakpoint_addr() API

Masami Hiramatsu (Google) (1):
HWBP: Add modify_local_hw_breakpoint_addr() API

 arch/Kconfig                         |   8 ++
 arch/x86/Kconfig                     |   1 +
 arch/x86/include/asm/debugreg.h      |  36 ++++++---
 arch/x86/include/asm/hw_breakpoint.h |   2 +
 arch/x86/kernel/cpu/mce/core.c       |  20 +++--
 arch/x86/kernel/hw_breakpoint.c      | 114 ++++++++++++++++-----------
 arch/x86/kernel/nmi.c                |  10 ++-
 arch/x86/kernel/traps.c              |  10 ++-
 include/linux/hw_breakpoint.h        |   6 ++
 kernel/events/hw_breakpoint.c        |  30 +++++++
 10 files changed, 166 insertions(+), 71 deletions(-)

base-commit: 1a416ae446afa42d2d8500ce25bd61c564508721

Signature · 1 line
2.53.0