diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-12-02 21:52:52 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-12-02 21:52:52 +0000 |
commit | a24544405b2021bf1b305e8af8fb5f835e1f95aa (patch) | |
tree | 2922161d27231706a05455f57c3e43aa68d3f374 | |
parent | 293f38b839c1b9ac71dbf14ae9575a017e7406ae (diff) |
Partial fix for the vmalloc bug.
-rw-r--r-- | arch/mips/mm/fault.c | 8 | ||||
-rw-r--r-- | include/asm-mips/pgtable.h | 7 |
2 files changed, 15 insertions, 0 deletions
diff --git a/arch/mips/mm/fault.c b/arch/mips/mm/fault.c index 5d9ecbc4d..ed3d2a2ac 100644 --- a/arch/mips/mm/fault.c +++ b/arch/mips/mm/fault.c @@ -220,6 +220,14 @@ vmalloc_fault: if (!pgd_present(*pgd_k)) goto bad_area_nosemaphore; set_pgd(pgd, *pgd_k); + return; } + + pmd = pmd_offset(pgd, address); + pmd_k = pmd_offset(pgd_k, address); + + if (pmd_present(*pmd) || !pmd_present(*pmd_k)) + goto bad_area_nosemaphore; + set_pmd(pmd, *pmd_k); } } diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h index aef581fbf..22bff345d 100644 --- a/include/asm-mips/pgtable.h +++ b/include/asm-mips/pgtable.h @@ -273,6 +273,13 @@ extern inline void pte_clear(pte_t *ptep) } /* + * (pmds are folded into pgds so this doesnt get actually called, + * but the define is needed for a generic inline function.) + */ +#define set_pmd(pmdptr, pmdval) (*(pmdptr) = pmdval) +#define set_pgd(pgdptr, pgdval) (*(pgdptr) = pgdval) + +/* * Empty pgd/pmd entries point to the invalid_pte_table. */ extern inline int pmd_none(pmd_t pmd) |