From owner-freebsd-arm@FreeBSD.ORG Mon Nov 25 12:49:03 2013 Return-Path: Delivered-To: arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E848B657; Mon, 25 Nov 2013 12:49:03 +0000 (UTC) Received: from mail-qa0-x22c.google.com (mail-qa0-x22c.google.com [IPv6:2607:f8b0:400d:c00::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9D27726E4; Mon, 25 Nov 2013 12:49:03 +0000 (UTC) Received: by mail-qa0-f44.google.com with SMTP id i13so2972671qae.10 for ; Mon, 25 Nov 2013 04:49:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=aGwkI8nIVJ0s4ch/KaPJ6DBKwSaeMaVhIiVmhn2kcVg=; b=XzjxG755+NbXo2WKuwZSoPRsOgpqz6vABy4Ts691UrX7SIBF5ILH72d7mNSTk4ZjN3 33TVoaubCB76w7agGyW0mp+bMCASUDrXHUaBqkUbPVwOvAmMiY3Psr6flmdKTjkemICC uxU2XmMYCnyGp2DOS0uBHVFQQ8oB1c+xBiH29+rynRRTc3czsmk0I3UcfpGFCRMCJU/n OoNoDN1w2FYBOVxk0KK61e/GE1CogxRZe81WJkKtO46KS9BYOVU/6qFuk+d3zNibfxO6 aunn5cvHnVFqpvizeWqxD8ZCi2QjIFBUfDhtdch+pR6QZ+uok+OXujvorm6iRJsXLE3i v4tA== MIME-Version: 1.0 X-Received: by 10.49.76.7 with SMTP id g7mr15390068qew.25.1385383742778; Mon, 25 Nov 2013 04:49:02 -0800 (PST) Received: by 10.140.85.146 with HTTP; Mon, 25 Nov 2013 04:49:02 -0800 (PST) In-Reply-To: <20131122000457.GA44039@freebsd.org> References: <20131122000457.GA44039@freebsd.org> Date: Mon, 25 Nov 2013 13:49:02 +0100 Message-ID: Subject: Re: arm SMP fix From: Svatopluk Kraus To: Olivier Houchard Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.16 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: Mon, 25 Nov 2013 12:49:04 -0000 Hi, we use another approach to the problem at work for now. So, I have only one comment. Can be explicitly stated in commit that PCPU_GET() is not needed to be atomic? Otherwise, it will look that problem with curthread is solved but similar problem with PCPU_GET() starts up. In fact, atomicity of PCPU_GET() must be ensured in code where is used. Svatopluk Kraus On Fri, Nov 22, 2013 at 1:04 AM, 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 > > _______________________________________________ > freebsd-arm@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arm > To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org" >