Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 99444
b: refs/heads/master
c: 7677b2e
h: refs/heads/master
v: v3
  • Loading branch information
Yinghai Lu authored and Ingo Molnar committed May 12, 2008
1 parent 275d38b commit c6a29a3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8c9fd91a0dc503f085169d44f4360be025f75224
refs/heads/master: 7677b2ef6c0c4fddc84f6473f3863f40eb71821b
20 changes: 17 additions & 3 deletions trunk/arch/x86/kernel/aperture_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ static u32 __init allocate_aperture(void)
u32 aper_size;
void *p;

if (fallback_aper_order > 7)
fallback_aper_order = 7;
/* aper_size should <= 1G */
if (fallback_aper_order > 5)
fallback_aper_order = 5;
aper_size = (32 * 1024 * 1024) << fallback_aper_order;

/*
Expand All @@ -65,7 +66,20 @@ static u32 __init allocate_aperture(void)
* memory. Unfortunately we cannot move it up because that would
* make the IOMMU useless.
*/
p = __alloc_bootmem_nopanic(aper_size, aper_size, 0);
/*
* using 512M as goal, in case kexec will load kernel_big
* that will do the on position decompress, and could overlap with
* that positon with gart that is used.
* sequende:
* kernel_small
* ==> kexec (with kdump trigger path or previous doesn't shutdown gart)
* ==> kernel_small(gart area become e820_reserved)
* ==> kexec (with kdump trigger path or previous doesn't shutdown gart)
* ==> kerne_big (uncompressed size will be big than 64M or 128M)
* so don't use 512M below as gart iommu, leave the space for kernel
* code for safe
*/
p = __alloc_bootmem_nopanic(aper_size, aper_size, 512ULL<<20);
if (!p || __pa(p)+aper_size > 0xffffffff) {
printk(KERN_ERR
"Cannot allocate aperture memory hole (%p,%uK)\n",
Expand Down
6 changes: 5 additions & 1 deletion trunk/arch/x86/kernel/pci-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,14 @@ void __init dma32_reserve_bootmem(void)
if (end_pfn <= MAX_DMA32_PFN)
return;

/*
* check aperture_64.c allocate_aperture() for reason about
* using 512M as goal
*/
align = 64ULL<<20;
size = round_up(dma32_bootmem_size, align);
dma32_bootmem_ptr = __alloc_bootmem_nopanic(size, align,
__pa(MAX_DMA_ADDRESS));
512ULL<<20);
if (dma32_bootmem_ptr)
dma32_bootmem_size = size;
else
Expand Down

0 comments on commit c6a29a3

Please sign in to comment.