From: Andi Kleen Date: Mon, 4 Feb 2008 15:48:09 +0000 (+0100) Subject: x86: add gbpages support to lookup_address X-Git-Tag: v2.6.25-rc1~1057^2~7 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=c2f71ee2140b2a506735ff9fcb7e3b1dfaab8f2b;p=linux-2.6-omap-h63xx.git x86: add gbpages support to lookup_address [ tglx@linutronix.de: fix bootup crash on sparse mappings. ] Signed-off-by: Andi Kleen Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index 9be684e61dc..143fbafc948 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c @@ -209,6 +209,11 @@ pte_t *lookup_address(unsigned long address, int *level) pud = pud_offset(pgd, address); if (pud_none(*pud)) return NULL; + + *level = PG_LEVEL_1G; + if (pud_large(*pud) || !pud_present(*pud)) + return (pte_t *)pud; + pmd = pmd_offset(pud, address); if (pmd_none(*pmd)) return NULL;