From patchwork Sun Jul 11 10:40:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 12369091 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.5 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,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 D46F4C07E96 for ; Sun, 11 Jul 2021 10:45:29 +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 8FCD261184 for ; Sun, 11 Jul 2021 10:45:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8FCD261184 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=fDxD3wdzpM0hp2cxqHu4CtfvR2D32UTPe7gtfPEVSYE=; b=e32aOEe4NE3Mdb cOEE6D9uBspLaxK8z8REl745YAk0MJX46hX6T9C1Hdhe0vrJaFR0SY+QbaNDxNOILx7eKxVLsdZeM Cd30q6tVj3HX8Z7hrydFe0nevYz5/gi5xZFZFlH33zV8jgHE9/gTCmFEA3/vLLr18y8C/z5cjI9T5 FwY8CDqt+dlLNF7S8ANPxXDtw1TMXl1+JmV4CBHFn5nj8CuVmgG36GbCOV13U1qmZWujWPb/9AcAs dkO4ZBwomdTz+anPaS6IFD6Ufa7r0QDj+NE7uw4Ml3NDaGUUS0lWgKVtWTX+/ODdEgc4ulJXovY3i GEHiofj7GwrE6KFVV40Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m2Wvx-004t1E-Dz; Sun, 11 Jul 2021 10:43:38 +0000 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m2Wts-004sDT-VL for linux-arm-kernel@lists.infradead.org; Sun, 11 Jul 2021 10:41:30 +0000 Received: by mail-pf1-x42a.google.com with SMTP id y4so13325247pfi.9 for ; Sun, 11 Jul 2021 03:41:28 -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=Q5Wf8ghZ23c6vSvSmNVjb2NVOeSumBPmpt+tM4X+4G0=; b=lyx0w/3i2J+y8CQc61EkPiIT6/dGLPzkaz7rfy+3+zdS2LKYhCN3ohFbBOQVnkr5vo c2QSHAkUQmYjofvTN++VJ8GVQlmbwsW/LHW82wh4QnkGR8pye+CS6TAQDUQUnd3Cwogk HNhZAvfFkccsVf++cXdroo8L9TMDDQzJTJjkuzpuz3Ysh+WXgzQzQ6cEsgs387G+liSe 0YRNVEQJyrH8s6PyNWZ7gQnmGD8BwkOHe0yOdZVXvAz+26Tjns4lpRZQVkZqrmNMKMvL JNEzSOgyosIHx1ZjVZlafGpAY1c22KJvTAf946Df3Ic2yJcQdUgzaA1UwDVMSsHL+VyA 5j1A== 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=Q5Wf8ghZ23c6vSvSmNVjb2NVOeSumBPmpt+tM4X+4G0=; b=PUXxT0aoEicSgnMqltu/ZVolDqaq0dHlYc+ApdTzvjbGT4XpPZLSMTh2yjKmsU8iSD V4okJ5K9lnxxduYO3Z+7YPji9Qbq5I1D6T9vnphvYnuCvqSQ5a6paU4nuAQur3F9kz+Y C/iOGr+XLYVWSMt0APTvMLzyVJsaTLOppDT4DHJZTDn3vIZ9ZA3tbTzZFqNReuxZu7ud 76175OkVk/sUlDLYF/AdKHsEgQ7lE6zLJxS4B/EPbvGPWdjx84CI73jZP4+u2CNfvLR5 rLnf0eUR+taNc2sv/BM51gtIxcpb+lehYtMlQHjPqdm/2gv2sBKPmpnHxqO1Y5soL/Hw nk8A== X-Gm-Message-State: AOAM532Tg8cuWZFeTRqy8hkiBJQ4QqyLVo+raBfydfFSrxihYS6ehxLv tRP+gMqLJx7j2fJa+BkPdQF/nQ== X-Google-Smtp-Source: ABdhPJy7rSDkFVxHKzcS361rBBVWk82TUHhXPNVEgieYnRflyQ2XrW4SpdiE8S9LYx0A8Mr01spdNA== X-Received: by 2002:a63:e211:: with SMTP id q17mr25685112pgh.363.1626000088096; Sun, 11 Jul 2021 03:41:28 -0700 (PDT) Received: from localhost ([103.127.241.250]) by smtp.gmail.com with ESMTPSA id x13sm10181726pjh.30.2021.07.11.03.41.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Jul 2021 03:41:27 -0700 (PDT) From: Leo Yan To: 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 , Suzuki K Poulose , Mike Leach , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org Cc: Leo Yan Subject: [PATCH v4 04/11] perf/x86: Add barrier after updating bts Date: Sun, 11 Jul 2021 18:40:58 +0800 Message-Id: <20210711104105.505728-5-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210711104105.505728-1-leo.yan@linaro.org> References: <20210711104105.505728-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-20210711_034129_104415_4161271D X-CRM114-Status: GOOD ( 12.53 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add barrier wmb() to separate the AUX data store and aux_head store. Signed-off-by: Leo Yan --- arch/x86/events/intel/bts.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/events/intel/bts.c b/arch/x86/events/intel/bts.c index 6320d2cfd9d3..4a015d160bc5 100644 --- a/arch/x86/events/intel/bts.c +++ b/arch/x86/events/intel/bts.c @@ -209,6 +209,9 @@ static void bts_update(struct bts_ctx *bts) } else { local_set(&buf->data_size, head); } + + /* The WMB separates data store and aux_head store matches. */ + wmb(); } static int