aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/pci-dma.c8
-rw-r--r--arch/x86/kernel/setup.c13
-rw-r--r--include/asm-x86/iommu.h2
-rw-r--r--include/linux/iommu-helper.h1
-rw-r--r--init/calibrate.c2
-rw-r--r--lib/iommu-helper.c8
6 files changed, 20 insertions, 14 deletions
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c
index 8dbffb846de9..87d4d6964ec2 100644
--- a/arch/x86/kernel/pci-dma.c
+++ b/arch/x86/kernel/pci-dma.c
@@ -123,6 +123,14 @@ void __init pci_iommu_alloc(void)
123 123
124 pci_swiotlb_init(); 124 pci_swiotlb_init();
125} 125}
126
127unsigned long iommu_num_pages(unsigned long addr, unsigned long len)
128{
129 unsigned long size = roundup((addr & ~PAGE_MASK) + len, PAGE_SIZE);
130
131 return size >> PAGE_SHIFT;
132}
133EXPORT_SYMBOL(iommu_num_pages);
126#endif 134#endif
127 135
128/* 136/*
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index b520dae02bf4..2d888586385d 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -788,10 +788,6 @@ void __init setup_arch(char **cmdline_p)
788 788
789 initmem_init(0, max_pfn); 789 initmem_init(0, max_pfn);
790 790
791#ifdef CONFIG_X86_64
792 dma32_reserve_bootmem();
793#endif
794
795#ifdef CONFIG_ACPI_SLEEP 791#ifdef CONFIG_ACPI_SLEEP
796 /* 792 /*
797 * Reserve low memory region for sleep support. 793 * Reserve low memory region for sleep support.
@@ -806,6 +802,15 @@ void __init setup_arch(char **cmdline_p)
806#endif 802#endif
807 reserve_crashkernel(); 803 reserve_crashkernel();
808 804
805#ifdef CONFIG_X86_64
806 /*
807 * dma32_reserve_bootmem() allocates bootmem which may conflict
808 * with the crashkernel command line, so do that after
809 * reserve_crashkernel()
810 */
811 dma32_reserve_bootmem();
812#endif
813
809 reserve_ibft_region(); 814 reserve_ibft_region();
810 815
811#ifdef CONFIG_KVM_CLOCK 816#ifdef CONFIG_KVM_CLOCK
diff --git a/include/asm-x86/iommu.h b/include/asm-x86/iommu.h
index ecc8061904a9..5f888cc5be49 100644
--- a/include/asm-x86/iommu.h
+++ b/include/asm-x86/iommu.h
@@ -7,6 +7,8 @@ extern struct dma_mapping_ops nommu_dma_ops;
7extern int force_iommu, no_iommu; 7extern int force_iommu, no_iommu;
8extern int iommu_detected; 8extern int iommu_detected;
9 9
10extern unsigned long iommu_num_pages(unsigned long addr, unsigned long len);
11
10#ifdef CONFIG_GART_IOMMU 12#ifdef CONFIG_GART_IOMMU
11extern int gart_iommu_aperture; 13extern int gart_iommu_aperture;
12extern int gart_iommu_aperture_allowed; 14extern int gart_iommu_aperture_allowed;
diff --git a/include/linux/iommu-helper.h b/include/linux/iommu-helper.h
index f8598f583944..c975caf75385 100644
--- a/include/linux/iommu-helper.h
+++ b/include/linux/iommu-helper.h
@@ -8,4 +8,3 @@ extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size,
8 unsigned long align_mask); 8 unsigned long align_mask);
9extern void iommu_area_free(unsigned long *map, unsigned long start, 9extern void iommu_area_free(unsigned long *map, unsigned long start,
10 unsigned int nr); 10 unsigned int nr);
11extern unsigned long iommu_num_pages(unsigned long addr, unsigned long len);
diff --git a/init/calibrate.c b/init/calibrate.c
index 7963e3fc51d9..a379c9061199 100644
--- a/init/calibrate.c
+++ b/init/calibrate.c
@@ -170,7 +170,7 @@ void __cpuinit calibrate_delay(void)
170 loops_per_jiffy &= ~loopbit; 170 loops_per_jiffy &= ~loopbit;
171 } 171 }
172 } 172 }
173 printk(KERN_INFO "%lu.%02lu BogoMIPS (lpj=%lu)\n", 173 printk(KERN_CONT "%lu.%02lu BogoMIPS (lpj=%lu)\n",
174 loops_per_jiffy/(500000/HZ), 174 loops_per_jiffy/(500000/HZ),
175 (loops_per_jiffy/(5000/HZ)) % 100, loops_per_jiffy); 175 (loops_per_jiffy/(5000/HZ)) % 100, loops_per_jiffy);
176} 176}
diff --git a/lib/iommu-helper.c b/lib/iommu-helper.c
index 889ddce2021e..a3b8d4c3f77a 100644
--- a/lib/iommu-helper.c
+++ b/lib/iommu-helper.c
@@ -80,11 +80,3 @@ void iommu_area_free(unsigned long *map, unsigned long start, unsigned int nr)
80 } 80 }
81} 81}
82EXPORT_SYMBOL(iommu_area_free); 82EXPORT_SYMBOL(iommu_area_free);
83
84unsigned long iommu_num_pages(unsigned long addr, unsigned long len)
85{
86 unsigned long size = roundup((addr & ~PAGE_MASK) + len, PAGE_SIZE);
87
88 return size >> PAGE_SHIFT;
89}
90EXPORT_SYMBOL(iommu_num_pages);