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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C53B6C433EF for ; Mon, 1 Nov 2021 15:30:06 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 7F9BC6058D for ; Mon, 1 Nov 2021 15:30:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7F9BC6058D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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=HKbIZkiHX+y7iy8+5eoFErsetcKeqz+uxmH3Nrj5/aU=; b=2SOjMgBOjpcHXH owerol+pF0LSQhc1bEHm1cp/znVOBnVRE9MQQr7NgFixFQJ79XP+n4ovpaPA4oa6nRCbluEEq+8xt xkMr/GXCTKB1spdlYUyrMdYbHbAJRhZi+B7IlX985oDJpdER20njc68wfdNV9ShyaqIKGKFZiIZzt JQzTFXskzl+wtY5gucTQqq61xzXzU34gNclXM5J406nBO0sEsGoDdulHKNgFLnGVdvE0VhLKkVAlb FxgHD431MOKwJjCqWNp9hAVLnZE9KatrBcNDmQoB6LYGu5tlScjuiTJTfaYjKuCFi6OIG/lbCXXD+ eV/zHuPElC2E7/TZOA6g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mhZEu-00GgcJ-QU; Mon, 01 Nov 2021 15:28:48 +0000 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mhZEr-00GgbG-7m for linux-arm-kernel@lists.infradead.org; Mon, 01 Nov 2021 15:28:46 +0000 Received: by mail-pj1-x1034.google.com with SMTP id gx15-20020a17090b124f00b001a695f3734aso264486pjb.0 for ; Mon, 01 Nov 2021 08:28:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=4nczZzPOROr/Kyy51BrycrxkeBsFlmOfWA3LpP384+8=; b=B8Z2fR33FZt++MnFctR1qPORvENn/ikeBgkvySxKjGFAVBKRckfbvj8w/pwET/S81l FKz8AYS5aaLNspjsDgpypoKbUE2O5wJ4B8nQ6dYUimjg/947Es3W7bLdQ4LycVaHOQLK rTFpdV04JIR48pIW4m+EIPcXZ45vNgVIjtROynE5Tp7yFOic/rygPsuLxqS0pwW+VeuB 7PkllgMKOp9vrY8rf9SOu5SY3XSHktDgJVusBF/LV4cL/Bs7uZ/f8Z0jTACUaVPRkIwm M0FzXZBtNB3uTP08iUGuiz63TtwDcgEfHuGNPsr6cLS3sTiWRDj3lItmUfQbe35aN8eB 3QLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=4nczZzPOROr/Kyy51BrycrxkeBsFlmOfWA3LpP384+8=; b=PVs4VEdrZbtvNg826fVyj2TjqkUfApdKGs+l/p+jci6iwYJB355Qd/t/G+FOYV7WJQ bGqW0JETFqGRka6D9sisN1lSd6dQci48PB+kLd+TwuKRRnY5L+CjFffjWq3uX3QnQDXa 4ZhLX7wUPOSC7zuy0bz2pZRfkgT4XUFryfpM+uY8/cLZGHNG5Rd5IKU1eqRDoDvFWa13 8e9h/YJsFLeRjBYqyH0Efy95rjIMyTvswhFQnTm3v/QXNn2ZQ5YRtrFK5LLOhW6yLMI0 6YYiaciUMEPAXPJAwhMKrkryIPCl7tv2w4DAdqArB66x9tjwNQN91VAwdH7Dx4U/kfNR z09w== X-Gm-Message-State: AOAM530mDqbogm4Nnb0I4HLgN6atT1a/KNL3JIYcnFJmZc5BVQMVngml dX7YZbj3i3M67mxcuE/U+pnXfQ== X-Google-Smtp-Source: ABdhPJw/46wh7WVg32S3b5SUGL+jz4NvUZ1xwsb2hzAEG92vkUqDXT5Ic1JNg+rvBW7cERoss/7a1w== X-Received: by 2002:a17:902:6b86:b0:13f:8d7a:397c with SMTP id p6-20020a1709026b8600b0013f8d7a397cmr26145198plk.50.1635780524336; Mon, 01 Nov 2021 08:28:44 -0700 (PDT) Received: from leoy-ThinkPad-X240s ([103.136.124.227]) by smtp.gmail.com with ESMTPSA id c21sm2974143pfv.119.2021.11.01.08.28.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Nov 2021 08:28:43 -0700 (PDT) Date: Mon, 1 Nov 2021 23:28:35 +0800 From: Leo Yan To: Kees Cook Cc: Catalin Marinas , 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: <20211101152835.GB375622@leoy-ThinkPad-X240s> References: <20211021134530.206216-1-leo.yan@linaro.org> <20211021134530.206216-5-leo.yan@linaro.org> <202110210848.35971643C6@keescook> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <202110210848.35971643C6@keescook> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211101_082845_304548_DD3AC45F X-CRM114-Status: GOOD ( 20.27 ) 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 Hi Catalin, Will, 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? - 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? Thanks, Leo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel