From owner-svn-src-stable-9@FreeBSD.ORG Fri Mar 2 00:21:08 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 989BA106566C; Fri, 2 Mar 2012 00:21:08 +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 875C48FC1B; Fri, 2 Mar 2012 00:21:08 +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 q220L87G004557; Fri, 2 Mar 2012 00:21:08 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q220L801004555; Fri, 2 Mar 2012 00:21:08 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201203020021.q220L801004555@svn.freebsd.org> From: Ed Maste Date: Fri, 2 Mar 2012 00:21:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232372 - stable/9/sys/x86/x86 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Mar 2012 00:21:08 -0000 Author: emaste Date: Fri Mar 2 00:21:07 2012 New Revision: 232372 URL: http://svn.freebsd.org/changeset/base/232372 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@. Sponsored by: Sandvine Incorporated Modified: stable/9/sys/x86/x86/busdma_machdep.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/x86/x86/busdma_machdep.c ============================================================================== --- stable/9/sys/x86/x86/busdma_machdep.c Fri Mar 2 00:15:52 2012 (r232371) +++ stable/9/sys/x86/x86/busdma_machdep.c Fri Mar 2 00:21:07 2012 (r232372) @@ -227,6 +227,14 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_dma_tag_t newtag; int error = 0; + /* Always enforce at least a 4GB (2GB for PAE) boundary. */ +#if defined(__amd64__) + if (boundary == 0 || boundary > ((bus_addr_t)1 << 32)) + boundary = (bus_size_t)1 << 32; +#elif defined(PAE) + 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;