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 5EB9BC433F5 for ; Fri, 3 Dec 2021 18:31:21 +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=uf1W7OZf9H/alBE4wc5k+LeQ0xi5tYNhA8fiDeMBO5Y=; b=JOszYyo1UDGdh1 Y0rarKIoCIlGKK3qTrbd2dZx695ct6t7MsVlerMmmAs0BOdyJtJ1srKTO0ho7lbAE6VTIyUeeIX9b BQigwZUcukaQY8H43N5q9J8GzKWRBZ4t+InKITFfM4CZQ9T26tjzrstzBN+LWCeRgpiJxviNDVpzQ 0VJtZ8lUJ/nVQW7/Fh5cuG/rkFQaf54j9T1+uJPrrHLdJiVYRDXG/1dqZBzbcbcooPlqacl+dpxMi /JHbnzfZRAUQ6dULm2rPf8VZCvCJkX66nt5TYoPzXuPbf0IQsplMAZUn1wVxVNlhtYTMjncJKV6It 96QiS0JmRUlVeMUpwDYA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mtDJs-00Glhw-IV; Fri, 03 Dec 2021 18:30:04 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mtDJp-00GlhC-Nd for linux-arm-kernel@lists.infradead.org; Fri, 03 Dec 2021 18:30:03 +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 sin.source.kernel.org (Postfix) with ESMTPS id 1CE9ECE27F4; Fri, 3 Dec 2021 18:29:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11286C53FAD; Fri, 3 Dec 2021 18:29:51 +0000 (UTC) Date: Fri, 3 Dec 2021 18:29:48 +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: <20211108071149.823570-3-reijiw@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211203_103001_986473_78EF88BB X-CRM114-Status: GOOD ( 14.38 ) 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 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. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel