From patchwork Sun Jun 2 18:11:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Bottomley X-Patchwork-Id: 2649851 Return-Path: X-Original-To: patchwork-linux-parisc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 5CE63DFB78 for ; Sun, 2 Jun 2013 18:11:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755234Ab3FBSL5 (ORCPT ); Sun, 2 Jun 2013 14:11:57 -0400 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:41031 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755230Ab3FBSL5 (ORCPT ); Sun, 2 Jun 2013 14:11:57 -0400 Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id DB3048EE140; Sun, 2 Jun 2013 11:11:56 -0700 (PDT) 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 XcUKiphdgjnb; Sun, 2 Jun 2013 11:11:56 -0700 (PDT) Received: from [10.0.0.6] (c-24-18-112-117.hsd1.wa.comcast.net [24.18.112.117]) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id 67A5B8EE094; Sun, 2 Jun 2013 11:11:56 -0700 (PDT) Message-ID: <1370196715.1977.28.camel@dabdike.int.hansenpartnership.com> Subject: Re: [PATCH] parisc: Fix cache coherency for copy/clear_user_page operations From: James Bottomley To: John David Anglin Cc: linux-parisc List , Helge Deller , "James E.J. Bottomley" Date: Sun, 02 Jun 2013 11:11:55 -0700 In-Reply-To: <1370196125.1977.26.camel@dabdike.int.hansenpartnership.com> References: <1370196125.1977.26.camel@dabdike.int.hansenpartnership.com> X-Mailer: Evolution 3.8.2 Mime-Version: 1.0 Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org On Sun, 2013-06-02 at 11:02 -0700, James Bottomley wrote: > On Sun, 2013-06-02 at 12:09 -0400, John David Anglin wrote: > > As noted by James E.J. Bottomley, we need to purge the kernel TLB > > entries used when copying/clearing > > to user pages on PA 2.0 systems that require cache coherency. > > Otherwise, we generate inequivalent > > aliases and incorrect cache operation. > > What I meant was we have to remove the tmpalias tlb entry at the end of > the tmpalias operation. This means in the asm of pacache.S. Like the > patch below (untested because all my boxes are currently in a shipping > container on the docks at Seattle). Let's try with the patch this time 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/kernel/pacache.S b/arch/parisc/kernel/pacache.S index 36d7f40..9f0a377 100644 --- a/arch/parisc/kernel/pacache.S +++ b/arch/parisc/kernel/pacache.S @@ -686,6 +686,9 @@ ENTRY(copy_user_page_asm) */ addib,COND(>),n -1, %r1, 1b /* bundle 10 */ ldd 0(%r29), %r19 /* start next loads */ + /* move back to the page for the purges below */ + ldo -256(%r29), %r29 + ldo -256(%r28), %r28 #else ldi (PAGE_SIZE / 64), %r1 @@ -735,6 +738,19 @@ ENTRY(copy_user_page_asm) addib,COND(>) -1, %r1,1b ldo 64(%r29), %r29 + /* move back to the page for the purges below */ + ldo -128(%r28), %r28 + ldo -128(%r29), %r29 +#endif + +#ifdef CONFIG_PA20 + pdtlb,l 0(%r28) + pdtlb,l 0(%r29) +#else + tlb_lock %r20,%r21,%r22 + pdtlb 0(%r28) + pdtlb 0(%r29) + tlb_unlock %r20,%r21,%r22 #endif bv %r0(%r2) @@ -799,6 +815,7 @@ ENTRY(clear_user_page_asm) std %r0, 120(%r28) addib,COND(>) -1, %r1, 1b ldo 128(%r28), %r28 + ldo -256(%r28),%r28 /* move back to the same page */ #else /* ! CONFIG_64BIT */ ldi (PAGE_SIZE / 64), %r1 @@ -821,8 +838,17 @@ ENTRY(clear_user_page_asm) stw %r0, 60(%r28) addib,COND(>) -1, %r1, 1b ldo 64(%r28), %r28 + ldo -128(%r28),%r28 /* move back to the same page */ #endif /* CONFIG_64BIT */ +#ifdef CONFIG_PA20 + pdtlb,l 0(%r28) +#else + tlb_lock %r20,%r21,%r22 + pdtlb 0(%r28) + tlb_unlock %r20,%r21,%r22 +#endif + bv %r0(%r2) nop .exit