summaryrefslogtreecommitdiffstats
path: root/sys/x86
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2012-02-28 19:42:40 +0000
committeremaste <emaste@FreeBSD.org>2012-02-28 19:42:40 +0000
commit40bea12fa6c45b4cd4dd90cf66c725a362f8e270 (patch)
tree0aa2edfc17575c71bc44dc9625528ddf266b89a5 /sys/x86
parentbfd7a07500d59035447033f67bf7408d4150ce05 (diff)
downloadFreeBSD-src-40bea12fa6c45b4cd4dd90cf66c725a362f8e270.zip
FreeBSD-src-40bea12fa6c45b4cd4dd90cf66c725a362f8e270.tar.gz
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@. Reviewed by: scottl, jhb Sponsored by: Sandvine Incorporated MFC after: 3 days
Diffstat (limited to 'sys/x86')
-rw-r--r--sys/x86/x86/busdma_machdep.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/x86/x86/busdma_machdep.c b/sys/x86/x86/busdma_machdep.c
index 70dd72b..89e0e98 100644
--- a/sys/x86/x86/busdma_machdep.c
+++ b/sys/x86/x86/busdma_machdep.c
@@ -227,6 +227,14 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment,
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;
OpenPOWER on IntegriCloud