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 X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F5F2C433E0 for ; Sun, 10 Jan 2021 22:37:24 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 1918A229CA for ; Sun, 10 Jan 2021 22:37:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1918A229CA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=LlAxgZXaj0q0Hj+P7EVHU1BOUN4f6R79KQy58DAA4HA=; b=Z4lwukTyu+8Za8GYOpSPKgE4f z8Uw0AQLQlv2x//AxS/+iCjvTfBlfPoFwqwl6pDtoiO5cgn2v6tT6Q08o755Pr/j6Xj+32S4xWYfr AzieZw357FGjhUsCDQvbejZ6ooPaMwCbn6BCkviJZSsPB1RxYiMDjOk+NooLcUUqJDxe9Xc1SD+8m WCQn7JtktqoI1ShkxWPY5EaFTURdT3bGuuDUTXbozaZGAWoRfhM6zvghSS6kAuz4nLAFAujj7DbNh 0Ylp4dq+qMTp+1iaeG6O+SIFpMXlqVu2hqYDGoSBRlcwwvNZqk+f0GOUVCeVmk1TNTtaDWXbQ+k3C KfAnKE0kw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kyjIx-0003aQ-LR; Sun, 10 Jan 2021 22:35:23 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kyjIu-0003Yq-5E for linux-arm-kernel@lists.infradead.org; Sun, 10 Jan 2021 22:35:21 +0000 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 C7B35101E; Sun, 10 Jan 2021 14:35:09 -0800 (PST) Received: from [10.57.54.90] (unknown [10.57.54.90]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E452C3F719; Sun, 10 Jan 2021 14:35:06 -0800 (PST) Subject: Re: [PATCH] coresight: etm-perf: Add support for PID tracing for kernel at EL2 To: Leo Yan References: <202101091731.R1nMP6tg-lkp@intel.com> <20210110012430.1874799-1-suzuki.poulose@arm.com> <20210110014133.GA3776@leoy-ThinkPad-X240s> From: Suzuki K Poulose Message-ID: Date: Sun, 10 Jan 2021 22:34:57 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210110014133.GA3776@leoy-ThinkPad-X240s> Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210110_173520_375399_C42C3DB1 X-CRM114-Status: GOOD ( 17.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, Al Grant , lkp@intel.com, mathieu.poirier@linaro.org, alexander.shishkin@linux.intel.com, coresight@lists.linaro.org, john.garry@huawei.com, acme@kernel.org, peterz@infradead.org, mingo@redhat.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, mike.leach@linaro.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 1/10/21 1:41 AM, Leo Yan wrote: > Hi Suzuki, > > On Sun, Jan 10, 2021 at 01:24:30AM +0000, Suzuki Kuruppassery Poulose wrote: > > [...] > >> +static ssize_t format_attr_pid_show(struct device *dev, >> + struct device_attribute *attr, >> + char *page) >> +{ >> + int pid_fmt = ETM_OPT_CTXTID; >> + >> +#ifdef CONFIG_CORESIGHT_SOURCE_ETM4X >> + if (is_kernel_in_hyp_mode()) >> + pid_fmt = ETM_OPT_CTXTID_IN_VMID; >> +#endif > > I have a different idea for this. As Armv8 Arm describes: "The > Virtualization Host Extensions only apply to an implementation that > includes EL2 using AArch64.", seems to me it's more reasable to use > the condition "#ifdef CONFIG_64BIT", like below: > > #ifdef CONFIG_64BIT > if (is_kernel_in_hyp_mode()) > pid_fmt = ETM_OPT_CTXTID_IN_VMID; > #endif > > Please let me know if this is better or not. I will resend the patch > series after agreement. I did think of that. But CORESIGHT_SOURCE_ETM4X already depends on CONFIG_ARM64. So, that is more restrictive in terms of usage. And this wouldn't be the only build failure if someone tried enable ETM4X for arm32. So I wouldn't worry about someone trying to use ETM4X on arm32 accidentally. Cheers Suzuki _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel