]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 May 2014 11:18:01 +0000 (13:18 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 May 2014 11:18:01 +0000 (13:18 +0200)
added patches:
arc-preempt-ensure-return-to-kernel-mode-is-irq-safe.patch

queue-3.10/arc-preempt-ensure-return-to-kernel-mode-is-irq-safe.patch [new file with mode: 0644]
queue-3.10/series

diff --git a/queue-3.10/arc-preempt-ensure-return-to-kernel-mode-is-irq-safe.patch b/queue-3.10/arc-preempt-ensure-return-to-kernel-mode-is-irq-safe.patch
new file mode 100644 (file)
index 0000000..126d3f2
--- /dev/null
@@ -0,0 +1,54 @@
+From 8aa9e85adac609588eeec356e5a85059b3b819ba Mon Sep 17 00:00:00 2001
+From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
+Date: Wed, 30 Apr 2014 15:26:45 +0530
+Subject: ARC: !PREEMPT: Ensure Return to kernel mode is IRQ safe
+
+From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
+
+commit 8aa9e85adac609588eeec356e5a85059b3b819ba upstream.
+
+There was a very small race window where resume to kernel mode from a
+Exception Path (or pure kernel mode which is true for most of ARC
+exceptions anyways), was not disabling interrupts in restore_regs,
+clobbering the exception regs
+
+Anton found the culprit call flow (after many sleepless nights)
+
+| 1. we got a Trap from user land
+| 2. started to service it.
+| 3. While doing some stuff on user-land memory (I think it is padzero()),
+|     we got a DataTlbMiss
+| 4. On return from it we are taking "resume_kernel_mode" path
+| 5. NEED_RESHED is not set, so we go to "return from exception" path in
+|     restore regs.
+| 6. there seems to be IRQ happening
+
+Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
+Cc: Anton Kolesov <Anton.Kolesov@synopsys.com>
+Cc: Francois Bedard <Francois.Bedard@synopsys.com>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arc/kernel/entry.S |    8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+--- a/arch/arc/kernel/entry.S
++++ b/arch/arc/kernel/entry.S
+@@ -651,11 +651,13 @@ resume_user_mode_begin:
+ resume_kernel_mode:
+-#ifdef CONFIG_PREEMPT
+-
+-      ; This is a must for preempt_schedule_irq()
++      ; Disable Interrupts from this point on
++      ; CONFIG_PREEMPT: This is a must for preempt_schedule_irq()
++      ; !CONFIG_PREEMPT: To ensure restore_regs is intr safe
+       IRQ_DISABLE     r9
++#ifdef CONFIG_PREEMPT
++
+       ; Can't preempt if preemption disabled
+       GET_CURR_THR_INFO_FROM_SP   r10
+       ld  r8, [r10, THREAD_INFO_PREEMPT_COUNT]
index 3c3619dcf13c0f8e74cee7c1ee50f23e8c341a1d..f4efeae3a38a743b71569d8e3cb3baff3e0678ac 100644 (file)
@@ -46,3 +46,4 @@ lockd-ensure-we-tear-down-any-live-sockets-when-socket-creation-fails-during-loc
 input-synaptics-add-min-max-quirk-for-thinkpad-t431s-l440-l540-s1-yoga-and-x1.patch
 input-synaptics-add-min-max-quirk-for-thinkpad-edge-e431.patch
 drm-cirrus-add-power-management-support.patch
+arc-preempt-ensure-return-to-kernel-mode-is-irq-safe.patch