]> err.no Git - linux-2.6/blobdiff - arch/x86/mm/pageattr.c
x86: add gbpages support to lookup_address
[linux-2.6] / arch / x86 / mm / pageattr.c
index 0b029c97174ec4779825e1de739d2c430e6d09c9..143fbafc948ae25c9c8added4a1a7534c0521d9f 100644 (file)
@@ -119,7 +119,7 @@ static void cpa_flush_range(unsigned long start, int numpages, int cache)
                /*
                 * Only flush present addresses:
                 */
-               if (pte && pte_present(*pte))
+               if (pte && (pte_val(*pte) & _PAGE_PRESENT))
                        clflush_cache_range((void *) addr, PAGE_SIZE);
        }
 }
@@ -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;