Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp352081iog; Fri, 24 Jun 2022 05:26:06 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vnXGY4XnZbtPQpP0/IZYsLhvcZq3m7cO7ZXq4YcAyYWbFT1GWW4pg2nDqQijBN4lFJ50U/ X-Received: by 2002:a17:907:ea6:b0:708:1282:cbe8 with SMTP id ho38-20020a1709070ea600b007081282cbe8mr13623108ejc.520.1656073566664; Fri, 24 Jun 2022 05:26:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656073566; cv=none; d=google.com; s=arc-20160816; b=IKgWNoRlJT+MmqdbCIBK1z49Ubmbn1vkxaQu6bnXJr00k+F0s2FQhix9Kp3uPVJ3hh IIbJcOXqYq+xdnxwgzvajs3n7JE/4mOtg6Qld9RtT63GJ/muEtWBtxhmN2/3E9YdJR7w IhDr1gsZJVBFNrdyxKv+Uzi8WGbsqGg5oTObrm/6Irt7F8wvB35p81tbEjGgYEJqZor0 ck+joOxwDXkcDIIXTDna22KKpxipUC+ENcFVbXYUeMw1my/0aYtryemoo4aESOauHcXY H1Ym13BR5uMMumN7izbZsZ8bCM6blWmmfofmmnQxv5w71nQyvGszJQtvbRo4nQX0eoh3 I6Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=vYtA63FnAANqhn+LIUOpG7fpjuAmp04CVPxzUxQ06Po=; b=UvJ3u8Z2BhZFsd96XAe2CxJB8YAEfY/h3YJmlxigwSx6TzySEw/w0ZCmtSj3+J1wa9 guBhmSNRNlA0OutcgToI96EwvtSMM6E0jvObAe8ruDvshpKORmXr8fpsj0+VjJhEmd5N 3ymU7zpW6ASsAxN9RzJuufRN+yJf8wKtThFSM2v8m+NKh6NAeGs+PoGepzbHQ7unwKkX ezvbBvkai4/+xNkwsF//W0uHyphTiM6JVkzFlpLSebCvXtbBju7MvkY5y9R1yp2hWs8S Vwb+3XzUeiS4AgsrfaBQkbh9jYn1FrbQ7784wCnaabd/xHbV5qPYG/6DzjDOt8gom0vc htng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="BnFj/+tI"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y19-20020a056402359300b00435ba45ad70si3642673edc.14.2022.06.24.05.25.35; Fri, 24 Jun 2022 05:26:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="BnFj/+tI"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231157AbiFXMRJ (ORCPT + 99 others); Fri, 24 Jun 2022 08:17:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229615AbiFXMQC (ORCPT ); Fri, 24 Jun 2022 08:16:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DADB281247 for ; Fri, 24 Jun 2022 05:14:43 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 691F3618D7 for ; Fri, 24 Jun 2022 12:14:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6A8BC34114; Fri, 24 Jun 2022 12:14:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656072882; bh=xhGH3Wz8p7oTkxs71Kvl5+Ftr3WjejW+fhXwoTAZErg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BnFj/+tI2rN6E50L3pzmFrvZuHP9PsI+ztV78DurHdUYbfUFxDWvGBqF6OLGKKLSW Pkw0GwiRt2sQLZJ544eBZMldJquZtNJiZQNPQpwCc4Ajhj6ILuZ6+nfy6qmDT0VfUO ObNE2FnE23jLEksq/4lygxD+bmMjxqWL9U1L3lLHgCVC6YIjTGui9LXz22g7ta1Fhm PwOcHNoUGKVhhrjdvTU3KqhdWXjJhFd9vGa9vrUx4X4zhmBxAgwzrK/SDAqtAZWPI9 OSejtB2T+KZGGcwTl342x3XZ/qGW9vCJwHrmJtFcQ6po6qdRv/UqOCqbL8NmrAD6mz IkP4NugwXtO9g== Date: Fri, 24 Jun 2022 13:14:35 +0100 From: Will Deacon To: Tanmay Jagdale Cc: mark.rutland@arm.com, robh@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, sgoutham@marvell.com, lcherian@marvell.com, bbhushan2@marvell.com, amitsinght@marvell.com, james.morse@arm.com Subject: Re: [PATCH RESEND] perf/marvell_cn10k: Add MPAM support for TAD PMU Message-ID: <20220624121435.GA18561@willie-the-truck> References: <20220527185647.3138084-1-tanmay@marvell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220527185647.3138084-1-tanmay@marvell.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 28, 2022 at 12:26:47AM +0530, Tanmay Jagdale wrote: > The TAD PMU supports following counters that can be filtered by MPAM > partition id. > - (0x1a) tad_alloc_dtg : Allocations to DTG. > - (0x1b) tad_alloc_ltg : Allocations to LTG. > - (0x1c) tad_alloc_any : Total allocations to DTG/LTG. > - (0x1d) tad_hit_dtg : DTG hits. > - (0x1e) tad_hit_ltg : LTG hits. > - (0x1f) tad_hit_any : Hit in LTG/DTG. > - (0x20) tad_tag_rd : Total tag reads. > > Add a new 'partid' attribute of 16-bits to get the partition id > passed from perf tool. This value would be stored in config1 field > of perf_event_attr structure. > > Example: > perf stat -e tad/tad_alloc_any,partid=0x12/ > > - Drop read of TAD_PRF since we don't have to preserve any > bit fields and always write an updated value. > - Update register offsets of TAD_PRF and TAD_PFC. It would be great if you could document some of this under Documentation/admin-guide/perf like many of the other PMU drivers have done. > Signed-off-by: Tanmay Jagdale > --- > drivers/perf/marvell_cn10k_tad_pmu.c | 23 ++++++++++++++++++----- > 1 file changed, 18 insertions(+), 5 deletions(-) > > diff --git a/drivers/perf/marvell_cn10k_tad_pmu.c b/drivers/perf/marvell_cn10k_tad_pmu.c > index 282d3a071a67..f552e6bffcac 100644 > --- a/drivers/perf/marvell_cn10k_tad_pmu.c > +++ b/drivers/perf/marvell_cn10k_tad_pmu.c > @@ -18,10 +18,12 @@ > #include > #include > > -#define TAD_PFC_OFFSET 0x0 > +#define TAD_PFC_OFFSET 0x800 > #define TAD_PFC(counter) (TAD_PFC_OFFSET | (counter << 3)) > -#define TAD_PRF_OFFSET 0x100 > +#define TAD_PRF_OFFSET 0x900 > #define TAD_PRF(counter) (TAD_PRF_OFFSET | (counter << 3)) > +#define TAD_PRF_MATCH_PARTID (1 << 8) > +#define TAD_PRF_PARTID_NS (1 << 10) > #define TAD_PRF_CNTSEL_MASK 0xFF > #define TAD_MAX_COUNTERS 8 > > @@ -86,23 +88,32 @@ static void tad_pmu_event_counter_start(struct perf_event *event, int flags) > struct hw_perf_event *hwc = &event->hw; > u32 event_idx = event->attr.config; > u32 counter_idx = hwc->idx; > + u32 partid_filter = 0; > u64 reg_val; > + u32 partid; > int i; > > hwc->state = 0; > > + /* Extract the partid (if any) passed by user */ > + partid = event->attr.config1 & 0x3f; [...] > PMU_FORMAT_ATTR(event, "config:0-7"); > +PMU_FORMAT_ATTR(partid, "config1:0-15"); This doesn't seem to match the mask used above? Will