]>
Commit | Line | Data |
---|---|---|
d13d1dd1 JR |
1 | diff -urNp linux-890/arch/i386/mm/fault.c linux-900/arch/i386/mm/fault.c |
2 | --- linux-890/arch/i386/mm/fault.c | |
3 | +++ linux-900/arch/i386/mm/fault.c | |
4 | @@ -178,9 +178,10 @@ asmlinkage void do_page_fault(struct pt_ | |
5 | * If we're in an interrupt or have no user | |
6 | * context, we must not take the fault.. | |
7 | */ | |
8 | - if (in_interrupt() || !mm) | |
9 | - goto no_context; | |
10 | + if (tsk->in_page_fault || in_interrupt() || !mm) | |
11 | + goto must_oops; | |
12 | ||
13 | + tsk->in_page_fault = 1; | |
14 | down_read(&mm->mmap_sem); | |
15 | ||
16 | vma = find_vma(mm, address); | |
17 | @@ -256,6 +257,7 @@ good_area: | |
18 | tsk->thread.screen_bitmap |= 1 << bit; | |
19 | } | |
20 | up_read(&mm->mmap_sem); | |
21 | + tsk->in_page_fault = 0; | |
22 | return; | |
23 | ||
24 | /* | |
25 | @@ -264,6 +266,7 @@ good_area: | |
26 | */ | |
27 | bad_area: | |
28 | up_read(&mm->mmap_sem); | |
29 | + tsk->in_page_fault = 0; | |
30 | ||
31 | /* User mode accesses just cause a SIGSEGV */ | |
32 | if (error_code & 4) { | |
33 | @@ -304,6 +307,7 @@ no_context: | |
34 | * terminate things with extreme prejudice. | |
35 | */ | |
36 | ||
37 | +must_oops: | |
38 | bust_spinlocks(1); | |
39 | ||
40 | if (address < PAGE_SIZE) | |
41 | @@ -336,6 +340,7 @@ out_of_memory: | |
42 | goto survive; | |
43 | } | |
44 | up_read(&mm->mmap_sem); | |
45 | + tsk->in_page_fault = 0; | |
46 | printk("VM: killing process %s\n", tsk->comm); | |
47 | if (error_code & 4) | |
48 | do_exit(SIGKILL); | |
49 | @@ -343,6 +348,7 @@ out_of_memory: | |
50 | ||
51 | do_sigbus: | |
52 | up_read(&mm->mmap_sem); | |
53 | + tsk->in_page_fault = 0; | |
54 | ||
55 | /* | |
56 | * Send a sigbus, regardless of whether we were in kernel | |
57 | diff -urNp linux-890/arch/x86_64/mm/fault.c linux-900/arch/x86_64/mm/fault.c | |
58 | --- linux-890/arch/x86_64/mm/fault.c | |
59 | +++ linux-900/arch/x86_64/mm/fault.c | |
60 | @@ -141,10 +141,11 @@ asmlinkage void do_page_fault(struct pt_ | |
61 | * If we're in an interrupt or have no user | |
62 | * context, we must not take the fault.. | |
63 | */ | |
64 | - if (in_interrupt() || !mm) | |
65 | - goto no_context; | |
66 | + if (tsk->in_page_fault || in_interrupt() || !mm) | |
67 | + goto must_oops; | |
68 | ||
69 | again: | |
70 | + tsk->in_page_fault = 1; | |
71 | down_read(&mm->mmap_sem); | |
72 | ||
73 | vma = find_vma(mm, address); | |
74 | @@ -202,6 +203,7 @@ good_area: | |
75 | } | |
76 | ||
77 | up_read(&mm->mmap_sem); | |
78 | + tsk->in_page_fault = 0; | |
79 | return; | |
80 | ||
81 | /* | |
82 | @@ -210,6 +212,7 @@ good_area: | |
83 | */ | |
84 | bad_area: | |
85 | up_read(&mm->mmap_sem); | |
86 | + tsk->in_page_fault = 0; | |
87 | ||
88 | bad_area_nosemaphore: | |
89 | ||
90 | @@ -248,6 +251,7 @@ no_context: | |
91 | * terminate things with extreme prejudice. | |
92 | */ | |
93 | ||
94 | +must_oops: | |
95 | console_verbose(); | |
96 | bust_spinlocks(1); | |
97 | ||
98 | @@ -269,7 +273,8 @@ no_context: | |
99 | */ | |
100 | out_of_memory: | |
101 | up_read(&mm->mmap_sem); | |
102 | - if (current->pid == 1) { | |
103 | + tsk->in_page_fault = 0; | |
104 | + if (tsk->pid == 1) { | |
105 | tsk->policy |= SCHED_YIELD; | |
106 | schedule(); | |
107 | goto again; | |
108 | @@ -281,6 +286,7 @@ out_of_memory: | |
109 | ||
110 | do_sigbus: | |
111 | up_read(&mm->mmap_sem); | |
112 | + tsk->in_page_fault = 0; | |
113 | ||
114 | /* | |
115 | * Send a sigbus, regardless of whether we were in kernel | |
116 | diff -urNp linux-890/include/linux/sched.h linux-900/include/linux/sched.h | |
117 | --- linux-890/include/linux/sched.h | |
118 | +++ linux-900/include/linux/sched.h | |
119 | @@ -339,7 +339,7 @@ struct task_struct { | |
120 | int pdeath_signal; /* The signal sent when the parent dies */ | |
121 | /* ??? */ | |
122 | unsigned long personality; | |
123 | - int did_exec:1; | |
124 | + int did_exec:1, in_page_fault:1; | |
125 | pid_t pid; | |
126 | pid_t pgrp; | |
127 | pid_t tty_old_pgrp; |