From: Jeremy Fitzhardinge Date: Thu, 12 Mar 2009 17:47:33 +0000 (-0700) Subject: xen/swiotlb: improve comment on gfp flags in xen_alloc_coherent() X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=b2ba00793a2ff8e92d7334af198d02cd0bec97d2;p=people%2Fssmith%2Fnetchannel2-pvops.git xen/swiotlb: improve comment on gfp flags in xen_alloc_coherent() 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 --- diff --git a/drivers/pci/xen-iommu.c b/drivers/pci/xen-iommu.c index bc64397b756..d09ff914232 100644 --- a/drivers/pci/xen-iommu.c +++ b/drivers/pci/xen-iommu.c @@ -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;