From patchwork Sun Apr 11 22:25:54 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John David Anglin X-Patchwork-Id: 91933 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3BMPw1Z015449 for ; Sun, 11 Apr 2010 22:25:59 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753099Ab0DKWZ6 (ORCPT ); Sun, 11 Apr 2010 18:25:58 -0400 Received: from hiauly1.hia.nrc.ca ([132.246.100.193]:3329 "EHLO hiauly1.hia.nrc.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753010Ab0DKWZ6 (ORCPT ); Sun, 11 Apr 2010 18:25:58 -0400 Received: by hiauly1.hia.nrc.ca (Postfix, from userid 1000) id A6C6E5057; Sun, 11 Apr 2010 18:25:55 -0400 (EDT) Date: Sun, 11 Apr 2010 18:25:54 -0400 From: John David Anglin To: Helge Deller Cc: John David Anglin , "Carlos O'Donell" , gniibe@fsij.org, linux-parisc@vger.kernel.org Subject: Re: threads and fork on machine with VIPT-WB cache Message-ID: <20100411222554.GA10147@hiauly1.hia.nrc.ca> Reply-To: John David Anglin References: <20100408215453.GA18445@hiauly1.hia.nrc.ca> <20100408224446.96F294FA3@hiauly1.hia.nrc.ca> <20100409151330.GA23889@hiauly1.hia.nrc.ca> <4BC0E3AD.4050802@gmx.de> <20100410225355.GA2812@hiauly1.hia.nrc.ca> <4BC219F7.5020204@gmx.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4BC219F7.5020204@gmx.de> Organization: nrc.ca User-Agent: Mutt/1.5.16 (2007-06-09) Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sun, 11 Apr 2010 22:25:59 +0000 (UTC) diff --git a/arch/parisc/include/asm/pgtable.h b/arch/parisc/include/asm/pgtable.h index a27d2e2..e85f43c 100644 --- a/arch/parisc/include/asm/pgtable.h +++ b/arch/parisc/include/asm/pgtable.h @@ -14,6 +14,7 @@ #include #include #include +extern void flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr, unsigned long pfn); /* * kern_addr_valid(ADDR) tests if ADDR is pointing to valid kernel @@ -456,7 +457,7 @@ static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, return old_pte; } -static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep) +static inline void ptep_set_wrprotect(struct vm_area_struct *vma, struct mm_struct *mm, unsigned long addr, pte_t *ptep) { #ifdef CONFIG_SMP unsigned long new, old; @@ -469,6 +470,8 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t old_pte = *ptep; set_pte_at(mm, addr, ptep, pte_wrprotect(old_pte)); #endif + + flush_cache_page(vma, addr, pte_pfn(*ptep)); } #define pte_same(A,B) (pte_val(A) == pte_val(B))