aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPratyush Anand <panand@redhat.com>2014-12-30 15:39:28 +0530
committerSteven Capper <steve.capper@linaro.org>2015-04-07 12:58:39 +0100
commitf58abc2b6c4d0c0eb42e06e502b25a2f97efb903 (patch)
tree665e6422cb7b54879331a274284183aa2e3d0fbd
parentf3f97350d6c13bd286ec6604147d980ff19fb5c5 (diff)
downloadlinux-f58abc2b6c4d0c0eb42e06e502b25a2f97efb903.tar.gz
ARM64: Re-factor flush_ptrace_access
Re-factor flush_ptrace_access to reuse vma independent part, which is needed for functions like arch_uprobe_copy_ixol where we do not have a vma. Signed-off-by: Pratyush Anand <panand@redhat.com> Signed-off-by: Steve Capper <steve.capper@linaro.org>
-rw-r--r--arch/arm64/mm/flush.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/arch/arm64/mm/flush.c b/arch/arm64/mm/flush.c
index b6f14e8d212..9a4dd6f39cf 100644
--- a/arch/arm64/mm/flush.c
+++ b/arch/arm64/mm/flush.c
@@ -34,19 +34,25 @@ void flush_cache_range(struct vm_area_struct *vma, unsigned long start,
__flush_icache_all();
}
+static void __flush_ptrace_access(struct page *page, unsigned long uaddr,
+ void *kaddr, unsigned long len)
+{
+ unsigned long addr = (unsigned long)kaddr;
+
+ if (icache_is_aliasing()) {
+ __flush_dcache_area(kaddr, len);
+ __flush_icache_all();
+ } else {
+ flush_icache_range(addr, addr + len);
+ }
+}
+
static void flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
unsigned long uaddr, void *kaddr,
unsigned long len)
{
- if (vma->vm_flags & VM_EXEC) {
- unsigned long addr = (unsigned long)kaddr;
- if (icache_is_aliasing()) {
- __flush_dcache_area(kaddr, len);
- __flush_icache_all();
- } else {
- flush_icache_range(addr, addr + len);
- }
- }
+ if (vma->vm_flags & VM_EXEC)
+ __flush_ptrace_access(page, uaddr, kaddr, len);
}
/*