public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Will Deacon <will@kernel.org>
To: Yicong Yang <yangyicong@huawei.com>
Cc: Yushan Wang <wangyushan12@huawei.com>,
	Jonathan.Cameron@huawei.com, yangyicong@hisilicon.com,
	mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, robin.murphy@arm.com,
	liuyonglong@huawei.com, wanghuiqiang@huawei.com,
	prime.zeng@hisilicon.com, hejunhao3@h-partners.com,
	linuxarm@huawei.com, fanghao11@huawei.com
Subject: Re: [PATCH v3 5/9] drivers/perf: hisi: Extend the field of tt_core
Date: Wed, 24 Sep 2025 12:19:31 +0100	[thread overview]
Message-ID: <aNPTwxnlXGbazFLR@willie-the-truck> (raw)
In-Reply-To: <3cc3fcdf-436a-9e73-a377-ed896d07a825@huawei.com>

On Tue, Sep 23, 2025 at 03:31:15PM +0800, Yicong Yang wrote:
> diff --git a/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c b/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c
> index bbd81a43047d..a52d98f1ed34 100644
> --- a/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c
> +++ b/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c
> @@ -57,6 +57,11 @@
>  #define L3C_V2_NR_EVENTS	0xFF
> 
>  HISI_PMU_EVENT_ATTR_EXTRACTOR(ext, config, 17, 16);
> +/*
> + * Remain the config1:0-7 for backward compatibility if some existing users
> + * hardcode the config1:0-7 directly without parsing the sysfs attribute.
> + */
> +HISI_PMU_EVENT_ATTR_EXTRACTOR(tt_core_deprecated, config1, 7, 0);
>  HISI_PMU_EVENT_ATTR_EXTRACTOR(tt_req, config1, 10, 8);
>  HISI_PMU_EVENT_ATTR_EXTRACTOR(datasrc_cfg, config1, 15, 11);
>  HISI_PMU_EVENT_ATTR_EXTRACTOR(datasrc_skt, config1, 16, 16);
> @@ -95,6 +100,21 @@ static bool support_ext(struct hisi_l3c_pmu *pmu)
>  	return l3c_pmu_ext->support_ext;
>  }
> 
> +/*
> + * tt_core was extended to cover all the CPUs sharing the L3 and was moved from
> + * config1:0-7 to config2:0-*. Try it first and fallback to tt_core_deprecated
> + * if user's still using the deprecated one.
> + */
> +static u32 hisi_l3c_pmu_get_tt_core(struct perf_event *event)
> +{
> +	u32 core = hisi_get_tt_core(event);
> +
> +	if (core)
> +		return core;
> +
> +	return hisi_get_tt_core_deprecated(event);
> +}

Perhaps we should be stricter about this and fail validation for events
that specify both a non-zero tt_core and a non-zero tt_core_deprecated?

Will


  reply	other threads:[~2025-09-24 11:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-29 10:14 [PATCH v3 0/9] Updates of HiSilicon Uncore L3C PMU Yushan Wang
2025-08-29 10:14 ` [PATCH v3 1/9] drivers/perf: hisi: Relax the event ID check in the framework Yushan Wang
2025-08-29 10:14 ` [PATCH v3 2/9] drivers/perf: hisi: Export hisi_uncore_pmu_isr() Yushan Wang
2025-08-29 10:14 ` [PATCH v3 3/9] drivers/perf: hisi: Simplify the probe process of each L3C PMU version Yushan Wang
2025-08-29 10:14 ` [PATCH v3 4/9] drivers/perf: hisi: Extract the event filter check of L3C PMU Yushan Wang
2025-08-29 10:14 ` [PATCH v3 5/9] drivers/perf: hisi: Extend the field of tt_core Yushan Wang
2025-09-22 13:17   ` Will Deacon
2025-09-23  7:31     ` Yicong Yang
2025-09-24 11:19       ` Will Deacon [this message]
2025-09-25  3:59         ` Yicong Yang
2025-08-29 10:14 ` [PATCH v3 6/9] drivers/perf: hisi: Refactor the event configuration of L3C PMU Yushan Wang
2025-08-29 10:14 ` [PATCH v3 7/9] drivers/perf: hisi: Add support for L3C PMU v3 Yushan Wang
2025-08-29 10:14 ` [PATCH v3 8/9] Documentation: hisi-pmu: Fix of minor format error Yushan Wang
2025-08-29 10:14 ` [PATCH v3 9/9] Documentation: hisi-pmu: Add introduction to HiSilicon V3 PMU Yushan Wang
2025-09-01  6:49   ` Yicong Yang
2025-09-11 13:22 ` [PATCH v3 0/9] Updates of HiSilicon Uncore L3C PMU wangyushan
2025-09-22 13:14 ` Will Deacon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aNPTwxnlXGbazFLR@willie-the-truck \
    --to=will@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=fanghao11@huawei.com \
    --cc=hejunhao3@h-partners.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=liuyonglong@huawei.com \
    --cc=mark.rutland@arm.com \
    --cc=prime.zeng@hisilicon.com \
    --cc=robin.murphy@arm.com \
    --cc=wanghuiqiang@huawei.com \
    --cc=wangyushan12@huawei.com \
    --cc=yangyicong@hisilicon.com \
    --cc=yangyicong@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox