Kernel 2.6.8 fails to boot on Tiger-4 when commandline parameter mem=8GB

From: Zhang, Yanmin <yanmin.zhang_at_intel.com>
Date: 2004-08-18 11:22:03
My tiger-4 machine has 16GB memory. Kernel 2.6.8 fails to boot on it
when command line parameter mem=8G, and it also fails when mem being set
to other value, such as 7G, 10G.

Basically, in function efi_memmap_walk, md->num_pages might be decreased
if mem_limit is set, and then at the next time when efi_memmap_walk is
called, trim_top might trim the md again because of IA64_GRANULE_SIZE
alignment, then another md which is beyond mem_limit at the beginning
will be chosen, and its physical page number is larger than max_pfn.
Then, a BUG check is triggered.

Below is the patch to fix it.

Signed-off-by: Zhang Yanmin		<yanmin.zhang@intel.com>
Signed-off-by: Yao Jun			<junx.yao@intel.com>

diff -Nraup linux-2.6.8/arch/ia64/kernel/efi.c
linux-2.6.8_fix/arch/ia64/kernel/efi.c
--- linux-2.6.8/arch/ia64/kernel/efi.c	2004-08-16 07:59:53.151655436
+0800
+++ linux-2.6.8_fix/arch/ia64/kernel/efi.c	2004-08-16
08:01:43.348919711 +0800
@@ -357,8 +357,10 @@ efi_memmap_walk (efi_freemem_callback_t 
 			if (total_mem >= mem_limit)
 				continue;
 			total_mem += (md->num_pages << EFI_PAGE_SHIFT);
-			if (total_mem > mem_limit)
+			if (total_mem > mem_limit) {
 				md->num_pages -= ((total_mem -
mem_limit) >> EFI_PAGE_SHIFT);
+				max_addr = md->phys_addr +
(md->num_pages << EFI_PAGE_SHIFT);
+			}
 
 			if (md->num_pages == 0)
 				continue;




 <<mem_boot_err.patch.diff>> 

-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Received on Tue Aug 17 21:22:35 2004

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:29 EST