Skip to contentSkip to conversation

kanoj-mm26-2.3.26 Fix nonPAE kernel panics

PATCH New Kanoj Sarcar 1 participant 1 message Nov 9, 1999

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kanoj-mm26-2.3.26 Fix nonPAE kernel panics

Linus,

Please put this patch into 2.3.27. It prevents a nonPAE kernel from attempting to use >4Gb physical memory, if the ia32 box has that much. My non PAE kernel is now able to multiuser boot my ia32 box which has slightly more than 4Gb RAM.

Also, add in helpful messages for sysadmins, so that they can create the best possible kernel for their ia32 boxes.

Thanks.

Kanoj

i386/kernel/setup.c renamed from usr/tmp/p_rdiff_a006bj/setup.c +20 -2
@@ -583,6 +583,7 @@
 #define VMALLOC_RESERVE	(unsigned long)(128 << 20)
 #define MAXMEM		(unsigned long)(-PAGE_OFFSET-VMALLOC_RESERVE)
 #define MAXMEM_PFN	PFN_DOWN(MAXMEM)
+#define MAX_NONPAE_PFN	(1 << 20)
 
 	/*
 	 * partially used pages are not usable - thus
@@ -608,8 +609,26 @@
 	 * Determine low and high memory ranges:
 	 */
 	max_low_pfn = max_pfn;
-	if (max_low_pfn > MAXMEM_PFN)
+	if (max_low_pfn > MAXMEM_PFN) {
 		max_low_pfn = MAXMEM_PFN;
+#ifndef CONFIG_HIGHMEM
+		/* Maximum memory usable is what is directly addressable */
+		printk(KERN_WARNING "Warning only %ldMB will be used.\n",
+					MAXMEM>>20);
+		if (max_pfn > MAX_NONPAE_PFN)
+			printk(KERN_WARNING "Use a PAE enabled kernel.\n");
+		else
+			printk(KERN_WARNING "Use a HIGHMEM enabled kernel.\n");
+#else /* !CONFIG_HIGHMEM */
+#ifndef CONFIG_X86_PAE
+		if (max_pfn > MAX_NONPAE_PFN) {
+			max_pfn = MAX_NONPAE_PFN;
+			printk(KERN_WARNING "Warning only 4GB will be used.\n");
+			printk(KERN_WARNING "Use a PAE enabled kernel.\n");
+		}
+#endif /* !CONFIG_X86_PAE */
+#endif /* !CONFIG_HIGHMEM */
+	}
 
--

To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://humbolt.geo.uu.nl/Linux-MM/