summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0124-proc-clear_refs-do-not-clear-reserved-pages.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0124-proc-clear_refs-do-not-clear-reserved-pages.patch')
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0124-proc-clear_refs-do-not-clear-reserved-pages.patch64
1 files changed, 64 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0124-proc-clear_refs-do-not-clear-reserved-pages.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0124-proc-clear_refs-do-not-clear-reserved-pages.patch
new file mode 100644
index 00000000..c27ca944
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0124-proc-clear_refs-do-not-clear-reserved-pages.patch
@@ -0,0 +1,64 @@
1From 6568c3dad4c19c7cfbd948fbf3f4935f0ab8d0ef Mon Sep 17 00:00:00 2001
2From: Will Deacon <will.deacon@arm.com>
3Date: Fri, 20 Jan 2012 14:34:09 -0800
4Subject: [PATCH 124/130] proc: clear_refs: do not clear reserved pages
5
6commit 85e72aa5384b1a614563ad63257ded0e91d1a620 upstream.
7
8/proc/pid/clear_refs is used to clear the Referenced and YOUNG bits for
9pages and corresponding page table entries of the task with PID pid, which
10includes any special mappings inserted into the page tables in order to
11provide things like vDSOs and user helper functions.
12
13On ARM this causes a problem because the vectors page is mapped as a
14global mapping and since ec706dab ("ARM: add a vma entry for the user
15accessible vector page"), a VMA is also inserted into each task for this
16page to aid unwinding through signals and syscall restarts. Since the
17vectors page is required for handling faults, clearing the YOUNG bit (and
18subsequently writing a faulting pte) means that we lose the vectors page
19*globally* and cannot fault it back in. This results in a system deadlock
20on the next exception.
21
22To see this problem in action, just run:
23
24 $ echo 1 > /proc/self/clear_refs
25
26on an ARM platform (as any user) and watch your system hang. I think this
27has been the case since 2.6.37
28
29This patch avoids clearing the aforementioned bits for reserved pages,
30therefore leaving the vectors page intact on ARM. Since reserved pages
31are not candidates for swap, this change should not have any impact on the
32usefulness of clear_refs.
33
34Signed-off-by: Will Deacon <will.deacon@arm.com>
35Reported-by: Moussa Ba <moussaba@micron.com>
36Acked-by: Hugh Dickins <hughd@google.com>
37Cc: David Rientjes <rientjes@google.com>
38Cc: Russell King <rmk@arm.linux.org.uk>
39Acked-by: Nicolas Pitre <nico@linaro.org>
40Cc: Matt Mackall <mpm@selenic.com>
41Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
42Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
43Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
44---
45 fs/proc/task_mmu.c | 3 +++
46 1 files changed, 3 insertions(+), 0 deletions(-)
47
48diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
49index e418c5a..7dcd2a2 100644
50--- a/fs/proc/task_mmu.c
51+++ b/fs/proc/task_mmu.c
52@@ -518,6 +518,9 @@ static int clear_refs_pte_range(pmd_t *pmd, unsigned long addr,
53 if (!page)
54 continue;
55
56+ if (PageReserved(page))
57+ continue;
58+
59 /* Clear accessed and referenced bits. */
60 ptep_test_and_clear_young(vma, addr, pte);
61 ClearPageReferenced(page);
62--
631.7.7.4
64