From owner-freebsd-hackers@freebsd.org Tue Jul 5 18:26:53 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF911B201E9 for ; Tue, 5 Jul 2016 18:26:53 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB1E11ABB; Tue, 5 Jul 2016 18:26:53 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net (c-50-139-166-237.hsd1.ma.comcast.net [50.139.166.237]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u65IQif4011024 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Tue, 5 Jul 2016 11:26:45 -0700 Subject: Re: Review request: sparse CPU ID maps To: Warner Losh , Adrian Chadd References: <57761101.3030101@freebsd.org> <5345fb94-91b8-5019-037e-d4825a694cfd@freebsd.org> Cc: "freebsd-hackers@freebsd.org" , outro pessoa From: Nathan Whitehorn Message-ID: <59222776-45b4-640c-b5e4-5f8b8d6c45e5@freebsd.org> Date: Tue, 5 Jul 2016 11:26:43 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVYJgx+TKnWdwLYYgGpUKMH24lQEzyNrm2WuvLTkkvMD93V4HNeLJsFBsFz+JFeBv5pVObXO6FwdyMW4zdnjoesyEkATbPUrXbI= X-Sonic-ID: C;1EfABt5C5hG6rZtMTlz00w== M;tjdIB95C5hG6rZtMTlz00w== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2016 18:26:53 -0000 On 07/03/16 13:11, Warner Losh wrote: > On Sun, Jul 3, 2016 at 1:37 PM, Adrian Chadd wrote: >> On 2 July 2016 at 17:08, Nathan Whitehorn wrote: >>> A reasonable first pass at checking for this kind of bug is doing grep -lR >>> '< mp_ncpus'. Running that on sys/arm and sys/arm64 shows the following >>> files: >>> arm/mv/armadaxp/armadaxp_mp.c >>> arm/include/counter.h >>> arm/broadcom/bcm2835/bcm2836.c >>> arm/broadcom/bcm2835/bcm2836_mp.c >>> arm/freescale/imx/imx6_mp.c >>> arm/allwinner/aw_mp.c >>> arm/rockchip/rk30xx_mp.c >>> arm/amlogic/aml8726/aml8726_mp.c >>> arm/samsung/exynos/exynos5_mp.c >>> arm/arm/mp_machdep.c >>> arm/nvidia/tegra124/tegra124_mp.c >>> arm64/include/counter.h >>> arm64/arm64/gic_v3.c >>> arm64/arm64/gic_v3_its.c >>> arm64/arm64/gicv3_its.c >>> >>> All of them should, in some sense, be CPU_FOREACH(), but it may not matter. >>> For example, it may not be possible to have sparse CPU IDs on some or all of >>> those SOCs. At least the generic ones (counter, mp_machdep.c, gic (why are >>> there both gic_v3_its.c and gicv3_its.c?)) should be changed, I think. >>> -Nathan >> I think converting all the users over to the CPU_FOREACH thing is the >> right way to go, even if the SOC doesn't require it. People do bring >> up new systems by copy/pasta'ing an existing similar system, so we're >> best served by having all the consumers migrated. >> >> But, I'd do it in head/12. Early in head/12. :-P > It is a mergeable change too, since it wouldn't change any APIs. > At least the conversion to CPU_FOREACH. We don't want too many > sweeping changes that can't be merged too early (that way leads to > lots of maintenance issues), but we can do something like this. Merging > would be optional, but possible, for those bits of the tree that need it. > Though, for something like this, there's little against doing a full merge > and a lot for it... > > Warner > That sounds like the right approach. Since the original patch fixes bugs in 11, rather than niceties, I will send it to re@ tomorrow. After the branch, I'll do a sweep of other obviously wrong code for 12 with an MFC timer. -Nathan