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 7F18AC433F5 for ; Fri, 3 Dec 2021 16:24:22 +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:MIME-Version:References: Message-ID:Subject:Cc: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=UKaVaXgk7m9j4ckivgfDm/Scell385ebCLreqnyAOU8=; b=EjUP7uos97L0VH kxiSQ5BkKjRpQCx6qYg5GVtlb0yBc6igGIpjDQjUPj1isNrOGnSmFyC2IY6Jh7CbzpBJyu6EvDnHy jJF/gydrX0lt4A14P+cSeHXaViGzZiRVi6MB3KRrAa9AvQkRR7sWprSf82/s1HQApTpRlWOrWpVQM H9ZUJ4Jvq55KH4isrJ8nR38L9u3DqeyBM7NrTp6p0GnPo2HLkepOn3Vb1K6OHj+vNuw3cg26lbv6p TObl3q09Hmfe5PSJvIqztVQFGYX5Pa8wsqAiXLEiAxibfshHr9wNTGL+H9JWP8yAceo0fMSaWJbQg y1LECxON1hQfxy99NsfQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mtBKx-00GV6y-9a; Fri, 03 Dec 2021 16:23:03 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mtBKm-00GV3d-Ao for linux-arm-kernel@lists.infradead.org; Fri, 03 Dec 2021 16:22:53 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 23BEC62C1F; Fri, 3 Dec 2021 16:22:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7AF6FC53FAD; Fri, 3 Dec 2021 16:22:46 +0000 (UTC) Date: Fri, 3 Dec 2021 16:22:42 +0000 From: Catalin Marinas To: Leo Yan Cc: Kees Cook , Will Deacon , Mark Rutland , Ard Biesheuvel , Sami Tolvanen , Nicholas Piggin , James Morse , Marc Zyngier , Joey Gouly , Peter Collingbourne , Vincenzo Frascino , "Peter Zijlstra (Intel)" , Stephane Eranian , James Clark , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [RFCv1 4/4] perf: arm_spe: Dynamically switch PID tracing to contextidr Message-ID: References: <20211021134530.206216-1-leo.yan@linaro.org> <20211021134530.206216-5-leo.yan@linaro.org> <202110210848.35971643C6@keescook> <20211101152835.GB375622@leoy-ThinkPad-X240s> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211101152835.GB375622@leoy-ThinkPad-X240s> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211203_082252_428570_7E270F2C X-CRM114-Status: GOOD ( 28.62 ) 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 Mon, Nov 01, 2021 at 11:28:35PM +0800, Leo Yan wrote: > On Thu, Oct 21, 2021 at 08:49:46AM -0700, Kees Cook wrote: > > On Thu, Oct 21, 2021 at 09:45:30PM +0800, Leo Yan wrote: > > > Now Arm64 provides API for enabling and disable PID tracing, Arm SPE > > > driver invokes these functions to dynamically enable it during > > > profiling when the program runs in root PID name space, and disable PID > > > tracing when the perf event is stopped. > > > > > > Device drivers should not depend on CONFIG_PID_IN_CONTEXTIDR for PID > > > tracing, so this patch uses the consistent condition for setting bit > > > EL1_CX for PMSCR. > > > > My own preference here would be to not bother with the new > > enable/disable helpers, but just open code it right here. (Save a patch > > and is the only user.) But I defer to the taste of arm64 maintainers. :) > > Before I send out a new version for this patch set (for support > dynamic PID tracing on Arm64), I'd like to get your opinions for two > things: > > - Firstly, as Kees suggested to directly use variable > 'contextidr_in_use' in drivers, which is exported as GPL symbol, > it's not necessarily to add two helpers contextidr_{enable|disable}(). > What's your preference for this? My preference would be to keep the helpers. > - Secondly, now this patch set only support dynamic PID tracing for > Arm64; and there would be two customers to use dynamic PID tracing: > Arm SPE and Coresight ETMv4.x. So this patch set doesn't support > dynamic PID tracing for Arm32 (under arch/arm). > > Do you accept this patch set for enabling PID tracing on Arm64 and we > can defer to support Arm32 when really need PID tracing on Arm32? > Or we should enable PID dynamic tracing for Arm64 and Arm32 in one > go? If it doesn't break arm32, it's fine by me. What's the cost of always enabling CONFIG_PID_IN_CONTEXTIDR? If it's negligible, I'd not bother at all with any of the enabling/disabling. Another question: can you run multiple instances of SPE for different threads on different CPUs? What happens to the global contextidr_in_use key when one of them stops? -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel