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

Vladimir Murzin vladimir.murzin at arm.com
Tue Jun 13 08:40:47 PDT 2017


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...

Cheers
Vladimir



More information about the linux-arm-kernel mailing list