From owner-freebsd-mips@FreeBSD.ORG Mon Apr 22 17:59:34 2013 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3746258E for ; Mon, 22 Apr 2013 17:59:34 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com [209.85.217.169]) by mx1.freebsd.org (Postfix) with ESMTP id B3D461AB5 for ; Mon, 22 Apr 2013 17:59:33 +0000 (UTC) Received: by mail-lb0-f169.google.com with SMTP id p11so5958209lbi.14 for ; Mon, 22 Apr 2013 10:59:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=v+lXtquuyr7jbuXFN5u7UvaLl4J30GEaQ8ChtlkOoMg=; b=ge+saXq5DcBkqw3w9JuKdQYq+5arDSNLqj1mRFmAScIxY12lGaj5SbElzx9fiWgJZf k9TuCRygNuUrVy6X/LhJwYXTKQRC+Ru5QdUk4MfyofvwtD2vaEdjBMa9Lgv1LeVlYZCA yFkki19GdC6f6NPVmnJtZLLWYkfziY8CNf8593bInR4QOY5x1VD45FPFpg8uUtAwW7Ta SdnjKf4KxCnkfRI8p+PmJKPvyrCpsvRUZ8pId/66Iw0C0561cVMd7hKFplKLtdF1l8wB 11wEA0LHEvQq0tjRjhanV94IfBUMYSBZrUr60V8Okt9U6BJwFZpctcC+x72Mjag+xz3k SEDA== X-Received: by 10.152.115.173 with SMTP id jp13mr7170911lab.49.1366653572359; Mon, 22 Apr 2013 10:59:32 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.152.28.196 with HTTP; Mon, 22 Apr 2013 10:59:11 -0700 (PDT) In-Reply-To: References: <201304220300.r3M301iY093070@freefall.freebsd.org> <51753506.3070901@rewt.org.uk> From: Juli Mallett Date: Mon, 22 Apr 2013 10:59:11 -0700 X-Google-Sender-Auth: akgkera1aMIGxVnlih6fuoylMzA Message-ID: Subject: Re: kern/177876: [mips] kernel stack overflow panic on mips64, EdgeRouter Lite To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQnJipTsJn6XsyJEaXaBhiQFGQAEQQLNHIiQkVNq2HI2WPjlYqQcWah83ygGqB9l3XnyRqhD Cc: Joe Holden , "freebsd-mips@FreeBSD.org" X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2013 17:59:34 -0000 On Mon, Apr 22, 2013 at 10:35 AM, Adrian Chadd wrote: > Do an svn log in sys/mips/ or sys/vm/ and look at the changes. > > I don't know how far you can go back before you don't have the > edgerouter lite support, but maybe you can try going back to when Juli > initially committed it, and then just work your way forward. > > I think Juli did the initial work, so she knows when it came in. > > juli - I don't suppose you could spin up FreeBSD-HEAD on the > edgerouter lite and take a look? It's highly likely someone messed up > since you did your port. :( I can't quite imagine why EdgeRouter Lite (or Octeon more generally) could be a special case here; I'd be more inclined to think it was generally 64-bit MIPS that would be broken. (A too-conservative definition or something.) Except I was pretty sure I'd run -CURRENT more recently than those changes. The only change that is suspect in mips/ since I made my changes is Warner's change to include/regnum.h, which looks like there's the slim possibility that it could screw up register saving in N64 builds. That would mean that it wasn't tested with a 64-bit build, though, which I'm sure Warner wouldn't be so sloppy as to do. Joe, can you try reverting 249523 and seeing if that fixes things for you? It seems like this breaks the order of registers saved to the PCB, which would break syscalls with more than 4 arguments, like mmap. Even just looking at how the macros expand in the N64 case makes it pretty clear that this change was made clumsily, e.g. from exception.S: SAVE_REG($12, 8, $29) SAVE_REG($13, 9, $29) SAVE_REG($14, 10, $29) SAVE_REG($15, 11, $29) SAVE_REG($8, 12, $29) SAVE_REG($9, 13, $29) SAVE_REG($10, 14, $29) SAVE_REG($11, 15, $29) For this to not break syscalls, struct trapframe would need to be updated, or the syscall handling code. Joe, can you confirm that backing out 249523 fixes things for you? If it does, Adrian, would you be willing to handle a backout? I can't imagine finding the time for a couple of days, and if this is really so badly, unnecessarily broken, that should be fixed immediately. I hope I'm wrong. Nobody should be making incomplete changes on the basis of a half-baked reading of purportedly-conflicting documentation, and without testing. Yikes! If, as I really, really hope, that change isn't the problem, it's not clear to me that would be the culprit. Thanks, Juli.