From owner-freebsd-mips@FreeBSD.ORG Sun Jan 26 23:37:12 2014 Return-Path: Delivered-To: freebsd-mips@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 E38BEC31 for ; Sun, 26 Jan 2014 23:37:12 +0000 (UTC) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com [209.85.217.170]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 66E4317AB for ; Sun, 26 Jan 2014 23:37:11 +0000 (UTC) Received: by mail-lb0-f170.google.com with SMTP id u14so4021570lbd.29 for ; Sun, 26 Jan 2014 15:37:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=QVWP9YCfbr+7PKdHKBxUfC6qSYB94BeA1aFrJqvA2Rw=; b=eBMw2ZFbkzh0UiJAraTmF/FNmkWAO68NlVFVg9o1E6nBfCj/S3ZDpPaLv2Bb6FW/cY bR2uIAUnVDVKTSUibuDCjWl4g4LHcsN2kFyX9YjyVRmxpcG72iIIZh7uguqlYwhggoez twYBqxbw3R9/nkSh0w4H9mzoKKv8x9ZB8a7BvRq72BTE/b1XTpRDaw9tW4fpYnrh5nGW qKJnFixW+TwFoIme1TG99LTpAG23LRHHHlJULz2cKr7eIhMVe9bnNV16htucTVRwutJs XpqB1niudshSJFOfy68QhXcnXFo2Ei581/69O6OBTQXafFeVQ/rAwV03ir0kR5VWkgKe s6Jg== X-Gm-Message-State: ALoCoQnWjZZnTJ/pzRr0T4ga6Q5MW8ay/YJtOagLjOsh9wCQ5iWZiLy3ilDiwrvnMYI0LyOg0mfK X-Received: by 10.152.43.103 with SMTP id v7mr226993lal.46.1390779078269; Sun, 26 Jan 2014 15:31:18 -0800 (PST) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.152.129.170 with HTTP; Sun, 26 Jan 2014 15:30:58 -0800 (PST) In-Reply-To: <453F8F8F-41E5-4640-9683-5A8553AB0822@bsdimp.com> References: <52E42A1B.3040907@rewt.org.uk> <52E524BD.7090106@rlwinm.de> <453F8F8F-41E5-4640-9683-5A8553AB0822@bsdimp.com> From: Juli Mallett Date: Sun, 26 Jan 2014 15:30:58 -0800 X-Google-Sender-Auth: HJ_6pF84C7fpzP18QOIUibRa_5Y Message-ID: Subject: Re: More trapframe panics To: Warner Losh Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: "freebsd-mips@FreeBSD.org" X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2014 23:37:13 -0000 Robert Watson and someone else (IIRC) discouraged going this route as some CPUs do not actually support every PageMask value specified for the R4K, so it would turn into an implementation/maintenance nightmare. Being able to fill an arbitrary number of TLB entries with kernel stack seems just better, anyway, for, I dunno, the person who wants to run Python in the kernel or something :) On Sun, Jan 26, 2014 at 10:54 AM, Warner Losh wrote: > > On Jan 26, 2014, at 9:04 AM, Juli Mallett wrote: > > > On Sun, Jan 26, 2014 at 7:07 AM, Jan Bramkamp wrote: > >> > >> Would increasing KSTACK_PAGES from two to three or four help? What are > >> the trade-offs involved in choosing KSTACK_PAGES for something like the > >> EdgeMax Lite? > > > > > > That's exactly what needs to happen in all 64-bit MIPS kernels. Unlike > > some other architectures, KSTACK_PAGES cannot simply be increased, > > however. All of the code which handles loading the kernel stack and > > keeping it mapped, etc., assumes that it takes up exactly one TLB entry, > > i.e. 2 pages. One could simply double KSTACK_PAGES for 64-bit builds and > > modify the code to support the case of 2 or 4 pages, which would keep the > > code as gross as it is today and not buy much flexibility, but might be > > worthwhile as a short-term fix. Being able to support arbitrary values > of > > KSTACK_PAGES (or at least arbitrary multiples of 2 up to the maximum > number > > of wired TLB entries times 2) would be better. > > I hacked together a kludge that quadrupled this by going to the next > larger page size for stack pages in the TLB, but hit something ugly when I > did that... But I've lost that code, so maybe I should try again to see if > I'm more clever the second time. > > This is one of the things that makes it hard to have a nice native build > server on mips64... > > Warner > >