Skip to content

Commit 505f2b9

Browse files
author
Ingo Molnar
committed
tracing, Text Edit Lock - kprobes architecture independent support, nommu 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 <sfr@canb.auug.org.au> Cc: Paul Mundt <lethal@linux-sh.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> LKML-Reference: <20090320110602.86351a91.sfr@canb.auug.org.au> Signed-off-by: Ingo Molnar <mingo@elte.hu>
1 parent 22de89b commit 505f2b9

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

‎kernel/extable.c‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,21 @@
1515
along with this program; if not, write to the Free Software
1616
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1717
*/
18+
#include <linux/ftrace.h>
1819
#include <linux/module.h>
20+
#include <linux/mutex.h>
1921
#include <linux/init.h>
20-
#include <linux/ftrace.h>
21-
#include <asm/uaccess.h>
22+
2223
#include <asm/sections.h>
24+
#include <asm/uaccess.h>
25+
26+
/*
27+
* mutex protecting text section modification (dynamic code patching).
28+
* some users need to sleep (allocating memory...) while they hold this lock.
29+
*
30+
* NOT exported to modules - patching kernel text is a really delicate matter.
31+
*/
32+
DEFINE_MUTEX(text_mutex);
2333

2434
extern struct exception_table_entry __start___ex_table[];
2535
extern struct exception_table_entry __stop___ex_table[];

‎mm/memory.c‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,6 @@ int randomize_va_space __read_mostly =
101101
2;
102102
#endif
103103

104-
/*
105-
* mutex protecting text section modification (dynamic code patching).
106-
* some users need to sleep (allocating memory...) while they hold this lock.
107-
*
108-
* NOT exported to modules - patching kernel text is a really delicate matter.
109-
*/
110-
DEFINE_MUTEX(text_mutex);
111-
112104
static int __init disable_randmaps(char *s)
113105
{
114106
randomize_va_space = 0;

0 commit comments

Comments
 (0)