From patchwork Tue Dec 22 16:51:50 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Fleming X-Patchwork-Id: 69302 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id nBMGnd9Z002921 for ; Tue, 22 Dec 2009 16:49:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751114AbZLVQti (ORCPT ); Tue, 22 Dec 2009 11:49:38 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750948AbZLVQti (ORCPT ); Tue, 22 Dec 2009 11:49:38 -0500 Received: from 124x34x33x190.ap124.ftth.ucom.ne.jp ([124.34.33.190]:45501 "EHLO master.linux-sh.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750801AbZLVQti (ORCPT ); Tue, 22 Dec 2009 11:49:38 -0500 Received: from localhost (unknown [127.0.0.1]) by master.linux-sh.org (Postfix) with ESMTP id E080E6375B; Tue, 22 Dec 2009 16:49:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at linux-sh.org Received: from master.linux-sh.org ([127.0.0.1]) by localhost (master.linux-sh.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rrAkfKTIHKd8; Wed, 23 Dec 2009 01:49:23 +0900 (JST) Received: from localhost (87-194-181-196.bethere.co.uk [87.194.181.196]) by master.linux-sh.org (Postfix) with ESMTP id E3CD26375A; Wed, 23 Dec 2009 01:49:22 +0900 (JST) Date: Tue, 22 Dec 2009 16:51:50 +0000 From: Matt Fleming To: "Pietrek, Markus" Cc: "linux-sh@vger.kernel.org" Subject: Re: Probably cache synchronization issue on SH7723 Message-ID: <20091222165150.GA7254@console-pimps.org> References: <20091204064759.GA13603@linux-sh.org> <95F51F4B902CAC40AF459205F6322F0133E18561C7@BMK019S01.emtrion.local> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <95F51F4B902CAC40AF459205F6322F0133E18561C7@BMK019S01.emtrion.local> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org diff --git a/arch/sh/mm/cache.c b/arch/sh/mm/cache.c index e9415d3..8460bbf 100644 --- a/arch/sh/mm/cache.c +++ b/arch/sh/mm/cache.c @@ -126,8 +126,9 @@ void __update_cache(struct vm_area_struct *vma, { struct page *page; unsigned long pfn = pte_pfn(pte); + int exec = (vma->vm_flags & VM_EXEC); - if (!boot_cpu_data.dcache.n_aliases) + if (!boot_cpu_data.dcache.n_aliases && !exec) return; page = pfn_to_page(pfn); @@ -136,7 +137,7 @@ void __update_cache(struct vm_area_struct *vma, if (dirty) { unsigned long addr = (unsigned long)page_address(page); - if (pages_do_alias(addr, address & PAGE_MASK)) + if (exec || pages_do_alias(addr, address & PAGE_MASK)) __flush_purge_region((void *)addr, PAGE_SIZE); } }