linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: panand@redhat.com (Pratyush Anand)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH V2 05/10] arm64: Re-factor flush_ptrace_access
Date: Thu, 18 Jun 2015 09:28:52 +0530	[thread overview]
Message-ID: <0456902c7747698bc57bf78c46cc77826b754855.1434598237.git.panand@redhat.com> (raw)
In-Reply-To: <cover.1434598237.git.panand@redhat.com>

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>
---
 arch/arm64/mm/flush.c | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/arch/arm64/mm/flush.c b/arch/arm64/mm/flush.c
index b6f14e8d2121..9a4dd6f39cfb 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);
 }
 
 /*
-- 
2.1.0

  parent reply	other threads:[~2015-06-18  3:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-18  3:58 [RFC PATCH V2 00/10] ARM64: Uprobe support added Pratyush Anand
2015-06-18  3:58 ` [RFC PATCH V2 01/10] arm64: kprobe: Make prepare and handler function independent of 'struct kprobe' Pratyush Anand
2015-06-18  3:58 ` [RFC PATCH V2 02/10] arm64: fix kgdb_step_brk_fn to ignore other's exception Pratyush Anand
2015-06-18  3:58 ` [RFC PATCH V2 03/10] arm64: include asm-generic/ptrace.h in asm/ptrace.h Pratyush Anand
2015-06-18  3:58 ` [RFC PATCH V2 04/10] arm64: Add helper for link pointer Pratyush Anand
2015-06-18  3:58 ` Pratyush Anand [this message]
2015-06-18  3:58 ` [RFC PATCH V2 06/10] arm64: Handle TRAP_HWBRKPT for user mode as well Pratyush Anand
2015-06-18  3:58 ` [RFC PATCH V2 07/10] arm64: Handle TRAP_BRKPT " Pratyush Anand
2015-06-18  3:58 ` [RFC PATCH V2 08/10] arm64: rename enum debug_el to enum debug_elx to fix "wrong kind of tag" Pratyush Anand
2015-06-18  3:58 ` [RFC PATCH V2 09/10] arm64: Add uprobe support Pratyush Anand
2015-06-18  3:58 ` [RFC PATCH V2 10/10] arm64: uprobes: check conditions before simulating instructions Pratyush Anand
2015-08-03 11:09 ` [RFC PATCH V2 00/10] ARM64: Uprobe support added Will Deacon
2015-08-03 13:43   ` David Long
2015-08-03 13:45     ` David Long
2015-08-04 15:07       ` William Cohen
2015-08-04 15:36         ` David Long
2015-08-04 15:43         ` David Long

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0456902c7747698bc57bf78c46cc77826b754855.1434598237.git.panand@redhat.com \
    --to=panand@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).