From patchwork Fri Dec 13 19:05:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Capper X-Patchwork-Id: 22341 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f69.google.com (mail-vb0-f69.google.com [209.85.212.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6E191202E2 for ; Fri, 13 Dec 2013 19:05:59 +0000 (UTC) Received: by mail-vb0-f69.google.com with SMTP id m10sf3927767vbh.0 for ; Fri, 13 Dec 2013 11:05:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=mkhJM/CEqZ5FR8O9/uxZPW3mL9ajwX6fjO2FGEguXmM=; b=B1W1CZIs5mudUzDt4Ul9IohgHzbpterjiKW5k7sRTAgnUmhfw8r7B38bnXkuNlSQGl 93egn01fB5YIO8LGfycKzFdf7i/pqIQ6VR2F6+QIahJR+4RS0CE2IRBuEeuZ8wE6vLqb 9Z1/SHd2Nvj5OZOfjEiuV9kWjLZ+1+S/MJ17QKXi5fw7ymTTbO9Y1AFEvvtvaYvRTh5o FkFc1EFmRf6bGYvYAo6FXQrMEoRbqoQFrYDOIboByNqqR/mZOlydWq7TT7Y446BI+Sfj mcCysCIr2sC0HZh04ucRId/C899oZkIyYfUZSDYq0WfBa2W/Gv4vDtFXVzMFfG9UoffG vBcg== X-Gm-Message-State: ALoCoQn8MACrO9d9/nEZs1lNM45+O0IE+jy5clIGG7bQpp37qO7Z1QNr/OKgi1P7oQ148CFyqelk X-Received: by 10.236.78.69 with SMTP id f45mr1425194yhe.9.1386961559300; Fri, 13 Dec 2013 11:05:59 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.73.69 with SMTP id j5ls1148669qev.48.gmail; Fri, 13 Dec 2013 11:05:59 -0800 (PST) X-Received: by 10.220.57.195 with SMTP id d3mr734109vch.15.1386961559147; Fri, 13 Dec 2013 11:05:59 -0800 (PST) Received: from mail-ve0-f178.google.com (mail-ve0-f178.google.com [209.85.128.178]) by mx.google.com with ESMTPS id tl2si1055650vdc.51.2013.12.13.11.05.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 11:05:59 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.178; Received: by mail-ve0-f178.google.com with SMTP id c14so1716455vea.9 for ; Fri, 13 Dec 2013 11:05:59 -0800 (PST) X-Received: by 10.52.0.174 with SMTP id 14mr90162vdf.86.1386961559074; Fri, 13 Dec 2013 11:05:59 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp61425vcz; Fri, 13 Dec 2013 11:05:58 -0800 (PST) X-Received: by 10.180.185.101 with SMTP id fb5mr4257281wic.11.1386961558112; Fri, 13 Dec 2013 11:05:58 -0800 (PST) Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com [209.85.212.176]) by mx.google.com with ESMTPS id gf20si62293wic.16.2013.12.13.11.05.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 11:05:58 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.176 is neither permitted nor denied by best guess record for domain of steve.capper@linaro.org) client-ip=209.85.212.176; Received: by mail-wi0-f176.google.com with SMTP id hq4so1547618wib.9 for ; Fri, 13 Dec 2013 11:05:57 -0800 (PST) X-Received: by 10.180.21.244 with SMTP id y20mr4248589wie.37.1386961557642; Fri, 13 Dec 2013 11:05:57 -0800 (PST) Received: from marmot.wormnet.eu (marmot.wormnet.eu. [188.246.204.87]) by mx.google.com with ESMTPSA id o9sm289604wib.10.2013.12.13.11.05.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Dec 2013 11:05:56 -0800 (PST) From: Steve Capper To: linux-arm-kernel@lists.infradead.org Cc: linux@arm.linux.org.uk, will.deacon@arm.com, catalin.marinas@arm.com, patches@linaro.org, robherring2@gmail.com, deepak.saxena@linaro.org, Steve Capper Subject: [RFC PATCH 2/6] arm: mm: Adjust the parameters for __sync_icache_dcache Date: Fri, 13 Dec 2013 19:05:42 +0000 Message-Id: <1386961546-10061-3-git-send-email-steve.capper@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1386961546-10061-1-git-send-email-steve.capper@linaro.org> References: <1386961546-10061-1-git-send-email-steve.capper@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: steve.capper@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Rather than take a pte_t as an input, break this down to the pfn and whether or not the memory is executable. This allows us to use this function for ptes and pmds. Signed-off-by: Steve Capper --- arch/arm/include/asm/pgtable.h | 6 +++--- arch/arm/mm/flush.c | 9 ++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h index 1571d12..1ffe488 100644 --- a/arch/arm/include/asm/pgtable.h +++ b/arch/arm/include/asm/pgtable.h @@ -225,11 +225,11 @@ static inline pte_t *pmd_page_vaddr(pmd_t pmd) #define pte_present_user(pte) (pte_present(pte) && (pte_val(pte) & L_PTE_USER)) #if __LINUX_ARM_ARCH__ < 6 -static inline void __sync_icache_dcache(pte_t pteval) +static inline void __sync_icache_dcache(unsigned long pfn, int exec); { } #else -extern void __sync_icache_dcache(pte_t pteval); +extern void __sync_icache_dcache(unsigned long pfn, int exec); #endif static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, @@ -238,7 +238,7 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, unsigned long ext = 0; if (addr < TASK_SIZE && pte_present_user(pteval)) { - __sync_icache_dcache(pteval); + __sync_icache_dcache(pte_pfn(pteval), pte_exec(pteval)); ext |= PTE_EXT_NG; } diff --git a/arch/arm/mm/flush.c b/arch/arm/mm/flush.c index 6d5ba9a..549a5e1 100644 --- a/arch/arm/mm/flush.c +++ b/arch/arm/mm/flush.c @@ -232,16 +232,15 @@ static void __flush_dcache_aliases(struct address_space *mapping, struct page *p } #if __LINUX_ARM_ARCH__ >= 6 -void __sync_icache_dcache(pte_t pteval) +void __sync_icache_dcache(unsigned long pfn, int exec) { - unsigned long pfn; struct page *page; struct address_space *mapping; - if (cache_is_vipt_nonaliasing() && !pte_exec(pteval)) + if (cache_is_vipt_nonaliasing() && !exec) /* only flush non-aliasing VIPT caches for exec mappings */ return; - pfn = pte_pfn(pteval); + if (!pfn_valid(pfn)) return; @@ -254,7 +253,7 @@ void __sync_icache_dcache(pte_t pteval) if (!test_and_set_bit(PG_dcache_clean, &page->flags)) __flush_dcache_page(mapping, page); - if (pte_exec(pteval)) + if (exec) __flush_icache_all(); } #endif