]> git.hungrycats.org Git - linux/commitdiff
[PATCH] arm: fix handling of svc mode undefined instructions
authorDan Williams <dan.j.williams@intel.com>
Fri, 4 May 2007 18:22:23 +0000 (11:22 -0700)
committerChris Wright <chrisw@sous-sol.org>
Wed, 23 May 2007 21:32:43 +0000 (14:32 -0700)
Now that do_undefinstr handles kernel and user mode undefined
instruction exceptions it must not assume that interrupts are enabled at
entry.

Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
arch/arm/kernel/traps.c

index 24095601359b94e04b9d8b83b2b9ab70cb9a2135..7ed141f80a30cb6111182a39d7adcc7cb72f0c3e 100644 (file)
@@ -273,6 +273,7 @@ asmlinkage void do_undefinstr(struct pt_regs *regs)
        struct undef_hook *hook;
        siginfo_t info;
        void __user *pc;
+       unsigned long flags;
 
        /*
         * According to the ARM ARM, PC is 2 or 4 bytes ahead,
@@ -291,7 +292,7 @@ asmlinkage void do_undefinstr(struct pt_regs *regs)
                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) {
                if ((instr & hook->instr_mask) == hook->instr_val &&
                    (regs->ARM_cpsr & hook->cpsr_mask) == hook->cpsr_val) {
@@ -301,7 +302,7 @@ asmlinkage void do_undefinstr(struct pt_regs *regs)
                        }
                }
        }
-       spin_unlock_irq(&undef_lock);
+       spin_unlock_irqrestore(&undef_lock, flags);
 
 #ifdef CONFIG_DEBUG_USER
        if (user_debug & UDBG_UNDEFINED) {