hwpmc module does not work on armv6/armv7
Ian Lepore
ian at freebsd.org
Thu Jun 6 15:36:18 UTC 2019
On Thu, 2019-06-06 at 17:32 +0200, Arnaud YSMAL wrote:
> ----- Le 6 Juin 19, à 17:22, Ian Lepore ian at freebsd.org a écrit :
>
> > On Thu, 2019-06-06 at 15:56 +0200, Arnaud YSMAL wrote:
> > > Hi,
> > >
> > > On an armv6/armv7 box, trying to load the hwpmc module lead to an
> > > error message stating that the pmc_armv7_finalize symbol is
> > > undefined.
> > >
> > > This can be fixed by adding this in sys/modules/hwpmc/Makefile :
> > >
> > > .if ${MACHINE_ARCH:Marmv[67]*} != ""
> > > SRCS+= hwpmc_armv7.c
> > > .endif
> > >
> > > Does anyone see any reason for not having this?
> > >
> > >
> >
> > No reason, that was just a bug. I've committed your fix as
> > r348741,
> > thanks!
>
> Thank you.
>
> Sorry for not spotting it earlier but, could you please fix the armv7
> invariant build with this patch?
>
>
> diff --git a/sys/dev/hwpmc/hwpmc_armv7.c
> b/sys/dev/hwpmc/hwpmc_armv7.c
> index 0a601145f8d..d89b5ce302f 100644
> --- a/sys/dev/hwpmc/hwpmc_armv7.c
> +++ b/sys/dev/hwpmc/hwpmc_armv7.c
> @@ -315,11 +315,12 @@ armv7_intr(struct trapframe *tf)
> int error;
> int reg, cpu;
>
> + cpu = curcpu;
> +
> KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
> ("[armv7,%d] CPU %d out of range", __LINE__, cpu));
>
> retval = 0;
> - cpu = curcpu;
> pc = armv7_pcpu[cpu];
>
> for (ri = 0; ri < armv7_npmcs; ri++) {
>
>
Already did, right before I committed your change. :)
I've just heard on irc that there may be other trouble lurking in armv*
hwpmc, some kind of fallout from the changes in r334827. Manu is
looking into it, and will probably post something on the arm@ list when
he gets it figured out.
-- Ian
More information about the freebsd-hackers
mailing list