Skip to contentSkip to conversation

include/linux/kernel.h: Make might_fault to be a nop for !MMU

PATCH In review Axel Lin 2 participants 2 messages Nov 29, 2013 – Dec 1, 2013

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 include/linux/kernel.h: Make might_fault to be a nop for !MMU

No fault if !MUU, thus make might_fault to be a nop for !MMU.

This fixes below build error if
!CONFIG_MMU && (CONFIG_PROVE_LOCKING=y || CONFIG_DEBUG_ATOMIC_SLEEP=y):

arch/arm/kernel/built-in.o: In function `arch_ptrace':
arch/arm/kernel/ptrace.c:852: undefined reference to might_fault' arch/arm/kernel/built-in.o: In function restore_sigframe':
arch/arm/kernel/signal.c:173: undefined reference to might_fault' arch/arm/kernel/signal.c:174: undefined reference to might_fault' arch/arm/kernel/signal.c:175: undefined reference to might_fault' arch/arm/kernel/signal.c:176: undefined reference to might_fault' arch/arm/kernel/built-in.o:arch/arm/kernel/signal.c:177: more undefined references to `might_fault' follow
make: *** [vmlinux] Error 1

Cc Michael S. Tsirkin <[email protected]>
Cc Peter Zijlstra <[email protected]>
---
 include/linux/kernel.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
include/linux/kernel.h +2 -1
index 2ac0277..8b0ad48 100644
@@ -193,7 +193,8 @@ extern int _cond_resched(void);
 		(__x < 0) ? -__x : __x;		\
 	})
 
-#if defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_DEBUG_ATOMIC_SLEEP)
+#if defined(CONFIG_MMU) && \
+	(defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_DEBUG_ATOMIC_SLEEP))
 void might_fault(void);
 #else
 static inline void might_fault(void) { }
Signature · 1 line
1.8.1.2
Acked-by on v1 1/1
#1 lore raw
Quoted 15 lines · Axel Lin

No fault if !MUU, thus make might_fault to be a nop for !MMU.

This fixes below build error if
!CONFIG_MMU && (CONFIG_PROVE_LOCKING=y || CONFIG_DEBUG_ATOMIC_SLEEP=y):

arch/arm/kernel/built-in.o: In function `arch_ptrace':
arch/arm/kernel/ptrace.c:852: undefined reference to might_fault' arch/arm/kernel/built-in.o: In function restore_sigframe':
arch/arm/kernel/signal.c:173: undefined reference to might_fault' arch/arm/kernel/signal.c:174: undefined reference to might_fault' arch/arm/kernel/signal.c:175: undefined reference to might_fault' arch/arm/kernel/signal.c:176: undefined reference to might_fault' arch/arm/kernel/built-in.o:arch/arm/kernel/signal.c:177: more undefined references to `might_fault' follow
make: *** [vmlinux] Error 1

Quoted 3 lines
Cc Michael S. Tsirkin <[email protected]>
Cc Peter Zijlstra <[email protected]>

Makes sense. FWIW

Quoted 22 lines
---
 include/linux/kernel.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
include/linux/kernel.h +2 -1
index 2ac0277..8b0ad48 100644
@@ -193,7 +193,8 @@ extern int _cond_resched(void);
 		(__x < 0) ? -__x : __x;		\
 	})
 
-#if defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_DEBUG_ATOMIC_SLEEP)
+#if defined(CONFIG_MMU) && \
+	(defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_DEBUG_ATOMIC_SLEEP))
 void might_fault(void);
 #else
 static inline void might_fault(void) { }
Signature · 1 line
1.8.1.2