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=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 DD3E4C388F7 for ; Tue, 10 Nov 2020 17:37:02 +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 654722076E for ; Tue, 10 Nov 2020 17:37:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="1OmpEyHJ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Fp2iAW1L" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 654722076E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=WmOKNUvzZcEtggXCJTua98j3p/7Uk1HML3UpG0CnRiM=; b=1OmpEyHJW1oCPNXTWL5XPrvTx zsKx1XLXVBxG2o1G1MeoAZJi3k9BzcpTn0gRJE+IGR17F4tDosJTf1Lztjd54wDkS1YRYUxNGzwEO Q2P1H4Nog2TDOQ/vaK66CpT4JkdYkdkDXLO5MPeudgJVAl2ZJZJCKmoV6gWuFmRAV+n140zI58bKg +ZBKoYoXygzCjgQUQzsSNvvt9pwHYOsNJbN9ElcdqRao2WeYIFoz8aXs1tC1RNsN0vrrYUxD+jNAG fXm0Zf/GnMoeNpXWNixdG3JUTm61NPInIMubNihucm9+x/ukzdcVC4YEZ7wAmWJy0gak4sjUYyuL+ I6OQpnjiA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcXYb-00059Z-HR; Tue, 10 Nov 2020 17:35:49 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcXYY-00058e-Q2 for linux-arm-kernel@lists.infradead.org; Tue, 10 Nov 2020 17:35:47 +0000 Received: by mail-pf1-x443.google.com with SMTP id w14so9441345pfd.7 for ; Tue, 10 Nov 2020 09:35:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ljtExNLhNJaAYqoAJq6NF87io9zaUPGQ4Epf6Wkqh/s=; b=Fp2iAW1L1WrQxhZpGMUIBhyXMlFi0afXkOidkQvgyrAm36yJx4DWIIerKk93f/abQU 2117o8ZPUzyzmK+5/UHfXIi7GZpnFEi44FD0W+Z7NgC+04PSeO+ToWDI6pwIE8lXOZ9l dmcHjcTrGrNCPMTnjfxQ3NLh+AA9CA48y4pIHIH/HNlQtv+VTKzrBkyLOvSW14hu0tMs 7e+EStdhooSREdyRtmuJxmgDAFXu42v8t/fdIijxwwXVHZxhC43IeKbYv7AsVf+C9PVb Zmjj7fGE93/V8GOX41bBK4D/+Q8rqQLgFZaB3nOGoncnnPCwEkodP1Uhc1p1lfigdj+c TR5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ljtExNLhNJaAYqoAJq6NF87io9zaUPGQ4Epf6Wkqh/s=; b=B3H5iM0tLDJKg8VlAB5jjfon3wNQ9+ere2QSzKpHU36j6PABWeCBrkwJ3RSIyhSVuX hBgujs7Q2w0lKO3W/gOf08bXzn7ANEeU58Cx/BsM2D11KWw0wgHlavZnSa9PkV+xzmEf 5qfFZILs3oYsfBDV3VZ3s+E4gtMfyADyg0uxGe/9cnKQsqAzpIPmyDOEQezSUHRf+zIT KaF0U/zTdr0CWSl2G6HQK+pY5o5Y5RGCkAasyEbWqLd2VpZGTkwmIxSIL2xbeaxPQ5Nw YfYqgs06C6a2l/kZBVkuOLHtsdj0gTCH9Bb7naVOfzA3y1LFDlvFLPNhUQV3IyCh52yz flcA== X-Gm-Message-State: AOAM533ID38LKj2shxZwfE3D8HqpnDReYEWSzqICMCumQi8vW0CwsgXt iGeQiOpJp7WxCLSRL1TsV1SjEw== X-Google-Smtp-Source: ABdhPJzhkbqCLmcN3UQpk2JbMbLrq19EgGLsZe/M+4oh7D4HYnAksRDgka66egyf/MQvmzcL/pVX7A== X-Received: by 2002:a62:1408:0:b029:18b:78d:4c4b with SMTP id 8-20020a6214080000b029018b078d4c4bmr18838266pfu.25.1605029744692; Tue, 10 Nov 2020 09:35:44 -0800 (PST) Received: from xps15 (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id q16sm14866210pff.114.2020.11.10.09.35.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2020 09:35:44 -0800 (PST) Date: Tue, 10 Nov 2020 10:35:42 -0700 From: Mathieu Poirier To: Suzuki K Poulose Subject: Re: [PATCH v3 22/26] coresight: etm4x: Add necessary synchronization for sysreg access Message-ID: <20201110173542.GC3429138@xps15> References: <20201028220945.3826358-1-suzuki.poulose@arm.com> <20201028220945.3826358-24-suzuki.poulose@arm.com> <20201109183255.GA3396611@xps15> <7370dc60-ca9c-7b58-0b56-6fcef628304f@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <7370dc60-ca9c-7b58-0b56-6fcef628304f@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201110_123546_876930_205059DC X-CRM114-Status: GOOD ( 30.53 ) 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: coresight@lists.linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, mike.leach@linaro.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Nov 10, 2020 at 10:11:23AM +0000, Suzuki K Poulose wrote: > On 11/9/20 6:32 PM, Mathieu Poirier wrote: > > On Wed, Oct 28, 2020 at 10:09:41PM +0000, Suzuki K Poulose wrote: > > > As per the specification any update to the TRCPRGCTLR must be synchronized > > > by a context synchronization event (in our case an explicist ISB) before > > > the TRCSTATR is checked. > > > > > > Cc: Mike Leach > > > Cc: Mathieu Poirier > > > Signed-off-by: Suzuki K Poulose > > > --- > > > drivers/hwtracing/coresight/coresight-etm4x-core.c | 13 +++++++++++++ > > > 1 file changed, 13 insertions(+) > > > > > > diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c > > > index e36bc1c722c7..4bc2f15b6332 100644 > > > --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c > > > +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c > > > @@ -178,6 +178,15 @@ static int etm4_enable_hw(struct etmv4_drvdata *drvdata) > > > /* Disable the trace unit before programming trace registers */ > > > etm4x_relaxed_write32(csa, 0, TRCPRGCTLR); > > > + /* > > > + * If we use system instructions, we need to synchronize the > > > + * write to the TRCPRGCTLR, before accessing the TRCSTATR. > > > + * See ARM IHI0064F, section > > > + * "4.3.7 Synchronization of register updates" > > > + */ > > > + if (!csa->io_mem) > > > + isb(); > > > + > > > > When I first read the documentation on system instruction section 4.3.7 really > > got me thinking... > > > > At the very top, right after the title "Synchronization of register updates" one > > can read "Software running on the PE...". Later in the text, when specifying > > the synchronisation rules, the term "trace analyzer" is used. _Typically_ a trace > > analyzer is an external box. > > > > Very good point. The trace analyzer could still use the system register > to program the ETM and causing a context synchronization event is tricky > from within the trace analyzer. And I agree that there is a bit of > confusion around the synchronization from a self-hosted point of view. > I believe this is true for the self-hosted case too and should be > clarified in the TRM. I think John has given us the final answer here - the current implementation stands. > > > Arm documentation is precise and usually doesn't overlook that kind of detail. > > The question is to understand if a context synchronisation event is also needed > > when programming is done on the PE. If so I think the documentation should be > > amended. > > > > In that case: > > > > Reviewed-by: Mathieu Poirier > > > > Thanks > Suzuki _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel