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 71087C433F5 for ; Fri, 22 Oct 2021 02:18:48 +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 31C8761390 for ; Fri, 22 Oct 2021 02:18:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 31C8761390 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=yieRxARdh0qMzAE0rpQ2TR4iF91JKcMJrSkjrQlbFNU=; b=AK+Bp8XORr5lCY 0Qd2RscRIuk0zwm6ts+T3CKYKXid9lBGiHC+zNl3k60nJ8loIlV2afTulJQdafNr2nr7tcBG7ZDc4 Q3DggbZYm+OViVwUjjSMH0b+iXW+QQEEiQWzmY9wVHgal3aKGZjiqgPivWryojQz8MJC1eU6di2+b JD7T+9ZJc7doaPWTKKqszj9cQ8MD9ryMAjwHSymm5p45Vi93z7NdNKysJ7dnPHZitIpnBGeA4EzMl pwExRksste1rkSPHZM8kZZdeYTCYNXVxAOjdTaWY5bxHBPdmoInld4sdgfUpHCpG69QqcjIue6vWh kZ/KxjO6m/89aggfEklA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mdk0F-009UAa-Fz; Fri, 22 Oct 2021 02:09:51 +0000 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mdk0B-009U9Z-Dl for linux-arm-kernel@lists.infradead.org; Fri, 22 Oct 2021 02:09:48 +0000 Received: by mail-pf1-x431.google.com with SMTP id t184so2352874pfd.0 for ; Thu, 21 Oct 2021 19:09:46 -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=PFGsuLal6rnfa1SPhGOuGktWo/AG5wMXOXb/yT4fb9o=; b=tEBX+PRGGc6vjjpkMGy1jlMeTMjq6o5Dnqsz6EqPIO9DMIXMVpLprp+zPrPJ81G5hV nC0sHedgEsp/LPx0m7v0fDpMcaTscRGlSbJYkTNGW8A9E/xsWkXekFe36ymRp1/lv39F 99FKi+LAMyRACejGd0ZtKdoMmGmPql8WN9a1TpQABI94UlWEdwCJxD/8mfVTiRDVgqpJ X1DQoB90YIwejvLWIDzvm4KNduzWm1uDKEaeRqn/3LZPqIukjirxgyiVDYzhWlyBhJNp 6U0wcDJzfyk+8OAdRTU3zy5UYPT+KtZBnzCsOLiC+yMiOcXdx7YNDGVujbK7Eodzngwt EYnw== 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=PFGsuLal6rnfa1SPhGOuGktWo/AG5wMXOXb/yT4fb9o=; b=a3pq5iTbHQ1VmGUZn58R/43eOS5rc+iFWRUITZv+OzH4jTeDCumSQc68hjWfrYk8qS RIA2AU1SmTrQHZ1uFY/UEE/qAk9gGQj9LDdgTdCAWSAtfGToI8hW6NJyfbzlTEoMeFxX XT3wavnlPVIz8LkAvuyw3AQEXm2xh1A53jTjIXAKuulOWZodul/Lzqmj4svdAhqQT5rl kmqfvgvG8ZO5oy3lo6HDGY78PctLrbZP/j8o+EvguR9zOgeJJ32qwN+rvkg8xG4wcKtu TbABEgPk1cRvZupqN1rmjO8fMI0ud9vq6dgoYtghK7GULW1z5vCUle3+5NND7EjoKnmy Lnfw== X-Gm-Message-State: AOAM530Y2Bsytt3t3wq2KYpcayIhgG0DNGINKg0AXSRtak9KZ7JX9yVQ 0TfXFnarno+FlJltZT+3g/dx3Q== X-Google-Smtp-Source: ABdhPJzsH227lOfiJON1+9Zk0eX5p4y2hobelEjoZ1Xqu/4ZVmubEPuI3aYcjAvyYwQijiKC76dQuQ== X-Received: by 2002:a05:6a00:1488:b0:44d:25b2:f80b with SMTP id v8-20020a056a00148800b0044d25b2f80bmr9698788pfu.20.1634868586039; Thu, 21 Oct 2021 19:09:46 -0700 (PDT) Received: from leoy-ThinkPad-X240s ([148.163.172.147]) by smtp.gmail.com with ESMTPSA id oo9sm7919695pjb.53.2021.10.21.19.09.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 19:09:45 -0700 (PDT) Date: Fri, 22 Oct 2021 10:09: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: <20211022020935.GB213960@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-20211021_190947_533549_04AB91EA X-CRM114-Status: GOOD ( 19.59 ) 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 Kees, 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. :) Yes, with your reminding I recognize that we can avoid the new helpers. Just remind, tracing PID in contextidr is not only used by Arm SPE driver, it will be used in Arm CoreSight driver as well. I plan to use a separate patch set to address Arm CoreSight (CoreSight driver misses to checking root PID namespace so need firstly fix that issue). Just give more info, so you and arm64 maintainers could judge we should use helpers or directly access static key. Thanks for your review! Leo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel