[PATCH v2 4/5] ARM: perf: Allow the use of the PMUv3 driver on 32bit ARM

Marc Zyngier marc.zyngier at arm.com
Wed Jun 14 01:04:16 PDT 2017


On 13/06/17 16:40, Vladimir Murzin wrote:
> Hi Marc,
> 
> On 13/06/17 15:28, Marc Zyngier wrote:
>> +static inline int read_pmuver(void)
>> +{
>> +	u32 dfr0 = read_sysreg(ID_DFR0);
>> +	int vers = (s8)((dfr0 >> 24) & 0xff);
>> +
>> +	if (vers < 3)
>> +		vers = -1;
>> +
>> +	return vers;
>> +}
> 
> Alternatively, PMU version can be extracted with existent helper:
> 
> int vers = cpuid_feature_extract(CPUID_EXT_DFR0, 24);
> 
> Not sure which of these two is preferred...

Clearly, your solution looks much better than my open-coded version.
I'll use that in the next round.

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...



More information about the linux-arm-kernel mailing list