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 25A77ECAAA1 for ; Mon, 31 Oct 2022 13:50:04 +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:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=doqxxM6HSthoSBCljHIbIbbiD9bVLDBKwZCzDkZvnPM=; b=FHkzHJey9GnhML kxQEjNewlw6xQmEXaFssBXve3LroUs22Iln7UYoH4UjDSazlX8s1Qrau7GLwUAkCMozTUHCrtMKvc Gk20FL9OiOTKh6rhFTygoGtYM/GIsFyS2K9RCIDsV7rwVsTUgoy+gzEmkeX7W5KI02r2agrdNMuii Eid9+SS2DFwkZiIZX70xauacH6qKUAzdMr/Spi2m7QX6ymP9eXn+rOnCwnHHRaIUPXKA67+Afvhfc F8Wc0pTktm5IJEi1vGv7WSdNObmDy2zRNhOHRpOugpsrd6DMpLPU9pLBPYxAZKUwvAncaChuKz95W Mrh2LB1vtW/MASzfYcvQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1opVA4-00C8LO-Mk; Mon, 31 Oct 2022 13:49:08 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1opVA0-00C8KV-VO for linux-arm-kernel@lists.infradead.org; Mon, 31 Oct 2022 13:49:06 +0000 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 1FE921FB; Mon, 31 Oct 2022 06:49:06 -0700 (PDT) Received: from [10.57.3.132] (unknown [10.57.3.132]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A0BDC3F5A1; Mon, 31 Oct 2022 06:48:57 -0700 (PDT) Message-ID: <133c2f4b-1ca5-2d0c-f4f4-e01ff5e028c8@arm.com> Date: Mon, 31 Oct 2022 13:48:56 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH v2 1/1] perf arm64: Send pointer auth masks to ring buffer Content-Language: en-US To: Peter Zijlstra Cc: linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, broonie@kernel.org, acme@kernel.org, Andrew Kilroy , Vince Weaver , Mark Rutland , Ingo Molnar , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Will Deacon , Catalin Marinas , kristina.martsenko@arm.com References: <20221020101921.1219533-1-james.clark@arm.com> <20221020101921.1219533-2-james.clark@arm.com> <4e50b890-0588-1551-fb7c-6cd8191d1054@arm.com> From: James Clark In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221031_064905_102727_E4A1BED6 X-CRM114-Status: GOOD ( 19.92 ) 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 27/10/2022 18:20, Peter Zijlstra wrote: > On Tue, Oct 25, 2022 at 04:28:12PM +0100, James Clark wrote: > >>> Why do we want the same mask repeated over and over with each sample; >>> should this not be part of the address space (side-band) data? >> >> You are probably right that it could be done that way. The reason that >> we did it this way was to be consistent with ptrace feature [1] where it >> is delivered to userspace on a per-process basis. And there is also a >> prctl for the enabled key types [2] which can be changed dynamically. >> Particularly for the last reason is why it was done per sample. >> >> Having said that, the enabled keys field is not used by perf, only the >> mask is used, so I can drop the per sample data until enabled keys is >> needed, which may be never. >> >> I'm going to assume that perf shouldn't use ptrace because of >> permissions and conflicts with debuggers, so I could put the mask >> somewhere like PERF_RECORD_FORK instead of per sample. > > Yeah, or create an new RECORD type which you can also send around at > prctl() time. > > The only thing that's needed on top of that is exposing the mask > somewhere in /proc for existing tasks; which is what perf also uses to > syntesize RECORD_MMAP events on startup etc.. > Hmm ok, in that case I can just add the /proc interface for now because the mask won't change and we can add the new record type at the point it's needed in the future. Thanks for the feedback. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel