aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2012-08-22 06:06:54 -0400
committerWill Deacon <will.deacon@arm.com>2013-08-20 06:54:55 -0400
commit97c72d89ce0ec8c73f19d5e35ec1f90f7a14bed7 (patch)
tree3711daf93348310350bd1a94f89f5ccce092397e /arch/arm/kernel
parentd9524dc32cab52714dee0c8e59c7437ee33a239a (diff)
ARM: cacheflush: don't bother rounding to nearest vma
do_cache_op finds the lowest VMA contained in the specified address range and rounds the range to cover only the mapped addresses. Since commit 4542b6a0fa6b ("ARM: 7365/1: drop unused parameter from flush_cache_user_range") the VMA is not used for anything else in this code and seeing as the low-level cache flushing routines return -EFAULT if the address is not valid, there is no need for this range truncation. This patch removes the VMA handling code from the cacheflushing syscall. Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r--arch/arm/kernel/traps.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 4d268d912b0e..9b2c5d42c143 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -550,24 +550,11 @@ static long do_cache_op_restart(struct restart_block *unused)
550static inline int 550static inline int
551do_cache_op(unsigned long start, unsigned long end, int flags) 551do_cache_op(unsigned long start, unsigned long end, int flags)
552{ 552{
553 struct mm_struct *mm = current->active_mm;
554 struct vm_area_struct *vma;
555
556 if (end < start || flags) 553 if (end < start || flags)
557 return -EINVAL; 554 return -EINVAL;
558 555
559 down_read(&mm->mmap_sem); 556 if (!access_ok(VERIFY_READ, start, end - start))
560 vma = find_vma(mm, start); 557 return -EFAULT;
561 if (!vma || vma->vm_start >= end) {
562 up_read(&mm->mmap_sem);
563 return -EINVAL;
564 }
565
566 if (start < vma->vm_start)
567 start = vma->vm_start;
568 if (end > vma->vm_end)
569 end = vma->vm_end;
570 up_read(&mm->mmap_sem);
571 558
572 return __do_cache_op(start, end); 559 return __do_cache_op(start, end);
573} 560}