]> xenbits.xensource.com Git - people/ssmith/netchannel2-pvops.git/commitdiff
xen/swiotlb: improve comment on gfp flags in xen_alloc_coherent()
authorJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Thu, 12 Mar 2009 17:47:33 +0000 (10:47 -0700)
committerJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Fri, 26 Jun 2009 00:03:46 +0000 (17:03 -0700)
Clarify why we don't care about the kernel's pseudo-phys restrictions,
so long as the underlying pages are in the right place.

[ Impact: cleanup ]

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
drivers/pci/xen-iommu.c

index bc64397b7565dcb4d0ceec9385705e22c671df1f..d09ff914232d0b3a5a1bad073d9358970c745354 100644 (file)
@@ -203,15 +203,17 @@ static void *xen_alloc_coherent(struct device *dev, size_t size,
        unsigned long vstart;
        u64 mask;
 
-       /* ignore region specifiers */
+       /*
+        * Ignore region specifiers - the kernel's ideas of
+        * pseudo-phys memory layout has nothing to do with the
+        * machine physical layout.  We can't allocate highmem
+        * because we can't return a pointer to it.
+        */
        gfp &= ~(__GFP_DMA | __GFP_HIGHMEM);
 
        if (dma_alloc_from_coherent(dev, size, dma_handle, &ret))
                return ret;
 
-       if (dev == NULL || (dev->coherent_dma_mask < DMA_BIT_MASK(32)))
-               gfp |= GFP_DMA;
-
        vstart = __get_free_pages(gfp, order);
        ret = (void *)vstart;