diff options
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 14ab327cde0c..59cd066f6741 100644 --- a/arch/x86/mm/pageattr_64.c +++ b/arch/x86/mm/pageattr_64.c | |||
@@ -14,7 +14,7 @@ | |||
14 | #include <asm/uaccess.h> | 14 | #include <asm/uaccess.h> |
15 | #include <asm/io.h> | 15 | #include <asm/io.h> |
16 | 16 | ||
17 | pte_t *lookup_address(unsigned long address) | 17 | pte_t *lookup_address(unsigned long address, int *level) |
18 | { | 18 | { |
19 | pgd_t *pgd = pgd_offset_k(address); | 19 | pgd_t *pgd = pgd_offset_k(address); |
20 | pud_t *pud; | 20 | pud_t *pud; |
@@ -29,8 +29,10 @@ pte_t *lookup_address(unsigned long address) | |||
29 | pmd = pmd_offset(pud, address); | 29 | pmd = pmd_offset(pud, address); |
30 | if (!pmd_present(*pmd)) | 30 | if (!pmd_present(*pmd)) |
31 | return NULL; | 31 | return NULL; |
32 | *level = 3; | ||
32 | if (pmd_large(*pmd)) | 33 | if (pmd_large(*pmd)) |
33 | return (pte_t *)pmd; | 34 | return (pte_t *)pmd; |
35 | *level = 4; | ||
34 | 36 | ||
35 | pte = pte_offset_kernel(pmd, address); | 37 | pte = pte_offset_kernel(pmd, address); |
36 | if (pte && !pte_present(*pte)) | 38 | if (pte && !pte_present(*pte)) |
@@ -140,8 +142,9 @@ __change_page_attr(unsigned long address, unsigned long pfn, pgprot_t prot, | |||
140 | struct page *kpte_page; | 142 | struct page *kpte_page; |
141 | pgprot_t ref_prot2; | 143 | pgprot_t ref_prot2; |
142 | pte_t *kpte; | 144 | pte_t *kpte; |
145 | int level; | ||
143 | 146 | ||
144 | kpte = lookup_address(address); | 147 | kpte = lookup_address(address, &level); |
145 | if (!kpte) | 148 | if (!kpte) |
146 | return 0; | 149 | return 0; |
147 | 150 | ||