[PATCH 0/3] hw_breakpoint: Fix and simplify local address updates for wprobe
From: Jinchao Wang
Date: Sun Jul 26 2026 - 08:24:05 EST
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
--
2.53.0