Received: by 2002:a05:7412:1703:b0:e2:908c:2ebd with SMTP id dm3csp3988120rdb; Wed, 30 Aug 2023 11:53:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGpJtyWcr3WSV9pyIvGGCYiUc+uhhcXbR9cTzXhDf4tR1+osjOuK3Mz8ALk3x/6wTx2FAKZ X-Received: by 2002:a17:902:ec8f:b0:1bc:8748:8bc0 with SMTP id x15-20020a170902ec8f00b001bc87488bc0mr3311925plg.33.1693421626528; Wed, 30 Aug 2023 11:53:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693421626; cv=none; d=google.com; s=arc-20160816; b=VNbdnKDJW7ZNUOQ3PVgOMwTDpyUshbSzysQrJGJAT3HYI0cxBNnlR4DzPheKyLKmcU bL6okiGcK+jYtYlVuLK0L2jrq6sWGyYgmJIG2t8vjECoCP1VkPcPXsC8jCRGPPfvoykC VR2lGzRbg94NRD67Js0Y8YeD33G6Hw/qEJ7xG+AVAOWl9YOxxC+kCCrJ+kL4RlvJUvB7 bpgy2uQzhX8tS7UXqWDiQiBZ8Bzy9qyugsMozxLH+haCG/P3VTOBwkrAAJ6T/6UbcMDk 0ZZOhdTLCqQnTopG7sT6WhxHckbYF6apcMMVGIvO66Xeh3j4HKBh7BrqNhEgH8WDm2jM ehCQ== 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:cc:to:subject:user-agent:mime-version:date:message-id; bh=NSR+zzvgubUNIqnWzFFc7RUUNHhVmYidZKxya0dClnA=; fh=EB7ksm96va31tlr6XN+i6GKaEW3HLKLv0WMEp3SO/WU=; b=TAD5lt7msGdyHWNjatpt7zUFaX6UfHP9r4CZ3IGKWTf4x2bvvWdQV0XDsWuXNQKjoB vAFyBmchd1jfM6rRfMIw1dqBVGxUqag1kpx83V6aUrTU3vLULHbgSk8+Sob9JmXDVnIW L2yNxLozkfQlqgWUmq97XzwTs6pK9vmekx6DssnC7VTzsX5jPVMokTHIlIMDbKXR+690 U2vaaRxtLvVmD322uB7M4Bf36l7TfvW1e2x94fEtNYksz6zbcLhV/6PW4ggQN8J+44BM 6ice0tY0FSUaTmoC/FQoNieihRi7et5tBIWTmVAPN6AnD0IZV7e/LDyeFKs8bR2v6F1V 166Q== 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 i15-20020a170902c94f00b001b9cdf11649si1818276pla.275.2023.08.30.11.53.24; Wed, 30 Aug 2023 11:53:46 -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 S243658AbjH3StR (ORCPT + 99 others); Wed, 30 Aug 2023 14:49:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242493AbjH3Iw2 (ORCPT ); Wed, 30 Aug 2023 04:52:28 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5B501CC9 for ; Wed, 30 Aug 2023 01:52:24 -0700 (PDT) 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 3CCFD2F4; Wed, 30 Aug 2023 01:53:03 -0700 (PDT) Received: from [10.57.3.66] (unknown [10.57.3.66]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BB9ED3F64C; Wed, 30 Aug 2023 01:52:22 -0700 (PDT) Message-ID: <034c226d-7d0f-849c-45ae-a909839a4d2e@arm.com> Date: Wed, 30 Aug 2023 09:52:21 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: [PATCH] coresight: tmc-etr: Don't fail probe when non-secure access is disabled To: Yabin Cui Cc: Mike Leach , James Clark , Leo Yan , Alexander Shishkin , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20230825233930.1875819-1-yabinc@google.com> <382193a4-4f30-d804-47da-a9c705b6bee5@arm.com> From: Suzuki K Poulose In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE 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 Hi Yabin On 29/08/2023 22:16, Yabin Cui wrote: >> How can this be enabled ? Why not enable it before probing the ETR ? > How can a user know if this has been done or not ? > > Pixel devices (like Pixel 6, 7) support enabling some debugging features > (including granting non-secure access to ETM/ETR) even on devices with > secure boot. It is only used internally and has strict requirements, > needing to connect to a server to verify identification after booting. > So it can't be established when probing ETR at device boot time. Are you not able to build the coresight drivers as modules and load them after the device has been authenticated and NS access enabled ? Running a trace session without NS access enabled on a normal device would be asking for trouble in the "normal world". Suzuki > > > On Sun, Aug 27, 2023 at 2:37 PM Suzuki K Poulose wrote: >> >> On 26/08/2023 00:39, Yabin Cui wrote: >>> Because the non-secure access can be enabled later on some devices. >> >> How can this be enabled ? Why not enable it before probing the ETR ? >> How can a user know if this has been done or not ? It is asking for >> trouble to continue without this. >> >> Suzuki >> >>> >>> Signed-off-by: Yabin Cui >>> --- >>> drivers/hwtracing/coresight/coresight-tmc-core.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/drivers/hwtracing/coresight/coresight-tmc-core.c b/drivers/hwtracing/coresight/coresight-tmc-core.c >>> index c106d142e632..5ebfd12b627b 100644 >>> --- a/drivers/hwtracing/coresight/coresight-tmc-core.c >>> +++ b/drivers/hwtracing/coresight/coresight-tmc-core.c >>> @@ -370,7 +370,7 @@ static int tmc_etr_setup_caps(struct device *parent, u32 devid, void *dev_caps) >>> struct tmc_drvdata *drvdata = dev_get_drvdata(parent); >>> >>> if (!tmc_etr_has_non_secure_access(drvdata)) >>> - return -EACCES; >>> + dev_warn(parent, "TMC ETR doesn't have non-secure access\n"); >>> >>> /* Set the unadvertised capabilities */ >>> tmc_etr_init_caps(drvdata, (u32)(unsigned long)dev_caps); >>