diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-01-30 13:33:43 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 13:33:43 +0100 |
commit | f0646e43acb18f0e00b00085dc88bc3f403e7930 (patch) | |
tree | c47968a44ac541854929f03d22cf2fb76d76cb55 /arch/x86/mm/pageattr_64.c | |
parent | a5a5dc31794c3271c066835ad2c90c58a3805569 (diff) |
x86: return the page table level in lookup_address()
based on this patch from Andi Kleen:
| Subject: CPA: Return the page table level in lookup_address()
| From: Andi Kleen <ak@suse.de>
|
| Needed for the next change.
|
| And change all the callers.
and ported it to x86.git.
Signed-off-by: Andi Kleen <ak@suse.de>
Acked-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/mm/pageattr_64.c')
-rw-r--r-- | arch/x86/mm/pageattr_64.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/x86/mm/pageattr_64.c b/arch/x86/mm/pageattr_64.c index 14ab327cde0..59cd066f674 100644 --- a/arch/x86/mm/pageattr_64.c +++ b/arch/x86/mm/pageattr_64.c @@ -14,7 +14,7 @@ #include <asm/uaccess.h> #include <asm/io.h> -pte_t *lookup_address(unsigned long address) +pte_t *lookup_address(unsigned long address, int *level) { pgd_t *pgd = pgd_offset_k(address); pud_t *pud; @@ -29,8 +29,10 @@ pte_t *lookup_address(unsigned long address) pmd = pmd_offset(pud, address); if (!pmd_present(*pmd)) return NULL; + *level = 3; if (pmd_large(*pmd)) return (pte_t *)pmd; + *level = 4; pte = pte_offset_kernel(pmd, address); if (pte && !pte_present(*pte)) @@ -140,8 +142,9 @@ __change_page_attr(unsigned long address, unsigned long pfn, pgprot_t prot, struct page *kpte_page; pgprot_t ref_prot2; pte_t *kpte; + int level; - kpte = lookup_address(address); + kpte = lookup_address(address, &level); if (!kpte) return 0; |