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=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 ABBA1C07E99 for ; Mon, 12 Jul 2021 10:41:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 769A56100C for ; Mon, 12 Jul 2021 10:41:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 769A56100C 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=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding: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:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=63zOzpyupb1A/aLhK+E8ynthxON07pmL5ja547yMslw=; b=b9p4SBoQyKVj1Z3jr5Lb1RhEQq IDSe742GjlvbQ85CtkZrqsepidvpyUZLjGFaKYfb4mwgc/Az5L/w4LGspVdlQPq4/hKmqpvWd3i0q 3iiC+tila4S4qjij5ov2B8Tnf9yOdIJy6C/bJifoACtMcZaLnQnXXuqXFDor60uxLBjInjGfwou+M dJDUc2JzT2YEBmAAb8DttmZAOBKuT9UMIezhH5RfOkXs0c5xnmQBnfzaDe0PGIT1qXBpUXaHiCFQp 9L12sLTPlrK0rNyvX1NbqtHfmiEvi5etfe/mLKWo3qJ5C8yIg+on47Y5KL0wn5/mEFB92fdO31fWI 0Yl+W0SQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m2tMQ-0070Oj-0W; Mon, 12 Jul 2021 10:40:26 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m2tMM-0070Nz-C4 for linux-arm-kernel@lists.infradead.org; Mon, 12 Jul 2021 10:40:23 +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 38BB81FB; Mon, 12 Jul 2021 03:40:18 -0700 (PDT) Received: from [10.57.35.32] (unknown [10.57.35.32]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3102F3F694; Mon, 12 Jul 2021 03:40:15 -0700 (PDT) Subject: Re: [PATCH v4 02/11] coresight: tmc-etr: Add barrier after updating AUX ring buffer To: Leo Yan , Arnaldo Carvalho de Melo , Adrian Hunter , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Thomas Gleixner , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Mathieu Poirier , Mike Leach , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org References: <20210711104105.505728-1-leo.yan@linaro.org> <20210711104105.505728-3-leo.yan@linaro.org> From: Suzuki K Poulose Message-ID: Date: Mon, 12 Jul 2021 11:40:12 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210711104105.505728-3-leo.yan@linaro.org> Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210712_034022_488978_E7F719E5 X-CRM114-Status: GOOD ( 20.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 11/07/2021 11:40, Leo Yan wrote: > Since a memory barrier is required between AUX trace data store and > aux_head store, and the AUX trace data is filled with memcpy(), it's > sufficient to use smp_wmb() so can ensure the trace data is visible > prior to updating aux_head. > > Signed-off-by: Leo Yan > --- > drivers/hwtracing/coresight/coresight-tmc-etr.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtracing/coresight/coresight-tmc-etr.c > index acdb59e0e661..713205db15a1 100644 > --- a/drivers/hwtracing/coresight/coresight-tmc-etr.c > +++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c > @@ -1563,6 +1563,14 @@ tmc_update_etr_buffer(struct coresight_device *csdev, > */ > if (etr_perf->snapshot) > handle->head += size; > + > + /* > + * It requires the ordering between the AUX trace data and aux_head > + * store, below smp_wmb() ensures the AUX trace data is visible prior > + * to updating aux_head. > + */ Please could we reword this a bit, something like : /* * Ensure that the AUX trace data is visible before the aux_head * is updated via perf_aux_output_end(), as expected by the * perf ring buffer. */ > + smp_wmb(); > + Reviewed-by: Suzuki K Poulose _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel