From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 616C9C433F5 for ; Fri, 3 Dec 2021 18:54:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VIIwA1zSeGkpIDQz2Tntpnq/vbfXl4FRG8Wrz4oa/PM=; b=lHuQKGQWU+OUiz /if2z+wfEH8HeR1jiRPQdfx2Q0QHZJyLIUCoqPp0KGZlR5YJCVkwq81JPUyp2eu4xmyKEfbLCtWcR sYBErbkQGIAZsjR1HHF63itp0g9cAlrfp68Dd1bS524g+Z9SZ9RDsmEsFtgLyw1aeTuzK4cBU2rXf sthLTS6nmmhcNbNIsWkgGSF8VDo2gNBAwW/Tu1+2Et8YzKO+MOkNIgcxIhMdo7CbYUhvrtXUKn4Eg x4mbGP6KWCKjdIolKxapn+61PqOhhyE6rlLtVGXsjrmTyeK2QHpfyzH4UJNdJ15N4e5a8kTYpZCMI hYbrkJPNE1hO/0+5kXAw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mtDfD-00GnbJ-VR; Fri, 03 Dec 2021 18:52:08 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mtDf9-00Gnai-IH for linux-arm-kernel@lists.infradead.org; Fri, 03 Dec 2021 18:52:05 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 492EAB8291C; Fri, 3 Dec 2021 18:52:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BBAADC53FAD; Fri, 3 Dec 2021 18:51:58 +0000 (UTC) Date: Fri, 3 Dec 2021 18:51:55 +0000 From: Catalin Marinas To: Reiji Watanabe Cc: Will Deacon , Marc Zyngier , Robin Murphy , Mark Rutland , Peter Collingbourne , Evgenii Stepanov , linux-arm-kernel@lists.infradead.org, Peter Shier , Ricardo Koller , Oliver Upton , Jing Zhang , Raghavendra Rao Anata Subject: Re: [PATCH v2 2/2] arm64: mte: DC {GVA,GZVA} shouldn't be used when DCZID_EL0.DZP == 1 Message-ID: References: <20211108071149.823570-1-reijiw@google.com> <20211108071149.823570-3-reijiw@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211203_105203_762951_EB43F40D X-CRM114-Status: GOOD ( 17.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Dec 03, 2021 at 06:29:48PM +0000, Catalin Marinas wrote: > On Sun, Nov 07, 2021 at 11:11:49PM -0800, Reiji Watanabe wrote: > > diff --git a/arch/arm64/lib/mte.S b/arch/arm64/lib/mte.S > > index e83643b3995f..e62c048af337 100644 > > --- a/arch/arm64/lib/mte.S > > +++ b/arch/arm64/lib/mte.S > > @@ -43,17 +43,23 @@ SYM_FUNC_END(mte_clear_page_tags) > > * x0 - address to the beginning of the page > > */ > > SYM_FUNC_START(mte_zero_clear_page_tags) > > + and x0, x0, #(1 << MTE_TAG_SHIFT) - 1 // clear the tag > > mrs x1, dczid_el0 > > + tbnz x1, #4, 2f // Branch if DC GZVA is prohibited > > and w1, w1, #0xf > > mov x2, #4 > > lsl x1, x2, x1 > > - and x0, x0, #(1 << MTE_TAG_SHIFT) - 1 // clear the tag > > > > 1: dc gzva, x0 > > add x0, x0, x1 > > tst x0, #(PAGE_SIZE - 1) > > b.ne 1b > > ret > > + > > +2: stzg x0, [x0], #16 > > Nitpick: MTE_GRANULE_SIZE instead of 16. > > > + tst x0, #(PAGE_SIZE - 1) > > + b.ne 2b > > + ret > > SYM_FUNC_END(mte_zero_clear_page_tags) > > We can use stz2g here since we know it's always a PAGE_SIZE and an even > number of tag granules. I should have replied on v3. The comment is the same. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel