diff options
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.patch | 64 |
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 @@ | |||
1 | From 6568c3dad4c19c7cfbd948fbf3f4935f0ab8d0ef Mon Sep 17 00:00:00 2001 | ||
2 | From: Will Deacon <will.deacon@arm.com> | ||
3 | Date: Fri, 20 Jan 2012 14:34:09 -0800 | ||
4 | Subject: [PATCH 124/130] proc: clear_refs: do not clear reserved pages | ||
5 | |||
6 | commit 85e72aa5384b1a614563ad63257ded0e91d1a620 upstream. | ||
7 | |||
8 | /proc/pid/clear_refs is used to clear the Referenced and YOUNG bits for | ||
9 | pages and corresponding page table entries of the task with PID pid, which | ||
10 | includes any special mappings inserted into the page tables in order to | ||
11 | provide things like vDSOs and user helper functions. | ||
12 | |||
13 | On ARM this causes a problem because the vectors page is mapped as a | ||
14 | global mapping and since ec706dab ("ARM: add a vma entry for the user | ||
15 | accessible vector page"), a VMA is also inserted into each task for this | ||
16 | page to aid unwinding through signals and syscall restarts. Since the | ||
17 | vectors page is required for handling faults, clearing the YOUNG bit (and | ||
18 | subsequently 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 | ||
20 | on the next exception. | ||
21 | |||
22 | To see this problem in action, just run: | ||
23 | |||
24 | $ echo 1 > /proc/self/clear_refs | ||
25 | |||
26 | on an ARM platform (as any user) and watch your system hang. I think this | ||
27 | has been the case since 2.6.37 | ||
28 | |||
29 | This patch avoids clearing the aforementioned bits for reserved pages, | ||
30 | therefore leaving the vectors page intact on ARM. Since reserved pages | ||
31 | are not candidates for swap, this change should not have any impact on the | ||
32 | usefulness of clear_refs. | ||
33 | |||
34 | Signed-off-by: Will Deacon <will.deacon@arm.com> | ||
35 | Reported-by: Moussa Ba <moussaba@micron.com> | ||
36 | Acked-by: Hugh Dickins <hughd@google.com> | ||
37 | Cc: David Rientjes <rientjes@google.com> | ||
38 | Cc: Russell King <rmk@arm.linux.org.uk> | ||
39 | Acked-by: Nicolas Pitre <nico@linaro.org> | ||
40 | Cc: Matt Mackall <mpm@selenic.com> | ||
41 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | ||
42 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
43 | Signed-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 | |||
48 | diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c | ||
49 | index 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 | -- | ||
63 | 1.7.7.4 | ||
64 | |||