From 36b841288656b9b30b5d2add2fd136ac7eab5867 Mon Sep 17 00:00:00 2001 From: Graf Yang Date: Tue, 21 Jul 2009 02:26:57 +0000 Subject: Blackfin: fix MPU handling of invalid memory accesses The protect_page() function was incorrectly setting up the hardware tables based on possible access capabilities rather than the actual requested values. This means we would grant more access to mmap-ed pages than we should have. Once we fix this, we need to tweak the signal generated by such accesses to aline ourselves with other ports. This allows the LTP mmap0{5,6,7} cases to run properly. Signed-off-by: Graf Yang Signed-off-by: Mike Frysinger --- arch/blackfin/include/asm/mmu_context.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'arch/blackfin/include/asm/mmu_context.h') diff --git a/arch/blackfin/include/asm/mmu_context.h b/arch/blackfin/include/asm/mmu_context.h index 944e29faae48..040410bb07e1 100644 --- a/arch/blackfin/include/asm/mmu_context.h +++ b/arch/blackfin/include/asm/mmu_context.h @@ -127,17 +127,17 @@ static inline void protect_page(struct mm_struct *mm, unsigned long addr, unsigned long idx = page >> 5; unsigned long bit = 1 << (page & 31); - if (flags & VM_MAYREAD) + if (flags & VM_READ) mask[idx] |= bit; else mask[idx] &= ~bit; mask += page_mask_nelts; - if (flags & VM_MAYWRITE) + if (flags & VM_WRITE) mask[idx] |= bit; else mask[idx] &= ~bit; mask += page_mask_nelts; - if (flags & VM_MAYEXEC) + if (flags & VM_EXEC) mask[idx] |= bit; else mask[idx] &= ~bit; -- cgit v1.2.3