summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/linux/linux-omap2-git/beagleboard/no-cortex-deadlock.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-kernel/linux/linux-omap2-git/beagleboard/no-cortex-deadlock.patch')
-rw-r--r--meta/recipes-kernel/linux/linux-omap2-git/beagleboard/no-cortex-deadlock.patch75
1 files changed, 75 insertions, 0 deletions
diff --git a/meta/recipes-kernel/linux/linux-omap2-git/beagleboard/no-cortex-deadlock.patch b/meta/recipes-kernel/linux/linux-omap2-git/beagleboard/no-cortex-deadlock.patch
new file mode 100644
index 0000000000..32ec4c2d33
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-omap2-git/beagleboard/no-cortex-deadlock.patch
@@ -0,0 +1,75 @@
1From: Mans Rullgard <mans@mansr.com>
2Date: Wed, 30 Jul 2008 08:25:51 +0000 (+0100)
3Subject: ARM: NEON L1 cache bug workaround (erratum 451034)
4X-Git-Url: http://git.mansr.com/?p=linux-omap;a=commitdiff_plain;h=26023493baf13e0a67fd6cf08d87be5ff6f7c56d
5
6ARM: NEON L1 cache bug workaround (erratum 451034)
7
8On Cortex-A8 r1p0 and r1p1, executing a NEON store with an integer
9store in the store buffer, can cause a processor deadlock under
10certain conditions.
11
12Executing a DMB instruction before saving NEON/VFP registers and before
13return to userspace makes it safe to run code which includes similar
14counter-measures. Userspace code can still trigger the deadlock, so
15a different workaround is required to safely run untrusted code.
16
17See ARM Cortex-A8 Errata Notice (PR120-PRDC-008070) for full details.
18---
19
20diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
21index 8c75840..1172e14 100644
22--- a/arch/arm/Kconfig
23+++ b/arch/arm/Kconfig
24@@ -1071,6 +1071,22 @@ config NEON
25 Say Y to include support code for NEON, the ARMv7 Advanced SIMD
26 Extension.
27
28+config NEON_CACHE_BUG
29+ bool "NEON L1 cache bug workaround (erratum 451034)"
30+ depends on VFPv3
31+ help
32+ On Cortex-A8 r1p0 and r1p1, executing a NEON store with an integer
33+ store in the store buffer, can cause a processor deadlock under
34+ certain conditions.
35+
36+ See ARM Cortex-A8 Errata Notice (PR120-PRDC-008070) for full details.
37+
38+ Say Y to include a workaround.
39+
40+ WARNING: Even with this option enabled, userspace code can trigger
41+ the deadlock. To safely run untrusted code, a different fix is
42+ required.
43+
44 endmenu
45
46 menu "Userspace binary formats"
47diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
48index 597ed00..e50094e 100644
49--- a/arch/arm/kernel/entry-common.S
50+++ b/arch/arm/kernel/entry-common.S
51@@ -68,6 +68,10 @@ no_work_pending:
52 /* perform architecture specific actions before user return */
53 arch_ret_to_user r1, lr
54
55+#ifdef CONFIG_NEON_CACHE_BUG
56+ dmb
57+#endif
58+
59 @ slow_restore_user_regs
60 ldr r1, [sp, #S_PSR] @ get calling cpsr
61 ldr lr, [sp, #S_PC]! @ get pc
62diff --git a/include/asm-arm/vfpmacros.h b/include/asm-arm/vfpmacros.h
63index cccb389..c9d2976 100644
64--- a/include/asm-arm/vfpmacros.h
65+++ b/include/asm-arm/vfpmacros.h
66@@ -32,6 +32,9 @@
67
68 @ write all the working registers out of the VFP
69 .macro VFPFSTMIA, base, tmp
70+#ifdef CONFIG_NEON_CACHE_BUG
71+ dmb
72+#endif
73 #if __LINUX_ARM_ARCH__ < 6
74 STC p11, cr0, [\base],#33*4 @ FSTMIAX \base!, {d0-d15}
75 #else