x86: prepare for the unification of the cpa code
authorIngo Molnar <mingo@elte.hu>
Wed, 30 Jan 2008 12:33:59 +0000 (13:33 +0100)
committerIngo Molnar <mingo@elte.hu>
Wed, 30 Jan 2008 12:33:59 +0000 (13:33 +0100)
prepare for the unification of the cpa code, by unifying the
lookup_address() logic between 32-bit and 64-bit.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/mm/pageattr-test.c
arch/x86/mm/pageattr_32.c

index 0dce0e248a42c7b7556b175052b554acc7e12a9b..6cc106b388a5620a31d3030b2bba6b593142745b 100644 (file)
@@ -20,10 +20,10 @@ enum {
        LOWEST_LEVEL            = 4,
        LPS                     = (1 << PMD_SHIFT),
 #elif defined(CONFIG_X86_PAE)
-       LOWEST_LEVEL            = 3,
+       LOWEST_LEVEL            = 4,
        LPS                     = (1 << PMD_SHIFT),
 #else
-       LOWEST_LEVEL            = 3, /* lookup_address lies here */
+       LOWEST_LEVEL            = 4, /* lookup_address lies here */
        LPS                     = (1 << 22),
 #endif
        GPS                     = (1<<30)
index dd49b16b3a0ec08941990c75c61c367064110e01..1c7bd81a41945750a7da6bd5476665ee50298f6d 100644 (file)
@@ -29,10 +29,10 @@ pte_t *lookup_address(unsigned long address, int *level)
        pmd = pmd_offset(pud, address);
        if (pmd_none(*pmd))
                return NULL;
-       *level = 2;
+       *level = 3;
        if (pmd_large(*pmd))
                return (pte_t *)pmd;
-       *level = 3;
+       *level = 4;
 
        return pte_offset_kernel(pmd, address);
 }
@@ -136,7 +136,7 @@ repeat:
                address < (unsigned long)&_etext &&
               (pgprot_val(prot) & _PAGE_NX));
 
-       if (level == 3) {
+       if (level == 4) {
                set_pte_atomic(kpte, mk_pte(page, canon_pgprot(prot)));
        } else {
                err = split_large_page(kpte, address);