diff options
Diffstat (limited to 'arch/x86/kernel/pci-dma.c')
-rw-r--r-- | arch/x86/kernel/pci-dma.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c index 75e14e21f61..4b7e3d8b01d 100644 --- a/arch/x86/kernel/pci-dma.c +++ b/arch/x86/kernel/pci-dma.c | |||
@@ -2,6 +2,7 @@ | |||
2 | #include <linux/dma-debug.h> | 2 | #include <linux/dma-debug.h> |
3 | #include <linux/dmar.h> | 3 | #include <linux/dmar.h> |
4 | #include <linux/bootmem.h> | 4 | #include <linux/bootmem.h> |
5 | #include <linux/gfp.h> | ||
5 | #include <linux/pci.h> | 6 | #include <linux/pci.h> |
6 | #include <linux/kmemleak.h> | 7 | #include <linux/kmemleak.h> |
7 | 8 | ||
@@ -38,7 +39,7 @@ int iommu_detected __read_mostly = 0; | |||
38 | * This variable becomes 1 if iommu=pt is passed on the kernel command line. | 39 | * This variable becomes 1 if iommu=pt is passed on the kernel command line. |
39 | * If this variable is 1, IOMMU implementations do no DMA translation for | 40 | * If this variable is 1, IOMMU implementations do no DMA translation for |
40 | * devices and allow every device to access to whole physical memory. This is | 41 | * devices and allow every device to access to whole physical memory. This is |
41 | * useful if a user want to use an IOMMU only for KVM device assignment to | 42 | * useful if a user wants to use an IOMMU only for KVM device assignment to |
42 | * guests and not for driver dma translation. | 43 | * guests and not for driver dma translation. |
43 | */ | 44 | */ |
44 | int iommu_pass_through __read_mostly; | 45 | int iommu_pass_through __read_mostly; |
@@ -65,7 +66,7 @@ int dma_set_mask(struct device *dev, u64 mask) | |||
65 | } | 66 | } |
66 | EXPORT_SYMBOL(dma_set_mask); | 67 | EXPORT_SYMBOL(dma_set_mask); |
67 | 68 | ||
68 | #ifdef CONFIG_X86_64 | 69 | #if defined(CONFIG_X86_64) && !defined(CONFIG_NUMA) |
69 | static __initdata void *dma32_bootmem_ptr; | 70 | static __initdata void *dma32_bootmem_ptr; |
70 | static unsigned long dma32_bootmem_size __initdata = (128ULL<<20); | 71 | static unsigned long dma32_bootmem_size __initdata = (128ULL<<20); |
71 | 72 | ||
@@ -116,14 +117,21 @@ static void __init dma32_free_bootmem(void) | |||
116 | dma32_bootmem_ptr = NULL; | 117 | dma32_bootmem_ptr = NULL; |
117 | dma32_bootmem_size = 0; | 118 | dma32_bootmem_size = 0; |
118 | } | 119 | } |
120 | #else | ||
121 | void __init dma32_reserve_bootmem(void) | ||
122 | { | ||
123 | } | ||
124 | static void __init dma32_free_bootmem(void) | ||
125 | { | ||
126 | } | ||
127 | |||
119 | #endif | 128 | #endif |
120 | 129 | ||
121 | void __init pci_iommu_alloc(void) | 130 | void __init pci_iommu_alloc(void) |
122 | { | 131 | { |
123 | #ifdef CONFIG_X86_64 | ||
124 | /* free the range so iommu could get some range less than 4G */ | 132 | /* free the range so iommu could get some range less than 4G */ |
125 | dma32_free_bootmem(); | 133 | dma32_free_bootmem(); |
126 | #endif | 134 | |
127 | if (pci_swiotlb_detect()) | 135 | if (pci_swiotlb_detect()) |
128 | goto out; | 136 | goto out; |
129 | 137 | ||