forked from Minki/linux
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 4542b6a0fa
("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>
This commit is contained in:
parent
d9524dc32c
commit
97c72d89ce
@ -550,24 +550,11 @@ static long do_cache_op_restart(struct restart_block *unused)
|
|||||||
static inline int
|
static inline int
|
||||||
do_cache_op(unsigned long start, unsigned long end, int flags)
|
do_cache_op(unsigned long start, unsigned long end, int flags)
|
||||||
{
|
{
|
||||||
struct mm_struct *mm = current->active_mm;
|
|
||||||
struct vm_area_struct *vma;
|
|
||||||
|
|
||||||
if (end < start || flags)
|
if (end < start || flags)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
down_read(&mm->mmap_sem);
|
if (!access_ok(VERIFY_READ, start, end - start))
|
||||||
vma = find_vma(mm, start);
|
return -EFAULT;
|
||||||
if (!vma || vma->vm_start >= end) {
|
|
||||||
up_read(&mm->mmap_sem);
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (start < vma->vm_start)
|
|
||||||
start = vma->vm_start;
|
|
||||||
if (end > vma->vm_end)
|
|
||||||
end = vma->vm_end;
|
|
||||||
up_read(&mm->mmap_sem);
|
|
||||||
|
|
||||||
return __do_cache_op(start, end);
|
return __do_cache_op(start, end);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user