Skip to content

Commit

Permalink
tracing, Text Edit Lock - kprobes architecture independent support, n…
Browse files Browse the repository at this point in the history
…ommu fix

Impact: build fix on SH !CONFIG_MMU

Stephen Rothwell reported this linux-next build failure on the SH
architecture:

  kernel/built-in.o: In function `disable_all_kprobes':
  kernel/kprobes.c:1382: undefined reference to `text_mutex'
  [...]

And observed:

| Introduced by commit 4460fda ("tracing,
| Text Edit Lock - kprobes architecture independent support") from the
| tracing tree.  text_mutex is defined in mm/memory.c which is only built
| if CONFIG_MMU is defined, which is not true for sh allmodconfig.

Move this lock to kernel/extable.c (which is already home to various
kernel text related routines), which file is always built-in.

Reported-by: Stephen Rothwell <[email protected]>
Cc: Paul Mundt <[email protected]>
Cc: Mathieu Desnoyers <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
Ingo Molnar committed Mar 20, 2009
1 parent 22de89b commit 505f2b9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
14 changes: 12 additions & 2 deletions kernel/extable.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,21 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <linux/ftrace.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/init.h>
#include <linux/ftrace.h>
#include <asm/uaccess.h>

#include <asm/sections.h>
#include <asm/uaccess.h>

/*
* mutex protecting text section modification (dynamic code patching).
* some users need to sleep (allocating memory...) while they hold this lock.
*
* NOT exported to modules - patching kernel text is a really delicate matter.
*/
DEFINE_MUTEX(text_mutex);

extern struct exception_table_entry __start___ex_table[];
extern struct exception_table_entry __stop___ex_table[];
Expand Down
8 changes: 0 additions & 8 deletions mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,6 @@ int randomize_va_space __read_mostly =
2;
#endif

/*
* mutex protecting text section modification (dynamic code patching).
* some users need to sleep (allocating memory...) while they hold this lock.
*
* NOT exported to modules - patching kernel text is a really delicate matter.
*/
DEFINE_MUTEX(text_mutex);

static int __init disable_randmaps(char *s)
{
randomize_va_space = 0;
Expand Down

0 comments on commit 505f2b9

Please sign in to comment.