Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2543532pxb; Thu, 3 Feb 2022 08:45:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJwqN7XcV8252A3UZ6JsQxz7BHKynybXosnyrlrUs87jq+dbtXS0OGYAbDhjZ8F6OU0/IVRh X-Received: by 2002:a17:90a:7f81:: with SMTP id m1mr14646831pjl.157.1643906728484; Thu, 03 Feb 2022 08:45:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643906728; cv=none; d=google.com; s=arc-20160816; b=p+ntPEhAVJ3ZO543RVNl2X+dOUEn8a4Isb8snLWlTKFtNR3BIBcIK6Zseye+XuY5iO OZNHQ87x7nGf+KeEuR0bGqHTB2C4zoF9k01woLp0oT9ed/LTdb8e3TLZDE99TuzVnR/N GyjpigAHyBPvqXa37eRJijN1jwhc7KMrTzS3BAJaLWZiHFEdPQFVY3Y0fXgDUljaYl7E YXe/IdimXzMEshRyXiGk38Lg1cJXE3nLglgvZZYDMRHMKnwEWjtVe7R/usd66VxymAlZ Gf6TsbV86MUUXib/mwMAdmQuwEpfV0LBkXzgYzg9yj71AkK84kw5mi7ux4b5bhydHWXx hq4Q== 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=V0U8ZOxsenTC7+dFTxkhyzqN0PaKWtYljNWqnuidZZQ=; b=Satg1cGxQcLihk2bdeIooYFH2Km4bq1oWrjAFVuT2oyO111BNSvlrrWn8X/FqRCfL0 nDboN02fIl1kiR2xuI1a3mkvoluOdyYRlwSxtWvz84Bq1uQgl1IBuQKvGTNYF8SF1ebu UdPYqQ8/TYR1uja+XuDa9NE8pW/5fzREJB6RkGF+ugRQ8Eerg/qZPGZCtbV+/vB4KeQQ /I1AFgBk3UElPtpbLI5E/PLaHP8utq/aLWxNM68wzza8MrAWEopyBgvXrDzx7cm+1TJM aAcEVyHZ8TaNMj5K8BqK/GFzJbMoB1D90oz0ASqUzcIqhnHstJ3pjSlwxsQfuWvJH/Dw IQrQ== 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 o8si22689437pgv.112.2022.02.03.08.45.16; Thu, 03 Feb 2022 08:45:28 -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 S1350307AbiBCMVQ (ORCPT + 99 others); Thu, 3 Feb 2022 07:21:16 -0500 Received: from foss.arm.com ([217.140.110.172]:43552 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbiBCMVP (ORCPT ); Thu, 3 Feb 2022 07:21:15 -0500 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 B3C0211D4; Thu, 3 Feb 2022 04:21:14 -0800 (PST) Received: from [10.57.89.13] (unknown [10.57.89.13]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 74C233F774; Thu, 3 Feb 2022 04:21:13 -0800 (PST) Message-ID: <0cfe7af6-d401-b244-d508-9fcd35ebe07c@arm.com> Date: Thu, 3 Feb 2022 12:21:12 +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] coresight: trbe: Move check for kernelspace unmapped at EL0 to probe To: Sudeep Holla , Anshuman Khandual Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Mathieu Poirier , Mike Leach , Leo Yan , coresight@lists.linaro.org References: <20220201122212.3009461-1-sudeep.holla@arm.com> <01a43ba2-a633-f215-a688-2bda293b5a47@arm.com> <20220203101111.mx3o5kmo2bkjirn4@bogus> From: Suzuki K Poulose In-Reply-To: <20220203101111.mx3o5kmo2bkjirn4@bogus> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/02/2022 12:04, Sudeep Holla wrote: > On Thu, Feb 03, 2022 at 11:55:58AM +0530, Anshuman Khandual wrote: >> >> >> On 2/1/22 5:52 PM, Sudeep Holla wrote: >>> Currently with the check present in the module initialisation, it shouts >>> on all the systems irrespective of presence of coresight trace buffer >>> extensions. >> >> IIUC a system with CONFIG_CORESIGHT_TRBE enabled but without a TRBE DT >> i.e "arm,trace-buffer-extension" complains about kernel space unmapping >> at EL0 (even though it does not even really have TRBE HW to initialize). > > > Correct. Basically, this error will be seen on all systems(DT and ACPI) when > the module is compiled. It really doesn't matter if the system supports TRBE. > >>> >>> Similar to Arm SPE perf driver, move the check for kernelspace unmapping >>> when running at EL0 to the device probe instead of module initialisation. >> >> Makes sense. >> > > Thanks. > >>> >>> Cc: Mathieu Poirier >>> Cc: Suzuki K Poulose >>> Cc: Mike Leach >>> Cc: Leo Yan >>> Cc: Anshuman Khandual >>> Cc: coresight@lists.linaro.org >>> Signed-off-by: Sudeep Holla >>> --- >>> drivers/hwtracing/coresight/coresight-trbe.c | 10 +++++----- >>> 1 file changed, 5 insertions(+), 5 deletions(-) >>> >>> diff --git a/drivers/hwtracing/coresight/coresight-trbe.c b/drivers/hwtracing/coresight/coresight-trbe.c >>> index 276862c07e32..3fe2ce1ba5bf 100644 >>> --- a/drivers/hwtracing/coresight/coresight-trbe.c >>> +++ b/drivers/hwtracing/coresight/coresight-trbe.c >>> @@ -1423,6 +1423,11 @@ static int arm_trbe_device_probe(struct platform_device *pdev) >>> struct device *dev = &pdev->dev; >>> int ret; >>> >> >> Could you please add a similar comment like SPE driver regarding how >> the TRBE buffer will be inaccessible, if kernel gets unmapped at EL0 >> and trace capture will terminate. >> > > Sure I can add that. But if the device probe fails, will you be able to even > start the trace capture, sorry I didn't get what you mean by "trace capture > will terminate". I assume it must be "trace capture is not possible or not > allowed" IIUC. > "Trace capture is not possible with kernel page table isolation" is good enough. Thanks for making these changes Cheers Suzuki