Commit 6b8bd3f4 authored by Hirokazu Takata's avatar Hirokazu Takata Committed by Linus Torvalds

[PATCH] m32r: fix ace_handler to pass full 32-bit address

Don't mask the lower 12-bit of the page fault address.

In the current m32r kernel implementation, we use an access exception
to detect page faults.

This patch fixes ace_handler (access exception handler) for m32r.  In order to
check userspace address in do_page_fault, we have to pass full 32-bit address
to do_page_fault.
Signed-off-by: default avatarHirokazu Takata <takata@linux-m32r.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f894cb5c
...@@ -596,8 +596,6 @@ ENTRY(ace_handler) ...@@ -596,8 +596,6 @@ ENTRY(ace_handler)
beqz r1, inst beqz r1, inst
oprand: oprand:
ld r2, @(low(MDEVA_offset),r2) ; set address ld r2, @(low(MDEVA_offset),r2) ; set address
srli r2, #12
slli r2, #12
srli r1, #1 srli r1, #1
bra 1f bra 1f
inst: inst:
......
...@@ -173,7 +173,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code, ...@@ -173,7 +173,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code,
goto good_area; goto good_area;
if (!(vma->vm_flags & VM_GROWSDOWN)) if (!(vma->vm_flags & VM_GROWSDOWN))
goto bad_area; goto bad_area;
#if 0
if (error_code & ACE_USERMODE) { if (error_code & ACE_USERMODE) {
/* /*
* accessing the stack below "spu" is always a bug. * accessing the stack below "spu" is always a bug.
...@@ -184,7 +184,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code, ...@@ -184,7 +184,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code,
if (address + 4 < regs->spu) if (address + 4 < regs->spu)
goto bad_area; goto bad_area;
} }
#endif
if (expand_stack(vma, address)) if (expand_stack(vma, address))
goto bad_area; goto bad_area;
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment