Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4419426ybl; Mon, 26 Aug 2019 10:09:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqwgYChyLLH2/5ZZLglT6y5NoTGaOw18plvx7A8SV0+wv3/F2rZV3O+UVlbnuiEBEfPPEVgF X-Received: by 2002:a17:902:a606:: with SMTP id u6mr19884403plq.224.1566839345360; Mon, 26 Aug 2019 10:09:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566839345; cv=none; d=google.com; s=arc-20160816; b=S5CFgBnhjt329qF+0igM/2LOlBxjOqgAg73q7sBTqFUmieCpiPqItAagKko54Jomhp kT9l9+19e2rYj0x0It3JQfvWG1sMJMSF7+/v6EVzud0KWzjCYgdGv1c1xMldymPh4GN/ axMuysT52XYRrQ02cZDydiULoV1oO2RYouCfG0iVCjfEnZqpV5ifxP8ES1jPLJPI4a8B xkTKTtzf5IiwT/V8GIyD7Bimzqin2jxQCXaAInVLBjeOi2x2M4dK2E82K8rcIpTR1x52 zxSFf7YCHe5d6iaXPq6gQ8pN9pP8+zLghBLl+OzgLiNtJaNFFIoTlu/CSSYgGHodocUn IgVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=EUaJkKl0PglEooc7Q/oLtFRrWaYL3w8r73WuMiow6Sg=; b=XPLDvtRP9WFlr8p7AOpxGRkYwcBzsqdFzk8r3nI2N1ffeleU65cq4C1+ZG48nnsGLW w3UbVZE4rv1m7IzuvTrr/smbirvh/noa0ivICQKo3z94MbakXpWMHIGMc2XRh3Pfe/vL NEIKMN89YD9l7nzJfak0Noor4GbSnCKgNB2iaNct3RkTjT1FNmcjS1YoPzWr5mIxeIlc TRotb+aeaUxK4eUw0a3lFfagO5a3WEgY5BRdGy0347h8VlrvRcC03e57ENNhfhTRvCTd Vah+XICB9nKTkFutZe5kpMYEWca3kI0Amy8U3KWue3gCseFQnh7rtZ+A0vyTNER4NCyr EImA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cch9Lkn0; 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 y190si11030646pfy.62.2019.08.26.10.08.49; Mon, 26 Aug 2019 10:09:05 -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; dkim=pass header.i=@kernel.org header.s=default header.b=cch9Lkn0; 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 S1733301AbfHZQuZ (ORCPT + 99 others); Mon, 26 Aug 2019 12:50:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:34474 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729338AbfHZQuY (ORCPT ); Mon, 26 Aug 2019 12:50:24 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8115420850; Mon, 26 Aug 2019 16:50:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566838224; bh=/JWCSqfQ4tLkHWbblH7A3gEnEXo0rRv/7eaJXLeukvg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cch9Lkn060b3M5FmvtgVjdEu4sANIukuEaOsZW26nUjq2HQapBYq+Lq5Gz3ePW+yE R11lIuSM3MdvIDMwXgn1YKD38sgh5DhwgH/GD8aReh8qV2Jq3RFmW0FSslu6OJEGuv V1w9lMprNWO+JqHsnsGBcFfzYceoq0Fo4Qpnw5Jo= Date: Mon, 26 Aug 2019 18:50:21 +0200 From: Greg Kroah-Hartman To: Alastair D'Silva Cc: alastair@d-silva.org, stable@vger.kernel.org, Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Thomas Gleixner , 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 Message-ID: <20190826165021.GB9305@kroah.com> References: <20190821001929.4253-1-alastair@au1.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190821001929.4253-1-alastair@au1.ibm.com> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 21, 2019 at 10:19:27AM +1000, Alastair D'Silva wrote: > 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(-) > > 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 I need an ack from the powerpc maintainer(s) before I can take this. thanks, greg k-h