diff options
Diffstat (limited to 'arch/microblaze/mm/fault.c')
| -rw-r--r-- | arch/microblaze/mm/fault.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/arch/microblaze/mm/fault.c b/arch/microblaze/mm/fault.c index 714b35a9c4f..fa4cf52aa7a 100644 --- a/arch/microblaze/mm/fault.c +++ b/arch/microblaze/mm/fault.c @@ -32,7 +32,7 @@ #include <asm/page.h> #include <asm/pgtable.h> #include <asm/mmu.h> -#include <asm/mmu_context.h> +#include <linux/mmu_context.h> #include <linux/uaccess.h> #include <asm/exceptions.h> @@ -92,15 +92,14 @@ void do_page_fault(struct pt_regs *regs, unsigned long address, int code = SEGV_MAPERR; int is_write = error_code & ESR_S; int fault; - unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE | - (is_write ? FAULT_FLAG_WRITE : 0); + unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; regs->ear = address; regs->esr = error_code; /* On a kernel SLB miss we can only check for a valid exception entry */ if (unlikely(kernel_mode(regs) && (address >= TASK_SIZE))) { - printk(KERN_WARNING "kernel task_size exceed"); + pr_warn("kernel task_size exceed"); _exception(SIGSEGV, regs, code, address); } @@ -114,13 +113,16 @@ void do_page_fault(struct pt_regs *regs, unsigned long address, /* in_atomic() in user mode is really bad, as is current->mm == NULL. */ - printk(KERN_EMERG "Page fault in user mode with " - "in_atomic(), mm = %p\n", mm); - printk(KERN_EMERG "r15 = %lx MSR = %lx\n", + pr_emerg("Page fault in user mode with in_atomic(), mm = %p\n", + mm); + pr_emerg("r15 = %lx MSR = %lx\n", regs->r15, regs->msr); die("Weird page fault", regs, SIGSEGV); } + if (user_mode(regs)) + flags |= FAULT_FLAG_USER; + /* When running in the kernel we expect faults to occur only to * addresses in user space. All other faults represent errors in the * kernel and should generate an OOPS. Unfortunately, in the case of an @@ -199,6 +201,7 @@ good_area: if (unlikely(is_write)) { if (unlikely(!(vma->vm_flags & VM_WRITE))) goto bad_area; + flags |= FAULT_FLAG_WRITE; /* a read */ } else { /* protection fault */ |
