From owner-cvs-src@FreeBSD.ORG Fri Mar 7 13:36:39 2008 Return-Path: Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D7D5106566C; Fri, 7 Mar 2008 13:36:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 6C84C8FC2B; Fri, 7 Mar 2008 13:36:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m27Dad18045914; Fri, 7 Mar 2008 13:36:39 GMT (envelope-from jhb@repoman.freebsd.org) Received: (from jhb@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m27DadeQ045913; Fri, 7 Mar 2008 13:36:39 GMT (envelope-from jhb) Message-Id: <200803071336.m27DadeQ045913@repoman.freebsd.org> From: John Baldwin Date: Fri, 7 Mar 2008 13:36:39 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/dev/agp agp_nvidia.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2008 13:36:39 -0000 jhb 2008-03-07 13:36:39 UTC FreeBSD src repository Modified files: sys/dev/agp agp_nvidia.c Log: Calculate the number of pages the GATT spans when reading from each page to flush the TLB instead of hardcoding a size of 33 pages. Apertures of 32MB and 64MB only use a 16 page GATT and an aperture of 128MB only uses a 32 page GATT, so without this the code could walk off the end of the pointer and cause a page fault if the next page was unmapped. Also, for aperture sizes > 128MB, not all of the pages would be read. The Linux driver has the same bug. MFC after: 1 week Tested by: Frédéric PRACA frederic.praca of freebsd-fr.org Revision Changes Path 1.14 +4 -3 src/sys/dev/agp/agp_nvidia.c