From owner-freebsd-arm@FreeBSD.ORG Fri Nov 22 07:19:25 2013 Return-Path: Delivered-To: arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5B3B8DA1; Fri, 22 Nov 2013 07:19:25 +0000 (UTC) Received: from mail.bsdpad.com (mail.bsdpad.com [109.107.176.56]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 16FAF2DE3; Fri, 22 Nov 2013 07:19:21 +0000 (UTC) Received: from mail.bsdpad.com ([109.107.176.56]) by mail.bsdpad.com with smtp (Exim 4.80.1 (FreeBSD)) (envelope-from ) id 1Vjl3c-0002ok-MN; Fri, 22 Nov 2013 11:21:40 +0400 Received: by mail.bsdpad.com (nbSMTP-1.00) for uid 1001 br@mail.bsdpad.com; Fri, 22 Nov 2013 11:21:40 +0400 (MSK) Date: Fri, 22 Nov 2013 11:21:40 +0400 From: Ruslan Bukin To: Olivier Houchard Subject: Re: arm SMP fix Message-ID: <20131122072140.GA709@mail.bsdpad.com> References: <20131122000457.GA44039@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20131122000457.GA44039@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: arm@freebsd.org X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Nov 2013 07:19:25 -0000 On Fri, Nov 22, 2013 at 12:04:57AM +0000, Olivier Houchard wrote: > Hi all, > > Attached is the first draft to a patch that fixes SMP for me, it seems to > work fine on my Pandaboard. > The problem is, as it is currently implemented, curthread is basically > defined as get_pcpu()->pc_curthread. If we get interrupted between the moment > we got the struct pcpu, and the moment we derefence it to get the curthread > pointer, and migrated to another core, we would get the wrong curthread, and > that's not good. > The proposed fix does the following : > - use the register we used to use for pcpu for curthread > - get the pcpu address by reading the cpu id from the CPUID register, and > just use it as an index for the __pcpu array. > > It breaks the KBI, which is unfortunate, but I think it is no big deal for > arm right now. > > Any review, comment, and testing, even on UP boards, would be very welcome. > > Regards, > > Olivier what type of media for root you used? just a quick test on exynos5250 one time I booted OK with patch and SMP enabled, two other attempts got panics (probably during usb ethernet load) http://pastebin.com/H129SMKX http://pastebin.com/szkBjaT5 -Ruslan