[PATCH v3 0/5]

Florian Fainelli f.fainelli at gmail.com
Sun Dec 19 15:46:32 PST 2021


Hi Will, Marc,

On 5/21/2018 11:19 AM, Will Deacon wrote:
> Hi Marc,
> 
> Thanks for this.
> 
> On Fri, May 18, 2018 at 03:39:08PM +0100, Marc Zyngier wrote:
>> PMUv3 has been introduced with ARMv8 and, while it has only been used
>> on 64bit systems so far, it would definitely be useful for 32bit
>> guests running under KVM/arm64, for example.
>>
>> There is also the case of people natively running 32bit kernels on
>> 64bit HW and trying to upstream unspeakable hacks, hoping that the
>> stars will align and that they'll win the lottery (see [1]).
>>
>> So let's try again, and make the PMUv3 driver usable for everyone.
>>
>> This is done in three steps:
>> (1) Move the driver from arch/arm64 to drivers/perf
>> (2) Add a handful of system register accessors so that we can reuse
>>      the driver on 32bit
>> (3) Provide the same accessors on 32bit, enable compilation, and
>>      make it the default selection for mach-virt.
>>
>> Tested on a Seattle box with 32bit guests.
> 
> I think we should go ahead with something like this, but I don't think
> we're quite there with these patches. If we're going to move the arch code
> out into drivers, let's do that for the perf_event* files under arch/arm/
> as well. Then we could have a structure along the lines of:
> 
> 
>    drivers/perf/arm_pmu.c			- As it is today
>    drivers/perf/arm_cpu/xscale_pmu.c		- Only builds for 32-bit
>    drivers/perf/arm_cpu/armv6_pmu.c		- Only builds for 32-bit
>    drivers/perf/arm_cpu/arch_pmu.c		- Works for v7/v8 on
>                                                    both 32-bit and 64-bit

There has been a recent renewed interest in this patch series from my 
side as well as other users, and I have picked up where Marc left and 
started moving the Xscale and ARMv6 PMU drivers as Will had asked the 
current result can be seen here:

https://github.com/ffainelli/linux/commits/arm-pmuv3

It is not entirely clear to me what you had in mind when you want to 
have a common driver for v7 and v8 under 
drivers/perf/arm_cpu/arch_pmu.c. How much sharing or consolidation would 
you expect to be done there?

Thanks!
-- 
Florian



More information about the linux-arm-kernel mailing list