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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id A45D1C54EE9 for ; Tue, 13 Sep 2022 10:44:29 +0000 (UTC) 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:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hZyF5rYKV47TbHSl3XaXRl2YnDLpmO6j8ulgK+oUg+Q=; b=EJ6Kqi50BUIAtF DLZIq9tfRo3o9z9GV+RifyT4/6aHJy9Okqs64SsHKrbksUm59x6SAejIw9V8GIByJ7viW5+Yjs/nZ uXTEhy+sX3zcIy/5MwI0ZF+602H1vvDYhQFyXJjW0AUvWv7cynWFc5KaWlqiW1IvReH1/aRMGNtSu LVOGXfant5XKf/c0kTd91z1jSzWH82p2RUNMLqqsRA55OVCaf3FXqe2UWXv/2FofwaG95Yjs/IIA8 SlHe7LnfKDqbNXeVHiMrQqLlAeZgSLRGJkipmJfIp7yZfwOHQfxuOP8Vm010Qtht2N/CYQbfEDBGe M9s4c2dRfVaSSYHxYaUw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oY3Nu-006lVk-0S; Tue, 13 Sep 2022 10:43:18 +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 1oY3KS-006i3v-GY for linux-arm-kernel@lists.infradead.org; Tue, 13 Sep 2022 10:39:46 +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 AC82A1063; Tue, 13 Sep 2022 03:39:47 -0700 (PDT) Received: from [10.57.77.29] (unknown [10.57.77.29]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 81D613F71A; Tue, 13 Sep 2022 03:39:39 -0700 (PDT) Message-ID: <740298c9-0cae-251d-97b4-d2724399ba40@arm.com> Date: Tue, 13 Sep 2022 11:39:38 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH V2 6/7] arm64/perf: Add BRBE driver Content-Language: en-US To: Anshuman Khandual Cc: Rob Herring , Marc Zyngier , Ingo Molnar , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org, peterz@infradead.org, acme@kernel.org, mark.rutland@arm.com, will@kernel.org, catalin.marinas@arm.com, German Gomez References: <20220908051046.465307-1-anshuman.khandual@arm.com> <20220908051046.465307-7-anshuman.khandual@arm.com> From: James Clark In-Reply-To: <20220908051046.465307-7-anshuman.khandual@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220913_033944_761037_F18160F5 X-CRM114-Status: GOOD ( 17.32 ) 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-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 08/09/2022 06:10, Anshuman Khandual wrote: > This adds a BRBE driver which implements all the required helper functions > for struct arm_pmu. Following functions are defined by this driver which > will configure, enable, capture, reset and disable BRBE buffer HW as and > when requested via perf branch stack sampling framework. > > - arm64_pmu_brbe_filter() > - arm64_pmu_brbe_enable() > - arm64_pmu_brbe_disable() > - arm64_pmu_brbe_read() > - arm64_pmu_brbe_probe() > - arm64_pmu_brbe_reset() > - arm64_pmu_brbe_supported() > > Cc: Peter Zijlstra > Cc: Ingo Molnar > Cc: Arnaldo Carvalho de Melo > Cc: Mark Rutland > Cc: Will Deacon > Cc: Catalin Marinas > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-perf-users@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Anshuman Khandual > --- > arch/arm64/kernel/perf_event.c | 8 +- > drivers/perf/Kconfig | 11 + > drivers/perf/Makefile | 1 + > drivers/perf/arm_pmu_brbe.c | 448 +++++++++++++++++++++++++++++++++ > drivers/perf/arm_pmu_brbe.h | 259 +++++++++++++++++++ > include/linux/perf/arm_pmu.h | 20 ++ > 6 files changed, 746 insertions(+), 1 deletion(-) > create mode 100644 drivers/perf/arm_pmu_brbe.c > create mode 100644 drivers/perf/arm_pmu_brbe.h > [...] > + > +static int brbe_fetch_perf_priv(u64 brbinf) > +{ > + int brbe_el = brbe_fetch_el(brbinf); > + > + switch (brbe_el) { > + case BRBINF_EL_EL0: > + return PERF_BR_PRIV_USER; > + case BRBINF_EL_EL1: > + return PERF_BR_PRIV_KERNEL; > + case BRBINF_EL_EL2: > + if (is_kernel_in_hyp_mode()) > + return PERF_BR_PRIV_KERNEL; > + return PERF_BR_PRIV_HV; > + default: > + pr_warn("unknown branch privilege captured\n"); > + return -1; On V1 you said that you would change this to PERF_BR_PRIV_UNKNOWN, looks like that was dropped. Unless it didn't work out? _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel