From owner-freebsd-arm@FreeBSD.ORG Thu Mar 20 07:42:36 2014 Return-Path: Delivered-To: freebsd-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 A9A249D for ; Thu, 20 Mar 2014 07:42:36 +0000 (UTC) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 635A2E8A for ; Thu, 20 Mar 2014 07:42:35 +0000 (UTC) Received: by mail-ve0-f176.google.com with SMTP id cz12so477410veb.7 for ; Thu, 20 Mar 2014 00:42:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=Ngaoguk+nvNoxrxKzD3bIG2dzy3EweWyA+SDJr0K0ZU=; b=ihvV5mG5+4Yfp0xGXAKUaIT+7hMfGKYTndaMSexouXbQUJ8wddyc1+KQhOXu68kE/Q xKj+sJNfSOofaei8KTgFWhnaCgCaUCeXhRu0JwSESuic1KtbofC3Q7KfeUJa0GhdyTzU 8ebxTCXp0B8cvVyE4WcYGIQonuoHjKV3Mx6l1hINkiz21I9b2GhAbr4Gce/fbNN/3Nov OhhsTCcrn7v/ZJ9rbz551ix/sPjbuzuyDfOi+wm8kRoIvMdyBZEYZmQw4Bz6l/FwAfRp pcdPOPr1gtqIqVTaODBU/Bcs6e6JWWT210VQlwCLlVAIBONzD7rwjF00CcaqIpVTWLkO FNaw== X-Gm-Message-State: ALoCoQkViJK907cWjCkkqD/Bbc6FOGLgQmUP5V3Ybz6e4GepHuifva105/nfxx+gH2yMqXDBviTI MIME-Version: 1.0 X-Received: by 10.52.18.70 with SMTP id u6mr28424353vdd.11.1395301348049; Thu, 20 Mar 2014 00:42:28 -0700 (PDT) Received: by 10.220.209.135 with HTTP; Thu, 20 Mar 2014 00:42:27 -0700 (PDT) In-Reply-To: <1395254911.80941.9.camel@revolution.hippie.lan> References: <20131220125638.GA5132@mail.bsdpad.com> <20131222092913.GA89153@mail.bsdpad.com> <20131222123636.GA61193@ci0.org> <1395149146.1149.586.camel@revolution.hippie.lan> <1395254911.80941.9.camel@revolution.hippie.lan> Date: Thu, 20 Mar 2014 08:42:27 +0100 Message-ID: Subject: Re: arm SMP on Cortex-A15 From: Wojciech Macek To: Ian Lepore Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: freebsd-arm@freebsd.org X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 07:42:36 -0000 Hi Ian, Thanks, I looked at your patch and tried to run it. Unfortunatelly, it is still something wrong on A15 core. Your changes in pmap_kenter_internal do cause panics during startup. Apparently we still need to do cpu_tlb_flushID_SE(va) at the end of that function... but that is weird. I made this small "fix" and I'm able to boot the system. I'm going to run stress tests now to see if it is stable. Regarding DEBUG, that is really interesting. It you see that on A9 that seems to be even worse, because suggests a flaw in pmap logic... Wojtek 2014-03-19 19:48 GMT+01:00 Ian Lepore : > On Tue, 2014-03-18 at 07:25 -0600, Ian Lepore wrote: > > On Mon, 2014-03-17 at 09:29 +0100, Wojciech Macek wrote: > > > Hi, > > > > > > Finally I've found some time to continue SMP hacking. It seems that I > > > isolated the tlb/pmam failures and developed two simple patches that > help. > > > There are still some pmap changes and TEX remap left, but I don't want > to > > > use them now. > > > > https://drive.google.com/folderview?id=0B-7yTLrPxaWtSzZPUGgtM3pnUjg&usp=sharing > > > * 01 - ensure that TTB is set before TLB invalidation and flush BTB to > > > comply the specs > > > * 02 - add missing TLB invalidations to pmap and fix invalidation order > > > > > > I chose buildworld -j4 as a stresstest, and run it on Arndale (USB > rootfs) > > > and a different 4-core a15 chip (SATA rootfs). On both setups test > passed > > > and was significantly faster than the one with previous patchset. > > > > > > I'd like to submit these changes to FreeBSD tree (with some help from > our > > > local committers), so any comments and testing are really appreciated. > > > > > > Best regards, > > > Wojtek > > > > The first patch looks fine and is working without any problems for me. > > > > For the second patch, I propose the attached similar patch which > > combines your changes with some I got from Olivier. The main > > differences are moving the tlb flush outside the loop when propagating a > > change to all L1s, and moving the tlb flush (rather than adding another) > > in pmap_kenter_internal(). > > > > I believe even with the second patch there may still be some missing tlb > > flushes. > > > > -- Ian > > Following up with a third version of the pmap-v6.c patch. On top of the > previous versions, this: > > * ensures that cpu_cpwait() is consistantly used after every tlb > flush (sometimes it's a single wait after flushes that happen in > a loop). > * adds a tlb flush to pmap_free_l2_bucket() > * adds a tlb flush to pmap_bootstrap() > * adds a tlb flush to pmap_grow_map() > * adds a tlb flush to pmap_grow_l2_bucket() > * adds a tlb flush to pmap_kenter_section() > > I'm not sure there's any armv6/7 platform that needs the cpu_cpwait(), > but if it's going to appear in the code at all, it should at least be > consisant. :) > > -- Ian > >