From owner-p4-projects@FreeBSD.ORG Thu Apr 17 16:18:37 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4A3FA1065673; Thu, 17 Apr 2008 16:18:37 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B5EB106566B for ; Thu, 17 Apr 2008 16:18:37 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from smtpoutm.mac.com (smtpoutm.mac.com [17.148.16.67]) by mx1.freebsd.org (Postfix) with ESMTP id EF5EE8FC14 for ; Thu, 17 Apr 2008 16:18:36 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from mac.com (asmtp003-s [10.150.69.66]) by smtpoutm.mac.com (Xserve/smtpout004/MantshX 4.0) with ESMTP id m3HG5xZo027119; Thu, 17 Apr 2008 09:05:59 -0700 (PDT) Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mac.com (Xserve/asmtp003/MantshX 4.0) with ESMTP id m3HG5hGQ003043 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 17 Apr 2008 09:05:52 -0700 (PDT) Message-Id: <7BFB3A59-2546-4201-94A3-3FB95B797F9C@mac.com> From: Marcel Moolenaar To: Rafal Jaworowski In-Reply-To: <4807032D.1040204@semihalf.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v919.2) Date: Thu, 17 Apr 2008 09:05:43 -0700 References: <200804170048.m3H0miGF002623@repoman.freebsd.org> <4807032D.1040204@semihalf.com> X-Mailer: Apple Mail (2.919.2) Cc: Marcel Moolenaar , Perforce Change Reviews Subject: Re: PERFORCE change 140142 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2008 16:18:37 -0000 On Apr 17, 2008, at 12:58 AM, Rafal Jaworowski wrote: > Marcel Moolenaar wrote: >> http://perforce.freebsd.org/chv.cgi?CH=140142 >> >> Change 140142 by marcel@marcel_xcllnt on 2008/04/17 00:48:08 >> >> Make SMP go all the way into the scheduler. > > Wow, great to see this, Marcel! :) I'm getting up to speed with the > dual e500 > too, so will follow up on the SMP PPC for sure. Great! It's probably easiest to use the powerpc branch (or create a branch off of it) if I haven't committed anything to CVS. Everything's in place for e500, except the actual details of enumerating the CPUs or starting them. See mp_cpudep.c in sys/powerpc/aim for the OFW version. For e500 you only have to add mp_cpudep.c and implement the following functions: int powerpc_smp_first_cpu(struct cpuref *cpuref); int powerpc_smp_next_cpu(struct cpuref *cpuref); int powerpc_smp_get_bsp(struct cpuref *cpuref); int powerpc_smp_start_cpu(struct pcpu *pc); The first two are used by the powerpc common code to enumerate CPUs. The 3rd is to obtain the reference of the bootstrap processor. The 4th is to actually start APs. The AP eventually has to call void machdep_ap_bootstrap(volatile uint32_t *trcp); At that time all the MMU and CPU specific initialization should have been done. That's it, Come to think of it: most of the MD code for SMP support is actually MI code if you have the right primitives. Such as the primitives above... -- Marcel Moolenaar xcllnt@mac.com