From owner-freebsd-hackers@freebsd.org Thu Jun 6 15:36:18 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 7567D15B7460 for ; Thu, 6 Jun 2019 15:36:18 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1.eu.mailhop.org (outbound1.eu.mailhop.org [52.28.251.132]) (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 B383C72075 for ; Thu, 6 Jun 2019 15:36:17 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1559835369; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=T93L7rF8RPtjOXML8pUS4y3z7u+oVJ7ViJLoZP0+HLA73whwqzY5CeSt5RH4qGqiYgaLGjkbiAcze pZBrY7tZlWno5W/reLyArJggQyJt7sN9N+abx6J9ZdRE5/O3Nfnz6HrgEGsxSKP0NVXrrsXbfNs4Z3 tPrRVQuozr6L39RRPk21rWxL73J+TbKNgGSet4MzgX5FLEd9oqkahR22TPvcwZt68+5qaZKyLJindB 2KGDgfIiNaY9kxFQW+xJ/5ty+cdYnIou9UyTyOTmi8DqGdiJ8b8hV8yJtWhgIhQecsIrwHID0UrzrC iy3EXfwBDdshZGNfkE56dKjNz+IQ60g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=SveDESkBDEvI/kjZ/gR9/0bGZ2TMEVGTL/hlxP2hTXo=; b=BNWFH0lkKWCaZFXNoPvFH6mA0hu7b/ocDe3UcRMkj9C5bUO3EiWrvc/XisIuodU3hD7HVdy7wUiyN 15j0GmVgoUZA0tGifJ4VMy9t/yZiu8IbxQ/H5c4ECAw8wZpq6sn40jQyoXkgkAtsrRzPLK053qUO4u i+Xt1r09aww1Jg4KXczEkJ/wEY+5Ss7nDpU1MmW84oAeyGt5tGDCVsrLs78/YAppsnEsCBG2WLXeVx ciM6azH+oCU5SUmWKNQCo+XdmdQOV6g76cqDZwM8ubxh1STnZ9f6Km90y4S219Zxu/b9gwfkKJhRjG fleQU/w+u8h9EDdrl7jUSHnoWavXY9g== ARC-Authentication-Results: i=1; outbound3.eu.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=SveDESkBDEvI/kjZ/gR9/0bGZ2TMEVGTL/hlxP2hTXo=; b=b853SUHD1NxFrLspMkTolS04UHC1jD3peYwzKzp2H186habLavmCE8uZ5r9ue21jIUtGBIw0Y6F/s j9LiLGYtmn4LtL/Cp+PS6LN3aKrPcBLfw/T4hg4/c+BsMLogQAyHdsl2k7+eoCBuP2CqrzfOlOElkz DszUvA+xGCmtzAR5Be7E0N9ecRCp5d0VMNA0UuALypHXqOtc6fQN0Jo24NROVUgxeK4l+cynSEHfZo 8udgNj3t4dGmTyv+/Q9Xq/o+xvVJ0Gv+6IRJVtID8pEKTaIOsn8wsQ4GmFWaFULgr/6ZzIUxRWSoil +sBZJoUT3epDJ5xD3IjDj1qlBKnzKSQ== X-MHO-RoutePath: aGlwcGll X-MHO-User: cc4b9e73-8870-11e9-91aa-b56e4e6b5865 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.eu.mailhop.org (Halon) with ESMTPSA id cc4b9e73-8870-11e9-91aa-b56e4e6b5865; Thu, 06 Jun 2019 15:36:07 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x56Fa5ch068436; Thu, 6 Jun 2019 09:36:05 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: hwpmc module does not work on armv6/armv7 From: Ian Lepore To: Arnaud YSMAL Cc: freebsd-hackers Date: Thu, 06 Jun 2019 09:36:05 -0600 In-Reply-To: <1084915390.3960836.1559835169854.JavaMail.zimbra@stormshield.eu> References: <1792534203.3920198.1559829382150.JavaMail.zimbra@stormshield.eu> <401683db73f04cecf12bd11f995480d7a54e9187.camel@freebsd.org> <1084915390.3960836.1559835169854.JavaMail.zimbra@stormshield.eu> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B383C72075 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.99 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.994,0]; ASN(0.00)[asn:16509, ipnet:52.28.0.0/16, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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:36:18 -0000 On Thu, 2019-06-06 at 17:32 +0200, Arnaud YSMAL wrote: > ----- Le 6 Juin 19, à 17:22, Ian Lepore ian@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