Skip to contentSkip to conversation

ppc64: Fix a typo in the code that reserves memory at boot

PATCH In review Benjamin Herrenschmidt 1 participant 2 messages Oct 16, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ppc64: Fix a typo in the code that reserves memory at boot

Hi !

The code that marks memory regions as "reserved" early during boot has a typo (doing incorrect rounding of the top address) which can cause some areas to not be properly reserved. That may explain some cases of initrd corruption reported recently.

===== arch/ppc64/kernel/prom_init.c 1.2 vs edited =====

arch/ppc64/kernel/prom_init.c +1 -1
@@ -595,7 +595,7 @@
 	 * dumb and just copy this entire array to the boot params
 	 */
 	base = _ALIGN_DOWN(base, PAGE_SIZE);
-	top = _ALIGN_DOWN(top, PAGE_SIZE);
+	top = _ALIGN_UP(top, PAGE_SIZE);
 	size = top - base;
 
 	if (cnt >= (MEM_RESERVE_MAP_SIZE - 1))
#1 lore raw
Quoted 8 lines · Benjamin Herrenschmidt

Hi !

The code that marks memory regions as "reserved" early during boot has a typo (doing incorrect rounding of the top address) which can cause some areas to not be properly reserved. That may explain some cases of initrd corruption reported recently.

Ok, ignore it and take Anton's one instead.

Ben.