diff --git a/arch/x86/xen/pci-swiotlb.c b/arch/x86/xen/pci-swiotlb.c index ecdbfe2..7fdfccc 100644 --- a/arch/x86/xen/pci-swiotlb.c +++ b/arch/x86/xen/pci-swiotlb.c @@ -960,7 +960,7 @@ xen_swiotlb_fixup(void *buf, size_t size, unsigned long nslabs) dma_bits); } while (rc && dma_bits++ < max_dma_bits); if (rc) - panic(KERN_ERR "xen_create_contiguous_region failed\n"); + panic(KERN_ERR "xen_create_contiguous_region failed: rc: %d\n", rc); i += slabs; } while(i < nslabs); @@ -984,7 +984,16 @@ static struct dma_map_ops xen_swiotlb_dma_ops = { void __init xen_swiotlb_init(void) { - if (xen_domain()) { + int use_swiotlb = 0; + + if (xen_initial_domain()) + use_swiotlb = 1; + + /* For PV guest, only if iommu=soft is passed in. */ + if (xen_pv_domain() && !xen_initial_domain() && swiotlb) + use_swiotlb = 1; + + if (use_swiotlb) { printk(KERN_INFO "PCI-DMA: Using Xen software bounce buffering for IO (Xen-SWIOTLB)\n"); xen_swiotlb_init_with_default_size(64 * (1<<20)); /* default to 64MB */ dma_ops = &xen_swiotlb_dma_ops;