From owner-freebsd-hackers@freebsd.org Thu Jun 6 15:33:08 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A1B315B72A1 for ; Thu, 6 Jun 2019 15:33:08 +0000 (UTC) (envelope-from arnaud.ysmal@stormshield.eu) Received: from work.stormshield.eu (gwlille.netasq.com [91.212.116.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDF3271E93; Thu, 6 Jun 2019 15:33:06 +0000 (UTC) (envelope-from arnaud.ysmal@stormshield.eu) Received: from work.stormshield.eu (localhost [127.0.0.1]) by work.stormshield.eu (Postfix) with ESMTPS id 36FCA3783A94; Thu, 6 Jun 2019 17:32:50 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by work.stormshield.eu (Postfix) with ESMTP id 2765A3783AA5; Thu, 6 Jun 2019 17:32:50 +0200 (CEST) Received: from work.stormshield.eu ([127.0.0.1]) by localhost (work.stormshield.eu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id LDNTaXVJPUIj; Thu, 6 Jun 2019 17:32:50 +0200 (CEST) Received: from work.stormshield.eu (localhost [127.0.0.1]) by work.stormshield.eu (Postfix) with ESMTP id 148FF3783A94; Thu, 6 Jun 2019 17:32:50 +0200 (CEST) Date: Thu, 6 Jun 2019 17:32:49 +0200 (CEST) From: Arnaud YSMAL To: Ian Lepore Cc: freebsd-hackers Message-ID: <1084915390.3960836.1559835169854.JavaMail.zimbra@stormshield.eu> In-Reply-To: <401683db73f04cecf12bd11f995480d7a54e9187.camel@freebsd.org> References: <1792534203.3920198.1559829382150.JavaMail.zimbra@stormshield.eu> <401683db73f04cecf12bd11f995480d7a54e9187.camel@freebsd.org> Subject: Re: hwpmc module does not work on armv6/armv7 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Thread-Topic: hwpmc module does not work on armv6/armv7 Thread-Index: 3aPLYSgYserlK8ZgkBxj9evKsGTHlA== X-Rspamd-Queue-Id: EDF3271E93 X-Spamd-Bar: ++++ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [4.46 / 15.00]; ARC_NA(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.95)[0.953,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[stormshield.eu]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.99)[0.995,0]; IP_SCORE(0.62)[ip: (1.64), ipnet: 91.212.116.0/24(0.82), asn: 49068(0.65), country: FR(-0.01)]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: mx02.cloud.vadesecure.com]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[1.116.212.91.list.dnswl.org : 127.0.10.0]; NEURAL_SPAM_LONG(1.00)[0.999,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:49068, ipnet:91.212.116.0/24, country:FR]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jun 2019 15:33:08 -0000 ----- Le 6 Juin 19, =C3=A0 17:22, Ian Lepore ian@freebsd.org a =C3=A9crit : > On Thu, 2019-06-06 at 15:56 +0200, Arnaud YSMAL wrote: >> Hi, >>=20 >> 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. >>=20 >> This can be fixed by adding this in sys/modules/hwpmc/Makefile : >>=20 >> .if ${MACHINE_ARCH:Marmv[67]*} !=3D "" >> SRCS+=3D hwpmc_armv7.c >> .endif >>=20 >> Does anyone see any reason for not having this? >>=20 >>=20 >=20 > 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 invar= iant 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; =20 + cpu =3D curcpu; + KASSERT(cpu >=3D 0 && cpu < pmc_cpu_max(), ("[armv7,%d] CPU %d out of range", __LINE__, cpu)); =20 retval =3D 0; - cpu =3D curcpu; pc =3D armv7_pcpu[cpu]; =20 for (ri =3D 0; ri < armv7_npmcs; ri++) { >=20 > -- Ian