From owner-freebsd-current@FreeBSD.ORG Mon Sep 8 21:30:54 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F14F10656B5 for ; Mon, 8 Sep 2008 21:30:54 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 32CD48FC20 for ; Mon, 8 Sep 2008 21:30:54 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from zion.baldwin.cx (zion.baldwin.cx [IPv6:2001:470:1f11:75:2a0:d2ff:fe18:8b38]) (authenticated bits=0) by server.baldwin.cx (8.14.2/8.14.2) with ESMTP id m88LUZtR096483; Mon, 8 Sep 2008 17:30:41 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-current@freebsd.org, ticso@cicely.de Date: Mon, 8 Sep 2008 17:25:05 -0400 User-Agent: KMail/1.9.7 References: <20080903034943.GD11548@cicely7.cicely.de> <20080904015507.GA15328@cicely7.cicely.de> <20080904020215.GB15328@cicely7.cicely.de> In-Reply-To: <20080904020215.GB15328@cicely7.cicely.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200809081725.06220.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:2001:470:1f11:75::1]); Mon, 08 Sep 2008 17:30:42 -0400 (EDT) X-Virus-Scanned: ClamAV 0.93.1/8162/Thu Sep 4 12:38:45 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: David Malone , Bernd Walter Subject: Re: MTRR fixup? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Sep 2008 21:30:54 -0000 On Wednesday 03 September 2008 10:02:15 pm Bernd Walter wrote: > On Thu, Sep 04, 2008 at 03:55:07AM +0200, Bernd Walter wrote: > > On Thu, Sep 04, 2008 at 01:46:42AM +0200, Bernd Walter wrote: > > > On Wed, Sep 03, 2008 at 09:47:59PM +0100, David Malone wrote: > > > > On Wed, Sep 03, 2008 at 05:49:44AM +0200, Bernd Walter wrote: > > > > > Some boards (including my Intel DG33BU) seem to have problems > > > > > setting up the mtrr to cache all RAM. > > > > > My system runs fast with 2G and ist about 6 times slower in > > > > > buildworld with 6G RAM. > > > > > I will try a BIOS update once Intels tells me why their update ISO > > > > > just turn the system off instead of updating the BIOS - sigh. > > > > > But it seems that Linux is doing some kind of fixup for MTRR: > > > > > http://lkml.org/lkml/2008/1/18/170 > > > > > Can we do something similar? > > > > > > > > You may be able to fix this by just using the memcontrol command - > > > > it already lets you program the MTRRs. > > > > > > Oh damn - a new fancy tool to play with ;-) > > > > > > Interesting - the values look good: > > > [...] > > > 0x0/0x80000000 ticso write-back active > > > 0x80000000/0x40000000 ticso write-back active > > > 0xc0000000/0x10000000 ticso write-back active > > > 0xcf800000/0x800000 BIOS uncacheable set-by-firmware active > > > 0xcf400000/0x400000 BIOS uncacheable set-by-firmware active > > > 0x100000000/0x80000000 ticso write-back active > > > 0x180000000/0x20000000 ticso write-back active > > > 0x0/0x1000000000 - uncacheable > > > > Ok - there it is - something is missing: > > ram0 > > I/O memory addresses: > > 0x0-0x9c3ff > > 0x100000-0xcf212fff > > 0xcf215000-0xcf2fafff > > 0xcf3e5000-0xcf3e8fff > > 0xcf3f2000-0xcf3f2fff > > 0xcf3ff000-0xcf3fffff > > 0x100000000-0x1abffffff > > > > ram goes up to 0x1abffffff mtrr just goes up to 0x1a0000000 - 1, so the > > last 192MB are uncached. > > But memcontrol complains when trying to add the range: > > [55]cicely14# memcontrol set -b 0x1a0000000 -l 0xc000000 -o ticso > > write-back memcontrol: can't set range: Invalid argument > > Ok - I more or less got it. > I have to set 2^n ranges. > The first one goes: > [56]cicely14# memcontrol set -b 0x1a0000000 -l 0x8000000 -o ticso > write-back The second not: > [57]cicely14# memcontrol set -b 0x1a8000000 -l 0x4000000 -o ticso > write-back memcontrol: can't set range: No space left on device > Exit 1 You ran out of variable range MTRRs. You probably don't have any devices using memory space above the end of RAM, so you can probably do: memcontrol set -b 0x1a0000000 -l 0x10000000 and just lie about that last 64MB or so of address space. -- John Baldwin