diff options
| -rw-r--r-- | arch/x86/xen/pci-swiotlb-xen.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/x86/xen/pci-swiotlb-xen.c b/arch/x86/xen/pci-swiotlb-xen.c index b6a534002ab2..1c1722761eec 100644 --- a/arch/x86/xen/pci-swiotlb-xen.c +++ b/arch/x86/xen/pci-swiotlb-xen.c | |||
| @@ -8,6 +8,11 @@ | |||
| 8 | #include <xen/xen.h> | 8 | #include <xen/xen.h> |
| 9 | #include <asm/iommu_table.h> | 9 | #include <asm/iommu_table.h> |
| 10 | 10 | ||
| 11 | #ifdef CONFIG_X86_64 | ||
| 12 | #include <asm/iommu.h> | ||
| 13 | #include <asm/dma.h> | ||
| 14 | #endif | ||
| 15 | |||
| 11 | int xen_swiotlb __read_mostly; | 16 | int xen_swiotlb __read_mostly; |
| 12 | 17 | ||
| 13 | static struct dma_map_ops xen_swiotlb_dma_ops = { | 18 | static struct dma_map_ops xen_swiotlb_dma_ops = { |
| @@ -49,6 +54,15 @@ int __init pci_xen_swiotlb_detect(void) | |||
| 49 | * the 'swiotlb' flag is the only one turning it on. */ | 54 | * the 'swiotlb' flag is the only one turning it on. */ |
| 50 | swiotlb = 0; | 55 | swiotlb = 0; |
| 51 | 56 | ||
| 57 | #ifdef CONFIG_X86_64 | ||
| 58 | /* pci_swiotlb_detect_4gb turns on native SWIOTLB if no_iommu == 0 | ||
| 59 | * (so no iommu=X command line over-writes). | ||
| 60 | * Considering that PV guests do not want the *native SWIOTLB* but | ||
| 61 | * only Xen SWIOTLB it is not useful to us so set no_iommu=1 here. | ||
| 62 | */ | ||
| 63 | if (max_pfn > MAX_DMA32_PFN) | ||
| 64 | no_iommu = 1; | ||
| 65 | #endif | ||
| 52 | return xen_swiotlb; | 66 | return xen_swiotlb; |
| 53 | } | 67 | } |
| 54 | 68 | ||
