From owner-freebsd-current Thu Jan 31 19:24: 8 2002 Delivered-To: freebsd-current@freebsd.org Received: from scaup.prod.itd.earthlink.net (scaup.mail.pas.earthlink.net [207.217.120.49]) by hub.freebsd.org (Postfix) with ESMTP id 0A01337B405; Thu, 31 Jan 2002 19:23:50 -0800 (PST) Received: from pool0289.cvx40-bradley.dialup.earthlink.net ([216.244.43.34] helo=mindspring.com) by scaup.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16WUIZ-0006Ei-00; Thu, 31 Jan 2002 19:23:36 -0800 Message-ID: <3C5A07AE.FE08CC34@mindspring.com> Date: Thu, 31 Jan 2002 19:12:46 -0800 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Peter Wemm Cc: "Cameron, Frank" , 'Kenneth Culver' , David Malone , "'freebsd-bugs@freebsd.org'" , "'freebsd-current@freebsd.org'" Subject: Re: AMD AGP Bug References: <20020201021747.A50863809@overcee.wemm.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Peter Wemm wrote: > > No. FreeBSD does not make active use of 4M pages for anything > > other than the initial kernel text and data, which is obvious, > > if you look at /sys/i386/machdep.c. > > Actually, it is obvious if you actually do look at the pmap.c that we *do* > use 4MB pages for device mappings. The "active use" I was referring to was kernel space, and this sets PG_U, so there are not fault handler invocations on attempts to write the pages. This code also does not set the PG_G bit, like Linux does. This code has a requirement that the address mapping occur on a 4M boundary, and that it be an even multiple of 4M. My reading of the AGPGART kernel module indicates to me that this code is not triggered in normal use. Correct me if my interpretation here is wrong (I'd like to know *how*; the default aperture appears to be 1M, unless it is overridden, and the alignment isn't on the right boundary). In any case, let's say that it gets invoked on the AGP hardware, and establishes a 4M mapping on FreeBSD, as well. I think the Linux problem has more to do with having *both* 4K and 4M mappings to the same physical memory area at the same time. FreeBSD avoids doing this to active pages; the initial setup replaces the PDE and "loses" the 4K worth of 4K mapping tables, and the later code that you reference doesn't replace any existing entries. It's accidental, but still, it should mean that FreeBSD is not succeptible to the problem. The real hint in characterizing the problem is to ask "why does it happen with 4M pages, but doesn't also happen with 4K pages?". This indicates that the problem is really a TLB problem, and therefore a real processor problem: the problem should happen no matter what, if it's a problem with writing to mapped memory use by the AGP not giving an invalidation signal to the CPU on writes, rather than a problem in the CPUs handling of 4M page invalidation itself, a problem that does not exist in the 4K invalidation case. Unfortuantely, I would need to upgrade both my FreeBSD and my XFree86 to try this with the AGP on my AMD box (it has a 0x7121 ID, and so can't GARTIOCINFO correctly) to be able to even try to repeat the problem, and Fry's does not appear to be selling FreeBSD CDROM sets any more, even with the books attached. 8-(. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message