Commit 99e8c5a3b875a34d894a711c9a3669858d6adf45

Authored by Frederic Weisbecker
Committed by Ingo Molnar
1 parent 5d27c23df0

hw-breakpoints: Fix hardware breakpoints -> perf events dependency

The kbuild's select command doesn't propagate through the config
dependencies.

Hence the current rules of hardware breakpoint's config can't
ensure perf can never be disabled under us.

We have:

config X86
	selects HAVE_HW_BREAKPOINTS

config HAVE_HW_BREAKPOINTS
	select PERF_EVENTS

config PERF_EVENTS
	[...]

x86 will select the breakpoints but that won't propagate to perf
events. The user can still disable the latter, but it is
necessary for the breakpoints.

What we need is:

 - x86 selects HAVE_HW_BREAKPOINTS and PERF_EVENTS
 - HAVE_HW_BREAKPOINTS depends on PERF_EVENTS

so that we ensure PERF_EVENTS is enabled and frozen for x86.

This fixes the following kind of build errors:

 In file included from arch/x86/kernel/hw_breakpoint.c:31:
 include/linux/hw_breakpoint.h: In function 'hw_breakpoint_addr':
 include/linux/hw_breakpoint.h:39: error: 'struct perf_event' has no member named 'attr'

v2: Select also ANON_INODES from x86, required for perf

Reported-by: Cyrill Gorcunov <gorcunov@gmail.com>
Reported-by: Michal Marek <mmarek@suse.cz>
Reported-by: Andrew Randrianasulu <randrik_a@yahoo.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Cc: K.Prasad <prasad@linux.vnet.ibm.com>
LKML-Reference: <1261010034-7786-1-git-send-regression-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

Showing 2 changed files with 3 additions and 3 deletions Side-by-side Diff

... ... @@ -135,9 +135,7 @@
135 135  
136 136 config HAVE_HW_BREAKPOINT
137 137 bool
138   - depends on HAVE_PERF_EVENTS
139   - select ANON_INODES
140   - select PERF_EVENTS
  138 + depends on PERF_EVENTS
141 139  
142 140 config HAVE_USER_RETURN_NOTIFIER
143 141 bool
... ... @@ -50,6 +50,8 @@
50 50 select HAVE_KERNEL_BZIP2
51 51 select HAVE_KERNEL_LZMA
52 52 select HAVE_HW_BREAKPOINT
  53 + select PERF_EVENTS
  54 + select ANON_INODES
53 55 select HAVE_ARCH_KMEMCHECK
54 56 select HAVE_USER_RETURN_NOTIFIER
55 57