[PATCH] buglet in head.S (i386)

From: manfreds (manfreds@colorfullife.com)
Date: Tue Apr 11 2000 - 14:07:01 EST


Hi Linus,

someone changed the initialization for the page tables during boot-up,
without updating a "je 1f" for SMP:
now every cpu initializes the boot page table, only the first cpu should
do that.

Below is a fix (against 2.3.99-pre3), I'm using it on my dual pII

--
	Manfred
<<<<<<<<
--- 2.3/arch/i386/kernel/head.S	Mon Mar 20 15:11:25 2000
+++ build-2.3/arch/i386/kernel/head.S	Tue Apr 11 20:14:58 2000
@@ -70,22 +70,28 @@
  */
 #define cr4_bits mmu_cr4_features-__PAGE_OFFSET
 	cmpl $0,cr4_bits
-	je 1f
-	movl %cr4,%eax		# Turn on 4Mb pages
+	je 3f
+	movl %cr4,%eax		# Turn on paging options (PSE,PAE,..)
 	orl cr4_bits,%eax
 	movl %eax,%cr4
+	jmp 3f
+1:
 #endif
 /*
- * Setup paging (intialize tables, then switch them on)
+ * Initialize page tables
  */
-1:
 	movl $pg0-__PAGE_OFFSET,%edi /* initialize page tables */
 	movl $007,%eax		/* "007" doesn't mean with right to kill, but
 				   PRESENT+RW+USER */
-1:	stosl
+2:	stosl
 	add $0x1000,%eax
 	cmp $empty_zero_page-__PAGE_OFFSET,%edi
-	jne 1b
+	jne 2b
+
+/*
+ * Enable paging
+ */
+3:
 	movl $swapper_pg_dir-__PAGE_OFFSET,%eax
 	movl %eax,%cr3		/* set the page table pointer.. */
 	movl %cr0,%eax
>>>>>>>>

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Apr 15 2000 - 21:00:16 EST