aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/aperture_64.c20
-rw-r--r--arch/x86/kernel/pci-dma.c6
2 files changed, 22 insertions, 4 deletions
diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c
index 8c325b7f2d9b..c63f8d9fad3e 100644
--- a/arch/x86/kernel/aperture_64.c
+++ b/arch/x86/kernel/aperture_64.c
@@ -55,8 +55,9 @@ static u32 __init allocate_aperture(void)
55 u32 aper_size; 55 u32 aper_size;
56 void *p; 56 void *p;
57 57
58 if (fallback_aper_order > 7) 58 /* aper_size should <= 1G */
59 fallback_aper_order = 7; 59 if (fallback_aper_order > 5)
60 fallback_aper_order = 5;
60 aper_size = (32 * 1024 * 1024) << fallback_aper_order; 61 aper_size = (32 * 1024 * 1024) << fallback_aper_order;
61 62
62 /* 63 /*
@@ -65,7 +66,20 @@ static u32 __init allocate_aperture(void)
65 * memory. Unfortunately we cannot move it up because that would 66 * memory. Unfortunately we cannot move it up because that would
66 * make the IOMMU useless. 67 * make the IOMMU useless.
67 */ 68 */
68 p = __alloc_bootmem_nopanic(aper_size, aper_size, 0); 69 /*
70 * using 512M as goal, in case kexec will load kernel_big
71 * that will do the on position decompress, and could overlap with
72 * that positon with gart that is used.
73 * sequende:
74 * kernel_small
75 * ==> kexec (with kdump trigger path or previous doesn't shutdown gart)
76 * ==> kernel_small(gart area become e820_reserved)
77 * ==> kexec (with kdump trigger path or previous doesn't shutdown gart)
78 * ==> kerne_big (uncompressed size will be big than 64M or 128M)
79 * so don't use 512M below as gart iommu, leave the space for kernel
80 * code for safe
81 */
82 p = __alloc_bootmem_nopanic(aper_size, aper_size, 512ULL<<20);
69 if (!p || __pa(p)+aper_size > 0xffffffff) { 83 if (!p || __pa(p)+aper_size > 0xffffffff) {
70 printk(KERN_ERR 84 printk(KERN_ERR
71 "Cannot allocate aperture memory hole (%p,%uK)\n", 85 "Cannot allocate aperture memory hole (%p,%uK)\n",
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c
index 0c37f16b6950..1a017f00e867 100644
--- a/arch/x86/kernel/pci-dma.c
+++ b/arch/x86/kernel/pci-dma.c
@@ -77,10 +77,14 @@ void __init dma32_reserve_bootmem(void)
77 if (end_pfn <= MAX_DMA32_PFN) 77 if (end_pfn <= MAX_DMA32_PFN)
78 return; 78 return;
79 79
80 /*
81 * check aperture_64.c allocate_aperture() for reason about
82 * using 512M as goal
83 */
80 align = 64ULL<<20; 84 align = 64ULL<<20;
81 size = round_up(dma32_bootmem_size, align); 85 size = round_up(dma32_bootmem_size, align);
82 dma32_bootmem_ptr = __alloc_bootmem_nopanic(size, align, 86 dma32_bootmem_ptr = __alloc_bootmem_nopanic(size, align,
83 __pa(MAX_DMA_ADDRESS)); 87 512ULL<<20);
84 if (dma32_bootmem_ptr) 88 if (dma32_bootmem_ptr)
85 dma32_bootmem_size = size; 89 dma32_bootmem_size = size;
86 else 90 else