lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d1731acc-81a7-df59-b6ac-650f30e0e780@huawei.com>
Date: Thu, 25 Sep 2025 11:59:32 +0800
From: Yicong Yang <yangyicong@...wei.com>
To: Will Deacon <will@...nel.org>
CC: <yangyicong@...ilicon.com>, Yushan Wang <wangyushan12@...wei.com>,
	<Jonathan.Cameron@...wei.com>, <mark.rutland@....com>,
	<linux-arm-kernel@...ts.infradead.org>, <linux-kernel@...r.kernel.org>,
	<robin.murphy@....com>, <liuyonglong@...wei.com>, <wanghuiqiang@...wei.com>,
	<prime.zeng@...ilicon.com>, <hejunhao3@...artners.com>,
	<linuxarm@...wei.com>, <fanghao11@...wei.com>
Subject: Re: [PATCH v3 5/9] drivers/perf: hisi: Extend the field of tt_core

On 2025/9/24 19:19, Will Deacon wrote:
> 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?
> 

added in hisi_uncore_l3c_ops->check_filter() that hisi_uncore_pmu_event_init() will
call check_filter() to ask uncore pmu to validate the filter configuration.

https://lore.kernel.org/linux-arm-kernel/20250925033123.5836-1-yangyicong@huawei.com/

thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ