Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp343530pxm; Fri, 25 Feb 2022 09:03:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJzyZCc2KWsOZgxPz9iofjo/1Cx5hoWkwh2Tw0ZsoNUb71vMbcP4hOjLd97eGOsDPNxzoD3F X-Received: by 2002:a65:6a13:0:b0:373:14f6:5d33 with SMTP id m19-20020a656a13000000b0037314f65d33mr6916441pgu.62.1645808591557; Fri, 25 Feb 2022 09:03:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645808591; cv=none; d=google.com; s=arc-20160816; b=lemV1GUaUYtJC11u5SgLt2b2xrSGUDx7MOVSnqK8JnAvOYD/6ZO5BKb5LbePhxXDiT UkvOjq5kLwbyXszhlZWd6+vK3OI9COjdcQpUpd6Nf0XLbFH6b7KbxHBwDv+14oT3QEsV ghvnzK6zkXCfGFwpCwX2iBPZc9xgciChPcGkfNV0/mEK6JXubdQlz+OKaeVQfUuvhxKm 2/QWh/F8lba+aV3tACDUjrtuc27p/eHY4RN7AM0nu28Yt7zOar/Si5LIasSjXmuDh8Sz DM4/3WJ/gc6u58yauMCR8Y+OhR9mnEtypnOCwcMBr3HZ5p52GlrZ9ym/4wM2ftc1r7Ts 0RPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:subject:user-agent:mime-version:date:message-id; bh=CuFenUoldgmuRwdXQGPrjaXta6ZBVvgVtZ9Lx1mTY1c=; b=y6eHYXu9aACSvJ7STNEe5tZp+flb5T/CcV0hwtiqpuEM31RpYsYk2q072Zza4aRVu+ SXFUmsI9m5KqxmsuHPXmL/VZaBRPK5N9D7dv6cnjt2fe5qelLitkG/bR1Cr2A0kjcnvi qO05axoJAw1q5D4GqcE91TsJXV3VbE2aoxQP6VCFvPbx4mb5J4RGFk/ZTzcPwyhgSu6d Vyg6yv1AM7z9AfpF8nS/KWgWivq3m3YSURra3K0HlF7pbScF9pmAO35SBT/0abjFi7p/ oy6mScopZTurat2rNDXWi85DHWLBLNDGsYAtTUFk45locrNh8dI79BYZiiphFsoQMFha LbHg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q196-20020a632acd000000b00372c870a694si2240451pgq.742.2022.02.25.09.02.54; Fri, 25 Feb 2022 09:03:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236514AbiBYNxF (ORCPT + 99 others); Fri, 25 Feb 2022 08:53:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231497AbiBYNxC (ORCPT ); Fri, 25 Feb 2022 08:53:02 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3316313859B for ; Fri, 25 Feb 2022 05:52:30 -0800 (PST) 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 F41BB106F; Fri, 25 Feb 2022 05:52:29 -0800 (PST) Received: from [10.57.90.208] (unknown [10.57.90.208]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D2AC33F5A1; Fri, 25 Feb 2022 05:52:28 -0800 (PST) Message-ID: <5f56c04f-f132-a200-4acc-7b151f7abce1@arm.com> Date: Fri, 25 Feb 2022 13:52:27 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: [PATCH v2 RESEND 0/4] coresight: etm: Correct PID tracing for non-root namespace To: Leo Yan , Mathieu Poirier , Mike Leach , Alexander Shishkin , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20220204152403.71775-1-leo.yan@linaro.org> From: Suzuki K Poulose In-Reply-To: <20220204152403.71775-1-leo.yan@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/02/2022 15:23, Leo Yan wrote: > If a profiling program runs in a non-root PID namespace and CoreSight > driver enables PID tracing (with contextID), it can lead to mismatching > issue between the context ID traced in hardware (from the root > namespace) and the PIDs gathered by profiling tool (e.g. perf) in its > non-root namespace. > > CoreSight driver has tried to address this issue for the contextID > related interfaces under sysfs, but it misses to prevent user to set > VMID (virtual contextID) for kernel runs in EL2 with VHE; furthermore, > it misses to handle the case when the profiling tool runs in the > non-root PID namespace. > > For this reason, this patch series is to correct contextID tracing for > non-root namespace. After applied this patchset, patch 02 doesn't > permit users to access virtual contextID via sysfs nodes in the non-root > PID namespace, patch 03 and 04 stop to trace PID packet for non-root PID > namespace. > > This patch series has been rebased on the mainline kernel and applied > cleanly on latest commit dcb85f85fa6f ("gcc-plugins/stackleak: Use > noinstr in favor of notrace"). > > > Leo Yan (4): > coresight: etm4x: Add lock for reading virtual context ID comparator > coresight: etm4x: Don't use virtual contextID for non-root PID > namespace > coresight: etm4x: Don't trace PID for non-root PID namespace > coresight: etm3x: Don't trace PID for non-root PID namespace > > .../coresight/coresight-etm3x-core.c | 4 +++ > .../coresight/coresight-etm4x-core.c | 10 +++++-- > .../coresight/coresight-etm4x-sysfs.c | 30 +++++++++++++++++++ > 3 files changed, 42 insertions(+), 2 deletions(-) > I have queued the series to coresight/next. Kind regards Suzuki