Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752643AbbFREA3 (ORCPT ); Thu, 18 Jun 2015 00:00:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34594 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752321AbbFRD7s (ORCPT ); Wed, 17 Jun 2015 23:59:48 -0400 From: Pratyush Anand To: linux-arm-kernel@lists.infradead.org, linux@arm.linux.org.uk, catalin.marinas@arm.com, will.deacon@arm.com Cc: linux-kernel@vger.kernel.org, wcohen@redhat.com, oleg@redhat.com, dave.long@linaro.org, steve.capper@linaro.org, srikar@linux.vnet.ibm.com, vijaya.kumar@caviumnetworks.com, Pratyush Anand Subject: [RFC PATCH V2 05/10] arm64: Re-factor flush_ptrace_access Date: Thu, 18 Jun 2015 09:28:52 +0530 Message-Id: <0456902c7747698bc57bf78c46cc77826b754855.1434598237.git.panand@redhat.com> In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1623 Lines: 56 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 --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/