Frederic Weisbecker wrote: > This patch rebase the implementation of the breakpoints API on top of > perf events instances. > > Each breakpoints are now perf events that handle the > register scheduling, thread/cpu attachment, etc.. > > The new layering is now made as follows: > > ptrace kgdb ftrace perf syscall > \ | / / > \ | / / > / > Core breakpoint API / > / > | / > | / > > Breakpoints perf events > > | > | > > Breakpoints PMU ---- Debug Register constraints handling > (Part of core breakpoint API) > | > | > > Hardware debug registers > > Reasons of this rewrite: > > - Use the centralized/optimized pmu registers scheduling, > implying an easier arch integration > - More powerful register handling: perf attributes (pinned/flexible > events, exclusive/non-exclusive, tunable period, etc...) > > Impact: > > - New perf ABI: the hardware breakpoints counters > - Ptrace breakpoints setting remains tricky and still needs some per > thread breakpoints references. - Broken CONFIG_KVM > > Todo (in the order): > - Unbreak CONFIG_KVM :) > - Support breakpoints perf counter events for perf tools (ie: implement > perf_bpcounter_event()) > - Support from perf tools Since commit 3d53c27d05, KVM uses current->thread.debugregs for restoring the host state in case the guest played with breakpoints. We need an equivalent interface to restore ptrace breakpoints and all others currently in use. Jan