Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 99cce8f7 authored by Dan Williams's avatar Dan Williams Committed by Russell King
Browse files

[ARM] 4356/1: arm: fix handling of svc mode undefined instructions



Now that do_undefinstr handles kernel and user mode undefined
instruction exceptions it must not assume that interrupts are enabled at
entry.

Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent f16fb1ec
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -286,6 +286,7 @@ asmlinkage void __exception do_undefinstr(struct pt_regs *regs)
	struct undef_hook *hook;
	struct undef_hook *hook;
	siginfo_t info;
	siginfo_t info;
	void __user *pc;
	void __user *pc;
	unsigned long flags;


	/*
	/*
	 * According to the ARM ARM, PC is 2 or 4 bytes ahead,
	 * According to the ARM ARM, PC is 2 or 4 bytes ahead,
@@ -304,7 +305,7 @@ asmlinkage void __exception do_undefinstr(struct pt_regs *regs)
		get_user(instr, (u32 __user *)pc);
		get_user(instr, (u32 __user *)pc);
	}
	}


	spin_lock_irq(&undef_lock);
	spin_lock_irqsave(&undef_lock, flags);
	list_for_each_entry(hook, &undef_hook, node) {
	list_for_each_entry(hook, &undef_hook, node) {
		if ((instr & hook->instr_mask) == hook->instr_val &&
		if ((instr & hook->instr_mask) == hook->instr_val &&
		    (regs->ARM_cpsr & hook->cpsr_mask) == hook->cpsr_val) {
		    (regs->ARM_cpsr & hook->cpsr_mask) == hook->cpsr_val) {
@@ -314,7 +315,7 @@ asmlinkage void __exception do_undefinstr(struct pt_regs *regs)
			}
			}
		}
		}
	}
	}
	spin_unlock_irq(&undef_lock);
	spin_unlock_irqrestore(&undef_lock, flags);


#ifdef CONFIG_DEBUG_USER
#ifdef CONFIG_DEBUG_USER
	if (user_debug & UDBG_UNDEFINED) {
	if (user_debug & UDBG_UNDEFINED) {