From patchwork Wed Feb 13 05:01:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Bottomley X-Patchwork-Id: 2134371 Return-Path: X-Original-To: patchwork-linux-parisc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id D9C1B3FCF6 for ; Wed, 13 Feb 2013 05:01:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750776Ab3BMFBi (ORCPT ); Wed, 13 Feb 2013 00:01:38 -0500 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:48161 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750712Ab3BMFBh (ORCPT ); Wed, 13 Feb 2013 00:01:37 -0500 Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id 366668EE0EB; Tue, 12 Feb 2013 21:01:35 -0800 (PST) Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yi-R7LDUULa6; Tue, 12 Feb 2013 21:01:35 -0800 (PST) Received: from [192.168.6.31] (unknown [194.186.187.194]) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id 62B958EE0DD; Tue, 12 Feb 2013 21:01:33 -0800 (PST) Message-ID: <1360731691.2544.15.camel@dabdike> Subject: [GIT PULL] parisc fixes for 3.8-rc7 From: James Bottomley To: Andrew Morton , Linus Torvalds Cc: Parisc List , linux-kernel Date: Wed, 13 Feb 2013 09:01:31 +0400 X-Mailer: Evolution 3.6.3 Mime-Version: 1.0 Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org This is a couple of patches, one to fix a broken build with HPUX compatibility and the other to solve a coherency problem we've been seeing in our TLB where setting a page read only occasionally fails to trigger a COW because of a stale writeable TLB entry. The patches are here: git://git.kernel.org/pub/scm/linux/kernel/git/jejb/parisc-2.6.git parisc-fixes The short changelog is: Geert Uytterhoeven (1): hpux: Remove obsolete regs parameter from do_execve() in hpux_execve() John David Anglin (1): Purge existing TLB entries in set_pte_at and ptep_set_wrprotect and the diffstat: arch/parisc/hpux/fs.c | 3 +-- arch/parisc/include/asm/pgtable.h | 13 ++++++++++--- arch/parisc/kernel/cache.c | 18 ++++++++++++++++++ 3 files changed, 29 insertions(+), 5 deletions(-) Full diff is attached below. James --- -- To unsubscribe from this list: send the line "unsubscribe linux-parisc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/parisc/hpux/fs.c b/arch/parisc/hpux/fs.c index a0760b8..838b479 100644 --- a/arch/parisc/hpux/fs.c +++ b/arch/parisc/hpux/fs.c @@ -43,8 +43,7 @@ int hpux_execve(struct pt_regs *regs) error = do_execve(filename->name, (const char __user *const __user *) regs->gr[25], - (const char __user *const __user *) regs->gr[24], - regs); + (const char __user *const __user *) regs->gr[24]); putname(filename); diff --git a/arch/parisc/include/asm/pgtable.h b/arch/parisc/include/asm/pgtable.h index ee99f23..7df49fa 100644 --- a/arch/parisc/include/asm/pgtable.h +++ b/arch/parisc/include/asm/pgtable.h @@ -12,11 +12,10 @@ #include #include +#include #include #include -struct vm_area_struct; - /* * kern_addr_valid(ADDR) tests if ADDR is pointing to valid kernel * memory. For the return value to be meaningful, ADDR must be >= @@ -40,7 +39,14 @@ struct vm_area_struct; do{ \ *(pteptr) = (pteval); \ } while(0) -#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) + +extern void purge_tlb_entries(struct mm_struct *, unsigned long); + +#define set_pte_at(mm, addr, ptep, pteval) \ + do { \ + set_pte(ptep, pteval); \ + purge_tlb_entries(mm, addr); \ + } while (0) #endif /* !__ASSEMBLY__ */ @@ -466,6 +472,7 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, old = pte_val(*ptep); new = pte_val(pte_wrprotect(__pte (old))); } while (cmpxchg((unsigned long *) ptep, old, new) != old); + purge_tlb_entries(mm, addr); #else pte_t old_pte = *ptep; set_pte_at(mm, addr, ptep, pte_wrprotect(old_pte)); diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c index 48e16dc..b89a85a 100644 --- a/arch/parisc/kernel/cache.c +++ b/arch/parisc/kernel/cache.c @@ -419,6 +419,24 @@ void kunmap_parisc(void *addr) EXPORT_SYMBOL(kunmap_parisc); #endif +void purge_tlb_entries(struct mm_struct *mm, unsigned long addr) +{ + unsigned long flags; + + /* Note: purge_tlb_entries can be called at startup with + no context. */ + + /* Disable preemption while we play with %sr1. */ + preempt_disable(); + mtsp(mm->context, 1); + purge_tlb_start(flags); + pdtlb(addr); + pitlb(addr); + purge_tlb_end(flags); + preempt_enable(); +} +EXPORT_SYMBOL(purge_tlb_entries); + void __flush_tlb_range(unsigned long sid, unsigned long start, unsigned long end) {