From patchwork Mon Aug 9 11:27:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 12426239 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=-12.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 CDA69C4338F for ; Mon, 9 Aug 2021 11:29:46 +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 95DD360F8F for ; Mon, 9 Aug 2021 11:29:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 95DD360F8F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=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: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:In-Reply-To:References: List-Owner; bh=kwhZdXsMO8mCCrxgeBJSsvgPY3B6cjPGIiyR+Vc9F0s=; b=Lx0o0Uhl4IvLr3 pin16hggjUbmn1Mq9ksNCOghSniJbIyNveXmL1CDtRO+sI6I7V6fuUBqkCjN4gSUg60x9SU1I6HLv TvXAkCVc+oetK72ZjvL36rxjd3NJFFO3SVI8jSV3pdkpR58NRPB1bB3FYeJbA8JxFpIcNPeSX2LyN 8avx/H3zrZLBbXY85Qqk49Rir9KgOpvqXm9e6gW260yuUy3qH4f8qCbcg78Z3+V530bWea5huNavf HAWKXLOqxsCqjLCzBVlwdoL8OJfqMpue7cxZAF42SaFxUdB2rPyjSqgqbIkiaxJik0KS47k9mMFqK yyoBd/A+W8srLZ45FvPw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mD3RX-000MHu-0x; Mon, 09 Aug 2021 11:27:43 +0000 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mD3RQ-000MFd-K5 for linux-arm-kernel@lists.infradead.org; Mon, 09 Aug 2021 11:27:39 +0000 Received: by mail-pj1-x102b.google.com with SMTP id hv22-20020a17090ae416b0290178c579e424so1298614pjb.3 for ; Mon, 09 Aug 2021 04:27:36 -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:mime-version :content-transfer-encoding; bh=k/+aHLq7iQTHQvse8lBK4UCS63ZAxvJXMyNkAqg6dBM=; b=XeC9RsTGxZMmNPGSMZ36jBKda4lwYJNW4jQonBDaQ4ieollr30yeXDOvukJd49x3cO zCPnZ5Ojpik0a8R4XWMDzO+jLoDa5nGB2clJbv3THaJo5MtfNkviaSRsBZZPEoLjbgdA FCWhrRH8ibsKKPY1x6lX1EuiR2HfcR1dSfanqtVPN8+y/LwCiYOgfImciPez7JlOdX9j 3dZxVWlf7wBQNW5yVudwjKE+hj2Z5uPJVvO9obZSsPDjCOAMlfYYeKAD/uNrDBiS8Hy2 oE3lMEf4+VSNPoZW27rUqoJxG4lsGW+iMfloFyGbztXqcMV8doPy10FMJpX8jJpJzVsR kVLg== 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:mime-version :content-transfer-encoding; bh=k/+aHLq7iQTHQvse8lBK4UCS63ZAxvJXMyNkAqg6dBM=; b=Sa5WUidNxCVurW179dwLjUGUdqDrjkjQJmt+KLVKUq8Axhl3U4Y2uZSDD0h/Zf2sVH gXlT0aGiGBYU2tNErxfK+vvbfw4euF5Ccg1KSnznEFVYfRonRG83YY9MAMNmtr573KgG Mj2Oa6ZA7+VnWRQc4SKkIfo3fsBPptJuMhH9E7DF60j5QeGmEGdX7cbXDYj1HUhKozuO Npg4LFNmUjszyJjuTQUQu55sJuCxsvUVN+Rt3FQMFqpK1jwkNnay4wI35N7qJ15hrxQg zPOTmtfnm8Mi/IhW2/IQ5BU+YdzIFKj39wnLk5vBnPq89yJLXivFWAQcfV2HJyv76d0F 1lzw== X-Gm-Message-State: AOAM533ivV2poPR8LWtNOcI+WznyAbFk3Sfljg1trVfrrPhTkR38YPQY 3tp8oSz5bsrYIJ9bH5NRZ8p/jw== X-Google-Smtp-Source: ABdhPJzpEvnVFdglrKETSDfohtwNkBqgAITuAfv3vI+IuzpICq6uCOz0156egLMB2k4EGAZggu+6Ag== X-Received: by 2002:a17:902:a40c:b029:12c:17cf:ab6f with SMTP id p12-20020a170902a40cb029012c17cfab6fmr609701plq.71.1628508455681; Mon, 09 Aug 2021 04:27:35 -0700 (PDT) Received: from localhost ([210.0.159.74]) by smtp.gmail.com with ESMTPSA id r18sm25123055pgk.54.2021.08.09.04.27.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Aug 2021 04:27:35 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Adrian Hunter , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Will Deacon , Russell King , Catalin Marinas , Mathieu Poirier , Suzuki K Poulose , Mike Leach , John Garry , Andi Kleen , Riccardo Mancini , Jin Yao , Li Huafei , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v1 0/3] perf: Support compat mode for AUX ring buffer Date: Mon, 9 Aug 2021 19:27:24 +0800 Message-Id: <20210809112727.596876-1-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210809_042736_693159_B4C58597 X-CRM114-Status: GOOD ( 16.81 ) 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 For better organising and easier review, this patch series is extracted from the patch set "perf: Refine barriers for AUX ring buffer" . When applying this patch series, it needs to be applied on the top of the patch series [1]. To support the compat mode in perf tool, the patch 01 adds an new item in "perf_env" to track if kernel is running in 64-bit mode. This patch is a preparation for later changes. Patch 02 introduces compat variant functions for accessing AUX trace's head and tail, these two functions are defined with weak attribute, so they can be called when any architectures cannot provide 64-bit value atomic accessing when perf is in compat mode. Patch 03 supports compat_auxtrace_mmap__{read_head|write_tail} on Arm platform. For Arm platform with compat mode, the kernel runs in 64-bit kernel mode and user space tool runs in 32-bit mode, it uses the instructions "ldrd" and "strd" for 64-bit value atomicity. This patch set have been tested on Arm64 Juno platform for the perf tool is built with compiler arm-linux-gnueabihf-gcc. [1] https://lore.kernel.org/patchwork/cover/1473916/ Leo Yan (3): perf env: Track kernel 64-bit mode in environment perf auxtrace: Add compat_auxtrace_mmap__{read_head|write_tail} perf auxtrace arm: Support compat_auxtrace_mmap__{read_head|write_tail} tools/perf/arch/arm/util/auxtrace.c | 32 +++++++++++ tools/perf/util/auxtrace.c | 88 +++++++++++++++++++++++++++-- tools/perf/util/auxtrace.h | 22 +++++++- tools/perf/util/env.c | 24 +++++++- tools/perf/util/env.h | 3 + 5 files changed, 161 insertions(+), 8 deletions(-)