Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp340032iob; Wed, 11 May 2022 16:00:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxci0BqkQ+fCJH0F2+FHm9Nsmh3imK8TIPIZayl9otFVotG1C+OOuFRhacLIkUrZi0yNzYW X-Received: by 2002:a17:906:ece3:b0:6f3:da10:138a with SMTP id qt3-20020a170906ece300b006f3da10138amr27231372ejb.438.1652310005179; Wed, 11 May 2022 16:00:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652310005; cv=none; d=google.com; s=arc-20160816; b=D9tLosCsedtYAxTuPzkKyAjLFGkB9f3QRFxlhdXrwc/piS5u0PvqA0SJLrd5C7+ifY kRozK++lDC1cT4FxBPNwCIq/b3x8g4brqAmVb/sGzJm/9XxDiZOOPXfmPYa05C75qPjV X05T4iM6Yj1Bj829dmZDql0iZE1U+EefV2ekk9Ivx7SENPWwYY6jclUGdapUmK0sBU+j BsZJWsto4dBJgcyu6msspnjY5D0cAZNxfBx8bTU4tW4A6wYr4+rVbgl3q9vQvz+pJQeQ kXE9K+m71fyVVkaWVB9FHJRS+sq/L3SROgBUVkbYLHAAOxC1ycmenD+Me1c2UmSxkBA+ XphQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=oWjakq/illQMU6mUjolEq2Ah4DoleXLzYIwdYWOO0fU=; b=I5idq3Vym1P1gkvCRZXUor8w0oCXY11v8U9B22B9e2P3fMagSE+atfUDX5laYITG24 Y3tSwTEqVByKPMx5olUv2yXNkyhuvoEDIF/FpmmvkT9SEnSS5SwLs9IOrnI7F6zCkfpx zswq5dYNdy1cwYaSupDxDxoXu6KO3KBq6MDLurnyx9G9Uh1/wRgBdL2BSfvlU8XgVVOc 3blzzGOf4J7wBTg7oikbmTb7sgbv6pX65uFPg9XQ1Ij3e9G85pa8B6atOIw0rF2C4yV3 QhCuBJjIlS6LOpUQHrfLVxvx7dSYh8Emulrnc1QkswFkx55NiSSmm7l8ZkJMgGzk3RSu qlPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=wVeNQv4o; dkim=neutral (no key) header.i=@linutronix.de; 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=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hc40-20020a17090716a800b006df76385f31si4064032ejc.977.2022.05.11.15.59.37; Wed, 11 May 2022 16:00:05 -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=@linutronix.de header.s=2020 header.b=wVeNQv4o; dkim=neutral (no key) header.i=@linutronix.de; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347159AbiEKTrI (ORCPT + 99 others); Wed, 11 May 2022 15:47:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346094AbiEKTrB (ORCPT ); Wed, 11 May 2022 15:47:01 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B99C139175; Wed, 11 May 2022 12:47:00 -0700 (PDT) Date: Wed, 11 May 2022 19:46:58 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1652298419; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oWjakq/illQMU6mUjolEq2Ah4DoleXLzYIwdYWOO0fU=; b=wVeNQv4oPDoZEZoqQgGIP9gD7aCUVCR6fzsW/18PGQyQgfaqCPvhWQG4Yy41XjvlzjZD8n iPw2h+f6Ns6zMuepl8mVo946oQDkMGt1Fre6uX8A72Vtc5Yue2apY3SyGYJD0CyJmGnScQ zAr3YE9nvlr1vQNCXMxrfN6huQw0kKokEAc29FjczDBecY00IdNVGSFjgINZg4jj2pnPpg BmUHeLwlvCHmkAF0xrzpX41lOC16YVfsSprkA2JpmQXUV++p47FHLjORtSlEC1R0U5PGWq GZMwG0Gz10NKju9U67eJdzBEXTZAEEFczeg5Lp65ZcQUCribTsptD41QG0HFxg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1652298419; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oWjakq/illQMU6mUjolEq2Ah4DoleXLzYIwdYWOO0fU=; b=/bq4l2GoVK2HcXr+feW9CwazIScxmBkPcAKad9bgVreLTexbVoStf8oIiY4ViorRLjRo3z c02mbTfjd7jCXHDw== From: "tip-bot2 for Ravi Bangoria" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/core] perf/amd/ibs: Advertise zen4_ibs_extensions as pmu capability attribute Cc: Ravi Bangoria , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20220509044914.1473-5-ravi.bangoria@amd.com> References: <20220509044914.1473-5-ravi.bangoria@amd.com> MIME-Version: 1.0 Message-ID: <165229841825.4207.4646918223828683533.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 The following commit has been merged into the perf/core branch of tip: Commit-ID: 838de1d843fc9b6161e0e1c6308a8c027d08606d Gitweb: https://git.kernel.org/tip/838de1d843fc9b6161e0e1c6308a8c027d08606d Author: Ravi Bangoria AuthorDate: Mon, 09 May 2022 10:19:10 +05:30 Committer: Peter Zijlstra CommitterDate: Wed, 11 May 2022 16:27:10 +02:00 perf/amd/ibs: Advertise zen4_ibs_extensions as pmu capability attribute PMU driver can advertise certain feature via capability attribute('caps' sysfs directory) which can be consumed by userspace tools like perf. Add zen4_ibs_extensions capability attribute for IBS pmus. This attribute will be enabled when CPUID_Fn8000001B_EAX[11] is set. With patch on Zen4: $ ls /sys/bus/event_source/devices/ibs_op/caps zen4_ibs_extensions Signed-off-by: Ravi Bangoria Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220509044914.1473-5-ravi.bangoria@amd.com --- arch/x86/events/amd/ibs.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/arch/x86/events/amd/ibs.c b/arch/x86/events/amd/ibs.c index 2dc8b7e..c251bc4 100644 --- a/arch/x86/events/amd/ibs.c +++ b/arch/x86/events/amd/ibs.c @@ -537,8 +537,14 @@ static struct attribute_group empty_format_group = { .attrs = attrs_empty, }; +static struct attribute_group empty_caps_group = { + .name = "caps", + .attrs = attrs_empty, +}; + static const struct attribute_group *empty_attr_groups[] = { &empty_format_group, + &empty_caps_group, NULL, }; @@ -546,6 +552,7 @@ PMU_FORMAT_ATTR(rand_en, "config:57"); PMU_FORMAT_ATTR(cnt_ctl, "config:19"); PMU_EVENT_ATTR_STRING(l3missonly, fetch_l3missonly, "config:59"); PMU_EVENT_ATTR_STRING(l3missonly, op_l3missonly, "config:16"); +PMU_EVENT_ATTR_STRING(zen4_ibs_extensions, zen4_ibs_extensions, "1"); static umode_t zen4_ibs_extensions_is_visible(struct kobject *kobj, struct attribute *attr, int i) @@ -563,6 +570,11 @@ static struct attribute *fetch_l3missonly_attrs[] = { NULL, }; +static struct attribute *zen4_ibs_extensions_attrs[] = { + &zen4_ibs_extensions.attr.attr, + NULL, +}; + static struct attribute_group group_rand_en = { .name = "format", .attrs = rand_en_attrs, @@ -574,13 +586,21 @@ static struct attribute_group group_fetch_l3missonly = { .is_visible = zen4_ibs_extensions_is_visible, }; +static struct attribute_group group_zen4_ibs_extensions = { + .name = "caps", + .attrs = zen4_ibs_extensions_attrs, + .is_visible = zen4_ibs_extensions_is_visible, +}; + static const struct attribute_group *fetch_attr_groups[] = { &group_rand_en, + &empty_caps_group, NULL, }; static const struct attribute_group *fetch_attr_update[] = { &group_fetch_l3missonly, + &group_zen4_ibs_extensions, NULL, }; @@ -615,6 +635,7 @@ static struct attribute_group group_op_l3missonly = { static const struct attribute_group *op_attr_update[] = { &group_cnt_ctl, &group_op_l3missonly, + &group_zen4_ibs_extensions, NULL, };