diff options
Diffstat (limited to 'arch/microblaze/mm/fault.c')
-rw-r--r-- | arch/microblaze/mm/fault.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/arch/microblaze/mm/fault.c b/arch/microblaze/mm/fault.c index 5e67cd1fab40..d9d249a66ff2 100644 --- a/arch/microblaze/mm/fault.c +++ b/arch/microblaze/mm/fault.c | |||
@@ -69,7 +69,7 @@ static int store_updates_sp(struct pt_regs *regs) | |||
69 | * It is called from do_page_fault above and from some of the procedures | 69 | * It is called from do_page_fault above and from some of the procedures |
70 | * in traps.c. | 70 | * in traps.c. |
71 | */ | 71 | */ |
72 | static void bad_page_fault(struct pt_regs *regs, unsigned long address, int sig) | 72 | void bad_page_fault(struct pt_regs *regs, unsigned long address, int sig) |
73 | { | 73 | { |
74 | const struct exception_table_entry *fixup; | 74 | const struct exception_table_entry *fixup; |
75 | /* MS: no context */ | 75 | /* MS: no context */ |
@@ -122,15 +122,10 @@ void do_page_fault(struct pt_regs *regs, unsigned long address, | |||
122 | } | 122 | } |
123 | #endif /* CONFIG_KGDB */ | 123 | #endif /* CONFIG_KGDB */ |
124 | 124 | ||
125 | if (in_atomic() || mm == NULL) { | 125 | if (in_atomic() || !mm) { |
126 | /* FIXME */ | 126 | if (kernel_mode(regs)) |
127 | if (kernel_mode(regs)) { | 127 | goto bad_area_nosemaphore; |
128 | printk(KERN_EMERG | 128 | |
129 | "Page fault in kernel mode - Oooou!!! pid %d\n", | ||
130 | current->pid); | ||
131 | _exception(SIGSEGV, regs, code, address); | ||
132 | return; | ||
133 | } | ||
134 | /* in_atomic() in user mode is really bad, | 129 | /* in_atomic() in user mode is really bad, |
135 | as is current->mm == NULL. */ | 130 | as is current->mm == NULL. */ |
136 | printk(KERN_EMERG "Page fault in user mode with " | 131 | printk(KERN_EMERG "Page fault in user mode with " |
@@ -232,7 +227,7 @@ good_area: | |||
232 | * the fault. | 227 | * the fault. |
233 | */ | 228 | */ |
234 | survive: | 229 | survive: |
235 | fault = handle_mm_fault(mm, vma, address, is_write); | 230 | fault = handle_mm_fault(mm, vma, address, is_write ? FAULT_FLAG_WRITE : 0); |
236 | if (unlikely(fault & VM_FAULT_ERROR)) { | 231 | if (unlikely(fault & VM_FAULT_ERROR)) { |
237 | if (fault & VM_FAULT_OOM) | 232 | if (fault & VM_FAULT_OOM) |
238 | goto out_of_memory; | 233 | goto out_of_memory; |