x86: add gbpages support to lookup_address

[ tglx@linutronix.de: fix bootup crash on sparse mappings. ]

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
Andi Kleen 2008-02-04 16:48:09 +01:00 committed by Ingo Molnar
parent 61e19a347a
commit c2f71ee214
1 changed files with 5 additions and 0 deletions

View File

@ -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;