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 409BFC433DF for ; Thu, 15 Oct 2020 08:58:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DA7BF22250 for ; Thu, 15 Oct 2020 08:58:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602752286; bh=r1iinCCdcy2yWWZxUcnTvEcHKoN+v6ic5MXXjcnieUI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=IIej5U1rD/pMVDQI7aNR64gmm7A3DhU64LyGw2Jk+4zGv0EjX2+7ZN3rNgStkikGK pBJDsIBBR056VticVgeOMBI/ynggTgzAgLo6N9L8vyxQXPXY9gvRZq905VIWBam2v/ F/yUzkyq4boNbql+BboOetdQnoY9Zhml4VrNpRNs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388358AbgJOI6G (ORCPT ); Thu, 15 Oct 2020 04:58:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:35902 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388315AbgJOI6G (ORCPT ); Thu, 15 Oct 2020 04:58:06 -0400 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) Precedence: bulk List-ID: X-Mailing-List: linux-arch@vger.kernel.org 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 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.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 B11E6C433E7 for ; Thu, 15 Oct 2020 08:59:39 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2FE7020BED for ; Thu, 15 Oct 2020 08:59:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="SC1w+IFq"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="yF5dndax" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2FE7020BED Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject: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=ECtsJC4NbzTsLLXXeqBXWzK4AgtCIq5co6+GrDcvxzg=; b=SC1w+IFqci7txdSTBriJeU1Mi VU4AQ2VI+6E+wRlX1wm19crC6c+8lQ870PBv0r6IM6kE2GmZHnIi7PC3JNdivjQsJNsI59cIc/2lR LYqDP0D27BZzFbmICfKGJOljmDbS81c6Zj0DRpidezGn06ZDUy3mKtTSE7EnRhodKCg6OcxcWLi/9 EquRgdTgztKc66EnQwkX/tgfsECx0CHFMkgpaKNW9a2oCyY+nwjQoiEylj9ydnhF8KUZifpJWn4T8 VvHpNfxkNoxmcteTJYi3JJIXrWlv5+bLMyOR3I/xtiG7D7F2C6FEpjlQ9jH64YSwsJ5v1xu7bwUw2 p0pchWbpw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSz5N-0001vY-Si; Thu, 15 Oct 2020 08:58:09 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSz5K-0001uL-Mg for linux-arm-kernel@lists.infradead.org; Thu, 15 Oct 2020 08:58:07 +0000 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 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-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201015_045806_940033_328A7936 X-CRM114-Status: GOOD ( 26.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, libc-alpha@sourceware.org, Szabolcs Nagy , Catalin Marinas , Kevin Brodsky , linux-mm@kvack.org, Andrey Konovalov , Andrew Morton , Vincenzo Frascino , Dave Martin , Linux ARM 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 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel