From owner-freebsd-mips@FreeBSD.ORG Mon Apr 22 18:56:02 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 D331C912 for ; Mon, 22 Apr 2013 18:56:02 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-oa0-f53.google.com (mail-oa0-f53.google.com [209.85.219.53]) by mx1.freebsd.org (Postfix) with ESMTP id 9D4AF1E66 for ; Mon, 22 Apr 2013 18:56:02 +0000 (UTC) Received: by mail-oa0-f53.google.com with SMTP id m6so6371587oag.12 for ; Mon, 22 Apr 2013 11:56:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to:x-mailer:x-gm-message-state; bh=7xK1R0CC7CCaY4g1WwuD3glfdVdi2jr+ckP+vnVedl0=; b=d46qL3ICRO9y9h7N1ZGN3Ig1U0D6rrbRZO6A34uLPff3ufSYWmLb0IEKc7wDO/SyYc +xamkaWoWP4Zg884Y36xaEMJwc1NaFjAZM/CsQVckTN5gKgLvn0QV/W8ZkrtAi69ViOI EjMHKJAtf+vjgsbepCAJ5ECUAYfigGmn/GdCXlW86H/DY4hbfWYidBn7cr4bk2bsAu+1 M1k/Rv+wDscg0DNLOflMRPGhqn7fdiz1kPVgvdvfEd2/9ZuwjLfzGxA17Fl8vYAFVwDB vy2nqMYEujZ5CVsLiP4lyHijL9Fjgl0TDeQS9wXv7fMl7oxPNgsydIlAskutt0V8K3hL If/A== X-Received: by 10.182.111.199 with SMTP id ik7mr10252925obb.44.1366656524950; Mon, 22 Apr 2013 11:48:44 -0700 (PDT) Received: from fusionlt2834a.int.fusionio.com ([209.117.142.2]) by mx.google.com with ESMTPS id qj8sm20133408oeb.2.2013.04.22.11.48.42 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Apr 2013 11:48:43 -0700 (PDT) Sender: Warner Losh Subject: Re: kern/177876: [mips] kernel stack overflow panic on mips64, EdgeRouter Lite Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Mon, 22 Apr 2013 12:48:41 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <2AF8E78E-01E0-4E2E-B94C-83D36FB63028@bsdimp.com> References: <201304220300.r3M301iY093070@freefall.freebsd.org> <51753506.3070901@rewt.org.uk> To: Juli Mallett X-Mailer: Apple Mail (2.1085) X-Gm-Message-State: ALoCoQmVOZris+4jHP6f+PRXV8IMrDScy8oTYe5KtGtJZZOFurZ9VqhuulYSEz7A8RLBIU6zxjnm 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 18:56:03 -0000 On Apr 22, 2013, at 11:59 AM, Juli Mallett wrote: > 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. >>=20 >> 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. >>=20 >> I think Juli did the initial work, so she knows when it came in. >>=20 >> 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. :( >=20 > 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. >=20 > 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. >=20 > 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: >=20 > 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) >=20 > 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! I was pretty sure that I booted it first... The changes weren't really = due to the conflicting docs, but rather just flat out saving the wrong = things in the n32/n64 case. > If, as I really, really hope, that change isn't the problem, it's not > clear to me that would be the culprit. I can back it out, if need be. I can test it again later today, but I'm = busy for the next two hours. Warner=