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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 DFF83C433E0 for ; Wed, 13 May 2020 17:11:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3E9D6205CB for ; Wed, 13 May 2020 17:11:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3E9D6205CB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9307F80026; Wed, 13 May 2020 13:11:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8E2398000B; Wed, 13 May 2020 13:11:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7CF8780026; Wed, 13 May 2020 13:11:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0202.hostedemail.com [216.40.44.202]) by kanga.kvack.org (Postfix) with ESMTP id 668148000B for ; Wed, 13 May 2020 13:11:41 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 2CDD78248047 for ; Wed, 13 May 2020 17:11:41 +0000 (UTC) X-FDA: 76812337602.21.curve92_830ce79eb402b X-HE-Tag: curve92_830ce79eb402b X-Filterd-Recvd-Size: 3091 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Wed, 13 May 2020 17:11:40 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4431730E; Wed, 13 May 2020 10:11:39 -0700 (PDT) Received: from gaia (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6BF743F305; Wed, 13 May 2020 10:11:37 -0700 (PDT) Date: Wed, 13 May 2020 18:11:35 +0100 From: Catalin Marinas To: Luis Machado Cc: linux-arm-kernel@lists.infradead.org, Will Deacon , Vincenzo Frascino , Szabolcs Nagy , Richard Earnshaw , Kevin Brodsky , Andrey Konovalov , Peter Collingbourne , linux-mm@kvack.org, linux-arch@vger.kernel.org, Alan Hayward , Omair Javaid Subject: Re: [PATCH v3 19/23] arm64: mte: Add PTRACE_{PEEK,POKE}MTETAGS support Message-ID: <20200513171134.GE2719@gaia> References: <20200421142603.3894-1-catalin.marinas@arm.com> <20200421142603.3894-20-catalin.marinas@arm.com> <20200513104849.GC2719@gaia> <3d2621ac-9d08-53ea-6c22-c62532911377@linaro.org> <20200513141147.GD2719@gaia> 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, May 13, 2020 at 01:45:27PM -0300, Luis Machado wrote: > On 5/13/20 12:09 PM, Luis Machado wrote: > > Let me think about this for a bit. I'm trying to factor in the > > /proc//maps contents. If debuggers know which pages have PROT_MTE > > set, then we can teach the tools not to PEEK/POKE tags from/to those > > memory ranges, which simplifies the error handling a bit. > > I was checking the output of /proc//maps and it doesn't seem to contain > flags against which i can match PROT_MTE. It seems /proc//smaps is the > one that contains the flags (mt) for MTE. Am i missing something? You are right, the smaps is the one with the MTE information. > Is this the only place debuggers can check for PROT_MTE? If so, that's > unfortunate. /proc//smaps doesn't seem to be convenient for parsing. We can't change 'maps' as it's a pretty standard format with rwxp properties only. If you don't want to check any /proc file, just attempt to read the tags and check the ptrace return code. The downside is that you can't easily probe if a process is using MTE or not. But is this piece of information relevant? The gdb user should know what to look for (well, it's been a while since I used a debugger ;)). -- Catalin