Skip to contentSkip to conversation

x86-64: free_bootmem_node needs __pa in allocate_aperture

PATCH Applied Jon Mason 2 participants 2 messages Mar 7, 2006 – Mar 8, 2006

lore
Share & tools
lore

Jon Mason

author
#0 lore raw

PATCH 1/1 x86-64: free_bootmem_node needs __pa in allocate_aperture

free_bootmem_node expects a physical address to be passed in, but __alloc_bootmem_node returns a virtual one. That address needs to be translated to physical.

Thanks,
Jon

arch/x86_64/kernel/aperture.c +1 -1
diff -r 5647dfd5ed8a arch/x86_64/kernel/aperture.c
@@ -60,7 +60,7 @@
 		printk("Cannot allocate aperture memory hole (%p,%uK)\n",
 		       p, aper_size>>10);
 		if (p)
-			free_bootmem_node(nd0, (unsigned long)p, aper_size); 
+			free_bootmem_node(nd0, __pa(p), aper_size); 
 		return 0;
 	}
 	printk("Mapping aperture over %d KB of RAM @ %lx\n",
Applied
#1 lore raw
Quoted 3 lines · Jon Mason

free_bootmem_node expects a physical address to be passed in, but __alloc_bootmem_node returns a virtual one. That address needs to be translated to physical.

Thanks applied. What a nasty trap.

-Andi