Re: [PATCH 2/2] x86_64: make early_node_mem return align address

Andi Kleen
2008-01-29T09:35:23Z

On Tuesday 29 January 2008 10:05, Yinghai Lu wrote:
> [PATCH 2/2] x86_64: make early_node_mem return align address
>
> boot oops when system get 64g or 128g installed

Probably it should just use reserve_early(). Does this patch work?

The alignment change is needed at some point too, but only to
relax the alignment to not force all early allocations to be page
padded.

-Andi

---

Use early reservation for early node data

Signed-off-by: Andi Kleen <ak@suse.de>

Index: linux/arch/x86/mm/numa_64.c
===================================================================
--- linux.orig/arch/x86/mm/numa_64.c
+++ linux/arch/x86/mm/numa_64.c
@@ -169,8 +169,10 @@ static void * __init early_node_mem(int
unsigned long mem = find_e820_area(start, end, size);
void *ptr;

- if (mem != -1L)
+ if (mem != -1L) {
+ reserve_early(mem, mem + size);
return __va(mem);
+ }
ptr = __alloc_bootmem_nopanic(size,
SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS));
if (ptr == NULL) {