Skip to content

Commit af4cb25

Browse files
author
Russell King
committed
ARM: uaccess: fix undefined instruction on ARMv7M/noMMU
The use of get_domain() in copy_thread() results in an oops on ARMv7M/noMMU systems. The thread cpu_domain value is only used when CONFIG_CPU_USE_DOMAINS is enabled, so there's no need to save the value in copy_thread() except when this is enabled, and this option will never be enabled on these platforms. Unhandled exception: IPSR = 00000006 LR = fffffff1 CPU: 0 PID: 0 Comm: swapper Not tainted 4.2.0-next-20150909-00001-gb8ec5ad #41 Hardware name: NXP LPC18xx/43xx (Device Tree) task: 2823fbe0 ti: 2823c000 task.ti: 2823c000 PC is at copy_thread+0x18/0x92 LR is at copy_thread+0x19/0x92 pc : [<2800a46e>] lr : [<2800a46f>] psr: 4100000b sp : 2823df00 ip : 00000000 fp : 287c81c0 r10: 00000000 r9 : 00800300 r8 : 287c8000 r7 : 287c8000 r6 : 2818908d r5 : 00000000 r4 : 287ca000 r3 : 00000000 r2 : 00000000 r1 : fffffff0 r0 : 287ca048 xPSR: 4100000b Reported-by: Ariel D'Alessandro <[email protected]> Signed-off-by: Russell King <[email protected]>
1 parent 296254f commit af4cb25

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/arm/kernel/process.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,15 @@ copy_thread(unsigned long clone_flags, unsigned long stack_start,
233233

234234
memset(&thread->cpu_context, 0, sizeof(struct cpu_context_save));
235235

236+
#ifdef CONFIG_CPU_USE_DOMAINS
236237
/*
237238
* Copy the initial value of the domain access control register
238239
* from the current thread: thread->addr_limit will have been
239240
* copied from the current thread via setup_thread_stack() in
240241
* kernel/fork.c
241242
*/
242243
thread->cpu_domain = get_domain();
244+
#endif
243245

244246
if (likely(!(p->flags & PF_KTHREAD))) {
245247
*childregs = *current_pt_regs();

0 commit comments

Comments
 (0)