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 X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A520CC433E7 for ; Thu, 15 Oct 2020 08:58:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 141E3218AC for ; Thu, 15 Oct 2020 08:58:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="yF5dndax" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 141E3218AC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8D8BF6B007E; Thu, 15 Oct 2020 04:58:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 83A306B0080; Thu, 15 Oct 2020 04:58:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 72B326B0081; Thu, 15 Oct 2020 04:58:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0243.hostedemail.com [216.40.44.243]) by kanga.kvack.org (Postfix) with ESMTP id 39E766B007E for ; Thu, 15 Oct 2020 04:58:08 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id BBB8B180AD807 for ; Thu, 15 Oct 2020 08:58:07 +0000 (UTC) X-FDA: 77373557814.17.sound83_111652d27213 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin17.hostedemail.com (Postfix) with ESMTP id 9E633180D0184 for ; Thu, 15 Oct 2020 08:58:07 +0000 (UTC) X-HE-Tag: sound83_111652d27213 X-Filterd-Recvd-Size: 4390 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf31.hostedemail.com (Postfix) with ESMTP for ; Thu, 15 Oct 2020 08:58:06 +0000 (UTC) Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (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 544BC20BED; Thu, 15 Oct 2020 08:58:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602752285; bh=r1iinCCdcy2yWWZxUcnTvEcHKoN+v6ic5MXXjcnieUI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=yF5dndaxHAxJiVqKekVPJj4nnIzubOXjnKN1J7dLGJ/SHgxS5fppzyIHrctB6tJO8 3eDXomZzXHnEFCBNc7Xv+rS3jMLbzAfRaH4uN6GNCCiXpdmHaDDsOHLi/OI9J86aQk bth54DNQBV4aWrhKOvPyncP7sV4C7+i4N0c3e91A= Date: Thu, 15 Oct 2020 09:57:59 +0100 From: Will Deacon To: Peter Collingbourne Cc: Dave Martin , Catalin Marinas , linux-arch@vger.kernel.org, libc-alpha@sourceware.org, Szabolcs Nagy , Andrey Konovalov , Kevin Brodsky , linux-mm@kvack.org, Andrew Morton , Vincenzo Frascino , Linux ARM Subject: Re: [PATCH v9 29/29] arm64: mte: Add Memory Tagging Extension documentation Message-ID: <20201015085759.GA4790@willie-the-truck> References: <20200904103029.32083-1-catalin.marinas@arm.com> <20200904103029.32083-30-catalin.marinas@arm.com> <20200917081107.GA29031@willie-the-truck> <20200917090229.GA10662@gaia> <20200917161550.GA6642@arm.com> <20200918083046.GA30709@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Oct 14, 2020 at 04:43:23PM -0700, Peter Collingbourne wrote: > On Fri, Sep 18, 2020 at 1:30 AM Will Deacon wrote: > > I think so, yes. I'm hoping to queue it for 5.10, once I have an Ack from > > the Android tools side on the per-thread ABI. > > Our main requirement on the Android side is to provide an API for > changing the tag checking mode in all threads in a process while > multiple threads are running. I think we've been able to accomplish > this [1] by using a libc private real-time signal which is sent to all > threads. The implementation has been tested on FVP via the included > unit tests. The code has also been tested on real hardware in a > multi-threaded app process (of course we don't have MTE-enabled > hardware, so the implementation was tested on hardware by hacking it > to disable the tagged address ABI instead of changing the tag checking > mode, and then verifying via ptrace(PTRACE_GETREGSET) that the tagged > address ABI was disabled in all threads). > > That being said, as with any code at the nexus of concurrency and > POSIX signals, the implementation is quite tricky so I would say it > falls more into the category of "no obvious problems" than "obviously > no problems". It also relies on changes to the implementations of > pthread APIs so it wouldn't catch threads created directly via clone() > rather than via pthread_create(). I think we would be able to ignore > such threads on Android without causing compatibility issues because > we can require the process to not create threads via clone() before > calling the function. I imagine this may not necessarily work for > other libcs like glibc, though, but as I understand it glibc has no > plan to offer such an API. > > I feel confident enough in the kernel API though that I think that > it's reasonable as a starting point at least, and that if a problem > with the API is discovered I would expect it to be fixable by adding > new APIs, so: > > Acked-by: Peter Collingbourne Thanks, Peter. This series has already landed upstream, so I'm unable to add your Ack now, but the text above is very helpful. Cheers, Will > [1] https://android-review.googlesource.com/c/platform/bionic/+/1427377