From owner-svn-src-all@FreeBSD.ORG Fri Jul 6 18:12:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DBEE91065673; Fri, 6 Jul 2012 18:12:18 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 705E38FC0C; Fri, 6 Jul 2012 18:12:18 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q66ICQKm045913; Fri, 6 Jul 2012 21:12:26 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q66ICDRH019227; Fri, 6 Jul 2012 21:12:13 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q66ICDUQ019226; Fri, 6 Jul 2012 21:12:13 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 6 Jul 2012 21:12:13 +0300 From: Konstantin Belousov To: Marcel Moolenaar Message-ID: <20120706181213.GI2338@deviant.kiev.zoral.com.ua> References: <201207061557.q66Fv45N069464@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2xeD/fx0+7k8I/QN" Content-Disposition: inline In-Reply-To: <201207061557.q66Fv45N069464@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238172 - head/sys/dev/agp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2012 18:12:19 -0000 --2xeD/fx0+7k8I/QN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 06, 2012 at 03:57:04PM +0000, Marcel Moolenaar wrote: > Author: marcel > Date: Fri Jul 6 15:57:03 2012 > New Revision: 238172 > URL: http://svn.freebsd.org/changeset/base/238172 >=20 > Log: > agp.c: > Don't use Maxmem when the amount of memory is meant. Use realmem instea= d. > Maxmem is not only a MD variable, it represents the highest physical me= mory > address in use. On systems where memory is sparsely layed-out the highe= st > memory address and the amount of memory are not interchangeable. Scalin= g the > AGP aperture based on the actual amount of memory (=3D realmem) rather = than > the available memory (=3D physmem) makes sure there's consistent behavi= our > across architectures. > =20 > agp_i810.c: > While arguably the use of Maxmem can be considered correct, replace its= use > with realmem anyway. agp_i810.c is specific to amd64, i386 & pc98, which > have a dense physical memory layout. Avoiding Maxmem here is done with = an > eye on copy-n-paste behaviour in general and to avoid confusion caused = by > using realmem in agp.c and Maxmem in agp_i810.c. The agp_i810.c use is to prevent attachment when largest physical address of populated memory exceeds GPU limits established by PTE format and chipset errata. Editing Maxmem to be spelled as realmem seems to change nothing right now, but I do argue that this is wrong, and commit message makes future archeology quite confusing. > =20 > In both cases, remove the inclusion of md_var.h >=20 > Modified: > head/sys/dev/agp/agp.c > head/sys/dev/agp/agp_i810.c >=20 > Modified: head/sys/dev/agp/agp.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/agp/agp.c Fri Jul 6 15:46:38 2012 (r238171) > +++ head/sys/dev/agp/agp.c Fri Jul 6 15:57:03 2012 (r238172) > @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); > #include > #include > =20 > -#include > #include > #include > #include > @@ -234,7 +233,7 @@ agp_generic_attach(device_t dev) > * Work out an upper bound for agp memory allocation. This > * uses a heurisitc table from the Linux driver. > */ > - memsize =3D ptoa(Maxmem) >> 20; > + memsize =3D ptoa(realmem) >> 20; > for (i =3D 0; i < agp_max_size; i++) { > if (memsize <=3D agp_max[i][0]) > break; >=20 > Modified: head/sys/dev/agp/agp_i810.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/agp/agp_i810.c Fri Jul 6 15:46:38 2012 (r238171) > +++ head/sys/dev/agp/agp_i810.c Fri Jul 6 15:57:03 2012 (r238172) > @@ -74,7 +74,6 @@ __FBSDID("$FreeBSD$"); > =20 > #include > #include > -#include > #include > =20 > MALLOC_DECLARE(M_AGP); > @@ -1439,7 +1438,7 @@ agp_i810_attach(device_t dev) > if (error) > return (error); > =20 > - if (ptoa((vm_paddr_t)Maxmem) > > + if (ptoa((vm_paddr_t)realmem) > > (1ULL << sc->match->driver->busdma_addr_mask_sz) - 1) { > device_printf(dev, "agp_i810 does not support physical " > "memory above %ju.\n", (uintmax_t)(1ULL << --2xeD/fx0+7k8I/QN Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk/3KnwACgkQC3+MBN1Mb4hiKQCgn1NuIpG7znvtNOjeueP8FG1o YYYAn3SlmhlhtHbxlfti65lktViYUsbu =j6vY -----END PGP SIGNATURE----- --2xeD/fx0+7k8I/QN--