Hi everybody,

I finally found the reason why 386es have trouble booting the 2.4.0 kernel:

In routine pagetable_init() in arch/i386/mm/init.c, a pte gets installed before
it actually has been filled with valid entries. This causes the kernel text
segment to be temporarily unmapped. Pentiums are only lucky to not crash
because they have a bigger TLB than 386s.

Here is a patch to fix this:

--- init.c.orig Wed Nov 29 07:43:39 2000
+++ init.c      Mon Jan 15 18:36:08 2001
@@ -317,7 +317,7 @@
        pgd_t *pgd, *pgd_base;
        int i, j, k;
        pmd_t *pmd;
-       pte_t *pte;
+       pte_t *pte, *pte_base;
 
        /*
         * This can be zero as well - no problem, in that case we exit
@@ -366,11 +366,7 @@
                                continue;
                        }
 
-                       pte = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE);
-                       set_pmd(pmd, __pmd(_KERNPG_TABLE + __pa(pte)));
-
-                       if (pte != pte_offset(pmd, 0))
-                               BUG();
+                       pte_base = pte = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE);
 
                        for (k = 0; k < PTRS_PER_PTE; pte++, k++) {
                                vaddr = i*PGDIR_SIZE + j*PMD_SIZE + k*PAGE_SIZE;
@@ -378,6 +374,10 @@
                                        break;
                                *pte = mk_pte_phys(__pa(vaddr), PAGE_KERNEL);
                        }
+                       set_pmd(pmd, __pmd(_KERNPG_TABLE + __pa(pte_base)));
+                       if (pte_base != pte_offset(pmd, 0))
+                               BUG();
+
                }
        }
 
Thanks to everybody who helped with ideas and suggestions, especially Ingo
Molnar!


Cheers

Rob

----------------------------------------------------------------
Robert Kaiser                         email: [EMAIL PROTECTED]
SYSGO RTS GmbH
Am Pfaffenstein 14                    phone: (49) 6136 9948-762
D-55270 Klein-Winternheim / Germany   fax:   (49) 6136 9948-10
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/

Reply via email to