[PATCH v3 0/5]
Marc Zyngier
maz at kernel.org
Mon Dec 20 00:59:15 PST 2021
Hi Florian,
On Sun, 19 Dec 2021 23:46:32 +0000,
Florian Fainelli <f.fainelli at gmail.com> wrote:
>
> Hi Will, Marc,
+Mark
>
> 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
Blast from the past!
>
> 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?
The v7/v8 models are very similar (they share most of the registers,
and there is only a few bits and pieces that differ between PMUv3 and
its ancestors). It should be possible to build a single driver
However, the 32bit PMU code is bundled together with the
Krait/Scorpion code that isn't quite the same. Maybe this should be
spun as a different driver if this can be disentangled neatly enough?
M.
--
Without deviation from the norm, progress is not possible.
More information about the linux-arm-kernel
mailing list