Commit d5a9a399 authored by Brian Gerst's avatar Brian Gerst Committed by Linus Torvalds

[PATCH] x86 page table initialization fix

At bootup, one_page_table_init() pulls the rug out from under the kernel
by installing a new page table before setting it up.  With big TLB's, it
can go unnoticed, but a 486 has a small TLB so any miss will cause a
triple fault and reset.
parent 811b6a3b
......@@ -71,12 +71,16 @@ static pmd_t * __init one_md_table_init(pgd_t *pgd)
*/
static pte_t * __init one_page_table_init(pmd_t *pmd)
{
pte_t *page_table = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE);
set_pmd(pmd, __pmd(__pa(page_table) | _PAGE_TABLE));
if (page_table != pte_offset_kernel(pmd, 0))
BUG();
if (pmd_none(*pmd)) {
pte_t *page_table = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE);
set_pmd(pmd, __pmd(__pa(page_table) | _PAGE_TABLE));
if (page_table != pte_offset_kernel(pmd, 0))
BUG();
return page_table;
return page_table;
}
return pte_offset_kernel(pmd, 0);
}
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment