Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4919125ybl; Mon, 26 Aug 2019 18:52:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqy3s3Oc1v0MWAYrFWILKouwuCwQUrZRt0VEQQtRKQAoqE3SZIXfG5T7ahBZZu5cEpyMbjGR X-Received: by 2002:aa7:8193:: with SMTP id g19mr22951956pfi.16.1566870724109; Mon, 26 Aug 2019 18:52:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566870724; cv=none; d=google.com; s=arc-20160816; b=ixQ1dH2edDmPF+hS3I4AKsuhDzrMl+s0jqBB92BNvT5PKeo9CQKv1zq81Y/nDtrhwK NsQoAgOUpEyHWd13wbtszHmmjU25x7N4k61cfWOsIklPjHwx3lfdJBRYqDVvqCvb0FKW U6TlIfE1pRHesR0nlmE+iNcE6uqEYKQvEWQaoRPmUtcLH4yDIcO/HTk2rtJ2VU4ytNKx fu2K/2QhMhOIf1C0ZbMP23tDeejvuTtyGu81KZfJp2f6c/KYUz4G+9EXG1KkIYE+JUvB XymRrHhS+EhQvkDR6CZBG5hp2G+QQZypmuLztavVrp6op2FlfKNQQ5IBSVtxLcOq+UMF OQVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=6mAlmW3hA/qblRkV4f3sQHI6mlV3WPYldFbupoAXgho=; b=KHsCwKs4W7oY02ycxGSIxg8x0DH5Oga23N5F80LdA6T1mKtCbClWxIqc0jn5WzsYZM gpKl2TIWzwG1erBbfY2l9FWAZE4pvW48ESRz4TaBAcDQ1ea0fDOYjUxwIf+jICWhSWkb TTmzumHOga0uQCKEnPBu4e7sRrLhvC/SllFDAZKc+XGlLXy1vtL77lrGNPnGN5Uagrrb JQkie+kT5XqrK3CAg/7rd3Z+6w/SwD++XHYrZ+bvSP1HVBBjV2fyL+k6lebt1rRRmFQ2 wYNUotHqSkN4OlkPVjzbUM2zMSVBXSocCGsAxztUHBEn5Sfuz4bArSdF+fhT5DHKEuIU uXLQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e14si10321767pgg.442.2019.08.26.18.51.45; Mon, 26 Aug 2019 18:52:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728550AbfH0Buq (ORCPT + 99 others); Mon, 26 Aug 2019 21:50:46 -0400 Received: from bilbo.ozlabs.org ([203.11.71.1]:45317 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726487AbfH0Bup (ORCPT ); Mon, 26 Aug 2019 21:50:45 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 46HWzk4jRmz9s00; Tue, 27 Aug 2019 11:50:42 +1000 (AEST) From: Michael Ellerman To: Alastair D'Silva , alastair@d-silva.org Cc: stable@vger.kernel.org, Benjamin Herrenschmidt , Paul Mackerras , Thomas Gleixner , Greg Kroah-Hartman , Allison Randal , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] powerpc: Allow flush_(inval_)dcache_range to work across ranges >4GB In-Reply-To: <20190821001929.4253-1-alastair@au1.ibm.com> References: <20190821001929.4253-1-alastair@au1.ibm.com> Date: Tue, 27 Aug 2019 11:50:42 +1000 Message-ID: <875zmj4brh.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org "Alastair D'Silva" writes: > From: Alastair D'Silva > > The upstream commit: > 22e9c88d486a ("powerpc/64: reuse PPC32 static inline flush_dcache_range()") > has a similar effect, but since it is a rewrite of the assembler to C, is > too invasive for stable. This patch is a minimal fix to address the issue in > assembler. > > This patch applies cleanly to v5.2, v4.19 & v4.14. > > When calling flush_(inval_)dcache_range with a size >4GB, we were masking > off the upper 32 bits, so we would incorrectly flush a range smaller > than intended. > > This patch replaces the 32 bit shifts with 64 bit ones, so that > the full size is accounted for. > > Changelog: > v2 > - Add related upstream commit > > Signed-off-by: Alastair D'Silva > --- > arch/powerpc/kernel/misc_64.S | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Acked-by: Michael Ellerman cheers > diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S > index 1ad4089dd110..d4d096f80f4b 100644 > --- a/arch/powerpc/kernel/misc_64.S > +++ b/arch/powerpc/kernel/misc_64.S > @@ -130,7 +130,7 @@ _GLOBAL_TOC(flush_dcache_range) > subf r8,r6,r4 /* compute length */ > add r8,r8,r5 /* ensure we get enough */ > lwz r9,DCACHEL1LOGBLOCKSIZE(r10) /* Get log-2 of dcache block size */ > - srw. r8,r8,r9 /* compute line count */ > + srd. r8,r8,r9 /* compute line count */ > beqlr /* nothing to do? */ > mtctr r8 > 0: dcbst 0,r6 > @@ -148,7 +148,7 @@ _GLOBAL(flush_inval_dcache_range) > subf r8,r6,r4 /* compute length */ > add r8,r8,r5 /* ensure we get enough */ > lwz r9,DCACHEL1LOGBLOCKSIZE(r10)/* Get log-2 of dcache block size */ > - srw. r8,r8,r9 /* compute line count */ > + srd. r8,r8,r9 /* compute line count */ > beqlr /* nothing to do? */ > sync > isync > -- > 2.21.0