From owner-svn-src-all@FreeBSD.ORG Thu Mar 1 19:43:28 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 DFF0F106566C; Thu, 1 Mar 2012 19:43:28 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B4DA98FC19; Thu, 1 Mar 2012 19:43:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q21JhSqO093258; Thu, 1 Mar 2012 19:43:28 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q21JhSgV093255; Thu, 1 Mar 2012 19:43:28 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201203011943.q21JhSgV093255@svn.freebsd.org> From: Ed Maste Date: Thu, 1 Mar 2012 19:43:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232354 - in stable/8/sys: amd64/amd64 i386/conf i386/i386 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: Thu, 01 Mar 2012 19:43:29 -0000 Author: emaste Date: Thu Mar 1 19:43:28 2012 New Revision: 232354 URL: http://svn.freebsd.org/changeset/base/232354 Log: MFC r232267: Workaround for PCIe 4GB boundary issue Enforce a boundary of no more than 4GB - transfers crossing a 4GB boundary can lead to data corruption due to PCIe limitations. This change is a less-intrusive workaround that can be quickly merged back to older branches; a cleaner implementation will arrive in HEAD later but may require KPI changes. This change is based on a suggestion by jhb@. Approved by: re Reviewed by: jhb (MFC) Reviewed by: jhb, scottl (original) Sponsored by: Sandvine Incorporated Modified: stable/8/sys/amd64/amd64/busdma_machdep.c stable/8/sys/i386/i386/busdma_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/i386/conf/XENHVM (props changed) Modified: stable/8/sys/amd64/amd64/busdma_machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/busdma_machdep.c Thu Mar 1 19:17:56 2012 (r232353) +++ stable/8/sys/amd64/amd64/busdma_machdep.c Thu Mar 1 19:43:28 2012 (r232354) @@ -216,6 +216,10 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_dma_tag_t newtag; int error = 0; + /* Always enforce at least a 4GB boundary. */ + if (boundary == 0 || boundary > ((bus_addr_t)1 << 32)) + boundary = (bus_size_t)1 << 32; + /* Basic sanity checking */ if (boundary != 0 && boundary < maxsegsz) maxsegsz = boundary; Modified: stable/8/sys/i386/i386/busdma_machdep.c ============================================================================== --- stable/8/sys/i386/i386/busdma_machdep.c Thu Mar 1 19:17:56 2012 (r232353) +++ stable/8/sys/i386/i386/busdma_machdep.c Thu Mar 1 19:43:28 2012 (r232354) @@ -226,6 +226,12 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_dma_tag_t newtag; int error = 0; +#if defined(PAE) + /* Need at least a 4GB boundary, PAE limitations require 2GB */ + if (boundary == 0 || boundary > ((bus_addr_t)1 << 31)) + boundary = (bus_size_t)1 << 31; +#endif + /* Basic sanity checking */ if (boundary != 0 && boundary < maxsegsz) maxsegsz = boundary;