Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp5515513rwb; Wed, 21 Sep 2022 08:48:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6XrxdDk7SxOkd1kExwRFyn5b0UlZnmD9fo/m42/3LeWgzq00uhqr0D9Ezkx54fyh7Puk0o X-Received: by 2002:a17:90b:1b50:b0:202:f495:6b43 with SMTP id nv16-20020a17090b1b5000b00202f4956b43mr10363472pjb.85.1663775286247; Wed, 21 Sep 2022 08:48:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663775286; cv=none; d=google.com; s=arc-20160816; b=FLsLfxqKKGUB7daVZdBKu7ZZigmuMv5SY5Np+zAWvt78GWjvEkz2NEi+MLDPhMQgq9 JINPhg0upT8kAFvCj9qetio67RbeNLLvE2Yn9CF0v9+Hl/y9xLG96suFW6XP93rVdo5W UuKJN6Co9uSQw8yMEiYEd/g/zBNLE/4UAp786Si2eaWFkmrFDPeFo397R9ixuKsc3lXI onm51RXsY4N04gkOC8UW/U7jLK7tJq6S+mQqAb9/3nSZSdaZgecw2reFQVaE5dxhekfR WserBmDyPcFFMMjOyasCIzFz4fBPD8tB1CyPjXdRge6xlwtKraTyD62jfWSk8AgkVR0G V8Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=vHh4vfB96bs9WmpDVoqZ0mp2W3/opdaP1x+Om2uLif8=; b=D9FQKH9pcSF7z4v85PWYNgp9oHZT7s2NTHqHKEHTo/8KyMsuhEj4xsmo+qI28yZ5+9 cUUjEwZ1UuWsCjoxlk971iKJLtFGKZg5lzYuv1R0ZBoVEIebYAKONM2HOFTURjMW+AqK 0KnrCHUCHSpLCTb1UJX41yG/o6yz6pkEMINcLj2iYYEUZi59tC4qBxlhLFAHQQughPPx VZy3CnAIBMKfHD6mRlCupzJIqOEpypX/UBX89XakEaCnj+DjwkgzpQlKbW+M/n9aysiN Q4rl9dZu8z4/ZizDc6GGDBJ1szCmYD+IvmxgEq2IkGJY+CpndKlAjAeF+QShX07qYM57 p4eg== 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 n22-20020a635c56000000b004227041e9d2si3050354pgm.405.2022.09.21.08.47.54; Wed, 21 Sep 2022 08:48:06 -0700 (PDT) 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 S230255AbiIUPId (ORCPT + 99 others); Wed, 21 Sep 2022 11:08:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230110AbiIUPIc (ORCPT ); Wed, 21 Sep 2022 11:08:32 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 010501403C for ; Wed, 21 Sep 2022 08:08:30 -0700 (PDT) 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 sin.source.kernel.org (Postfix) with ESMTPS id 8951CCE1CB6 for ; Wed, 21 Sep 2022 15:08:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49BB7C433B5; Wed, 21 Sep 2022 15:08:23 +0000 (UTC) Date: Wed, 21 Sep 2022 16:08:19 +0100 From: Catalin Marinas To: James Clark Cc: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, suzuki.poulose@arm.com, mathieu.poirier@linaro.org, mike.leach@linaro.org, leo.yan@linaro.org, broonie@kernel.org, linux-kernel@vger.kernel.org, Will Deacon , Mark Rutland Subject: Re: [PATCH 0/1] arm64: defconfig: Add Coresight as module Message-ID: References: <20220921140535.152627-1-james.clark@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220921140535.152627-1-james.clark@arm.com> X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS 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 Wed, Sep 21, 2022 at 03:05:34PM +0100, James Clark wrote: > As suggested by Catalin here's the change to add Coresight to defconfig. > > Unfortunately I don't think we should add CONFIG_CORESIGHT_SOURCE_ETM4X > which builds a few files until [1] is merged because of the overhead > of CONFIG_PID_IN_CONTEXTIDR. > > [1]: https://lore.kernel.org/lkml/20211021134530.206216-1-leo.yan@linaro.org/T/ I thought the overhead wasn't the problem, it's mostly negligible. We can probably save a few more cycles on the __switch_to() path by replacing several isb()s in those functions with a single one just before cpu_switch_to(). IIRC the issue is that unless a process runs in the root pid namespace, the actual pid written to contextidr is meaningless. Now that you reminded me of that thread, I see three options (sorry, not entirely related to the defconfig updates): 1. Remove CONFIG_PID_IN_CONTEXTIDR and corresponding code completely, find other events to correlate the task with the trace. 2. Always on CONFIG_PID_IN_CONTEXTIDR (we might as well remove the Kconfig entry). This would write the root pid namespace value (task_pid_nr()). 3. Similar to (2) but instead write task_pid_nr_ns(). An alternative here is to write -1 if the task is not in the root pid namespace. Strong preference for (1). -- Catalin