From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Collingbourne Subject: Re: [PATCH v4 11/26] arm64: mte: Add PROT_MTE support to mmap() and mprotect() Date: Wed, 27 May 2020 11:57:39 -0700 Message-ID: References: <20200515171612.1020-1-catalin.marinas@arm.com> <20200515171612.1020-12-catalin.marinas@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20200515171612.1020-12-catalin.marinas@arm.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane-mx.org@lists.infradead.org To: Catalin Marinas Cc: linux-arch@vger.kernel.org, Szabolcs Nagy , Andrey Konovalov , Kevin Brodsky , linux-mm@kvack.org, Evgenii Stepanov , Vincenzo Frascino , Will Deacon , Dave P Martin , Linux ARM List-Id: linux-arch.vger.kernel.org On Fri, May 15, 2020 at 10:16 AM Catalin Marinas wrote: > > To enable tagging on a memory range, the user must explicitly opt in via > a new PROT_MTE flag passed to mmap() or mprotect(). Since this is a new > memory type in the AttrIndx field of a pte, simplify the or'ing of these > bits over the protection_map[] attributes by making MT_NORMAL index 0. Should the userspace stack always be mapped as if with PROT_MTE if the hardware supports it? Such a change would be invisible to non-MTE aware userspace since it would already need to opt in to tag checking via prctl. This would let userspace avoid a complex stack initialization sequence when running with stack tagging enabled on the main thread. Peter From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: MIME-Version: 1.0 References: <20200515171612.1020-1-catalin.marinas@arm.com> <20200515171612.1020-12-catalin.marinas@arm.com> In-Reply-To: <20200515171612.1020-12-catalin.marinas@arm.com> From: Peter Collingbourne Date: Wed, 27 May 2020 11:57:39 -0700 Message-ID: Subject: Re: [PATCH v4 11/26] arm64: mte: Add PROT_MTE support to mmap() and mprotect() Content-Type: text/plain; charset="UTF-8" Sender: owner-linux-mm@kvack.org To: Catalin Marinas Cc: Linux ARM , linux-mm@kvack.org, linux-arch@vger.kernel.org, Will Deacon , Dave P Martin , Vincenzo Frascino , Szabolcs Nagy , Kevin Brodsky , Andrey Konovalov , Evgenii Stepanov List-ID: Message-ID: <20200527185739.yUeB4wEu3o-U-vL-v5x2LYRWDphbYevnVh0OS7WzVH0@z> On Fri, May 15, 2020 at 10:16 AM Catalin Marinas wrote: > > To enable tagging on a memory range, the user must explicitly opt in via > a new PROT_MTE flag passed to mmap() or mprotect(). Since this is a new > memory type in the AttrIndx field of a pte, simplify the or'ing of these > bits over the protection_map[] attributes by making MT_NORMAL index 0. Should the userspace stack always be mapped as if with PROT_MTE if the hardware supports it? Such a change would be invisible to non-MTE aware userspace since it would already need to opt in to tag checking via prctl. This would let userspace avoid a complex stack initialization sequence when running with stack tagging enabled on the main thread. Peter