Message ID | 20210704071644.107397-3-leo.yan@linaro.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=H7S8=L4=lists.infradead.org=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@kernel.org> 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=-18.2 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,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT 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 65B03C07E95 for <linux-arm-kernel@archiver.kernel.org>; Sun, 4 Jul 2021 07:20:25 +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 3846461879 for <linux-arm-kernel@archiver.kernel.org>; Sun, 4 Jul 2021 07:20:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3846461879 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=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LBGHnhE+zRJI1qPjd2jcqywIU2jUE5MQeyFi9Wr7E+c=; b=NBanjjI8PVytZ8 XIMKdXB1eoBE8nzOe2NmSGujcjWxpiwDJZIJ7DGLP00acBqKRRDoqpHiuddtzjGFb1L7zOy62CBhk tuBBpm6C35RHDq/SkRRR9zb0jC6ELh5r3z8MoDerOJ6lCgKnyWhNS5V1qjMyxUyHIAN8xTHjEzaoR Oq2vZseoXJYfUdfkD0hxXMM0x54kguueAMAPBTzovhL5INq4XFAB8nzMqomC3qccco7WtJOaIsOBn /rv/U5DVejKruLdI1ccUTnJn1EEHYiAjKnzTuJwppwBrofHUqM5/2mamgK+PBuZjBY9qMuikc8ojB hUZH/6GzjdM8fNvNtksg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzwNi-005rSU-N5; Sun, 04 Jul 2021 07:17:34 +0000 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzwNN-005rLY-Uk for linux-arm-kernel@lists.infradead.org; Sun, 04 Jul 2021 07:17:15 +0000 Received: by mail-pj1-x1033.google.com with SMTP id x21-20020a17090aa395b029016e25313bfcso9403660pjp.2 for <linux-arm-kernel@lists.infradead.org>; Sun, 04 Jul 2021 00:17:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tvAJvuDnRJDe9YMY5R2L+q2C0nSKQeIr4jFz4M7hp0E=; b=TZxJVJis8rrNqPFI2hPub+IQfdfSZOkJvS/N4Qc2wxUB09wr1MfwYw1dKN+vYgsgxl +Mw6TONqRDqKeND/1XROo+0oJBqtXUbdgINfQoBXo4dBxDewpTNZdUI9j/6aKcpmSgM3 iHoBfBgzdrgEKW1w9eEw/yo9n68nOGSRzFaBYfz8+xj/UsFgdQdIuyIyhKsFcFBvK5SS hZGglCMveOrpWRvzb2l4gaI6UDMU6bnGi4zzkAtZoFuJzYDoxDBKV9iIQIPDWg7q21uf 79funWYO59ZfD/q9HuDmV5JenmxPZK414wjMSav5wpCdUR0h+ZPJ/O0vA1pfYA7sRXcx +chw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tvAJvuDnRJDe9YMY5R2L+q2C0nSKQeIr4jFz4M7hp0E=; b=Fvyszfbl78ki/v9cmFMZXrI+j9MsUUX+VwiBPZMoaHnOpyR6FNzrAHClWTCme5PO7z /JkBrmKTuv/RYpFzTFko9zXjCLUUqj+rB3hEd8Di4SA9AvemAoT1Er2vMK55A8gtO56y YwRnpU0iJVNgSUtL3K0+b3A+EWNSb6CiHfRaL6WwVjF+BsjemHDx/HFpP6lH9dJRpOBm 8nqx/wEtou/iysG/IMG2SHwcw5RR4+nOSo5h/Zc3kZUGDlOTcHAzxXGouyMel5AmDAIF 3MisGIyWx7/us0tvzRhFKr6R727pGs1WnyU0Fbn50jeZZwq4KykhF4ebli0nTgCVI5T7 4GSQ== X-Gm-Message-State: AOAM530pt2ArQ6jpANS0yLSnlmU0b/YrqATj7EZnfD6rLoa7kKEU4cQ+ xe2/5JHuFticzpv0m0avYRSqiA== X-Google-Smtp-Source: ABdhPJziL8cAnRjboZ1UlxOOR0Cvu9NdT7Stl0UJiINuPwjmGxQlpm2Sj8AWQP4DU4sVlQP2iThQ2A== X-Received: by 2002:a17:90a:5903:: with SMTP id k3mr8545239pji.104.1625383032314; Sun, 04 Jul 2021 00:17:12 -0700 (PDT) Received: from localhost ([103.207.71.35]) by smtp.gmail.com with ESMTPSA id i18sm553232pgb.83.2021.07.04.00.17.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Jul 2021 00:17:11 -0700 (PDT) From: Leo Yan <leo.yan@linaro.org> To: Arnaldo Carvalho de Melo <acme@kernel.org>, Peter Zijlstra <peterz@infradead.org>, Adrian Hunter <adrian.hunter@intel.com>, Ingo Molnar <mingo@redhat.com>, Mark Rutland <mark.rutland@arm.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>, Thomas Gleixner <tglx@linutronix.de>, Borislav Petkov <bp@alien8.de>, x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>, Mathieu Poirier <mathieu.poirier@linaro.org>, Suzuki K Poulose <suzuki.poulose@arm.com>, Mike Leach <mike.leach@linaro.org>, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org Cc: Leo Yan <leo.yan@linaro.org> Subject: [PATCH v3 02/10] coresight: tmc-etr: Add barrier after updating AUX ring buffer Date: Sun, 4 Jul 2021 15:16:36 +0800 Message-Id: <20210704071644.107397-3-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210704071644.107397-1-leo.yan@linaro.org> References: <20210704071644.107397-1-leo.yan@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210704_001714_042116_98CF2BE1 X-CRM114-Status: GOOD ( 13.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
perf: Refine barriers for AUX ring buffer
|
expand
|
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. + */ + smp_wmb(); + out: /* * Don't set the TRUNCATED flag in snapshot mode because 1) the
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 <leo.yan@linaro.org> --- drivers/hwtracing/coresight/coresight-tmc-etr.c | 8 ++++++++ 1 file changed, 8 insertions(+)