diff options
Diffstat (limited to 'arch/x86/mm/pageattr_32.c')
-rw-r--r-- | arch/x86/mm/pageattr_32.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/x86/mm/pageattr_32.c b/arch/x86/mm/pageattr_32.c index be4656403d7..523fd5b37df 100644 --- a/arch/x86/mm/pageattr_32.c +++ b/arch/x86/mm/pageattr_32.c | |||
@@ -18,7 +18,7 @@ | |||
18 | static DEFINE_SPINLOCK(cpa_lock); | 18 | static DEFINE_SPINLOCK(cpa_lock); |
19 | static struct list_head df_list = LIST_HEAD_INIT(df_list); | 19 | static struct list_head df_list = LIST_HEAD_INIT(df_list); |
20 | 20 | ||
21 | pte_t *lookup_address(unsigned long address) | 21 | pte_t *lookup_address(unsigned long address, int *level) |
22 | { | 22 | { |
23 | pgd_t *pgd = pgd_offset_k(address); | 23 | pgd_t *pgd = pgd_offset_k(address); |
24 | pud_t *pud; | 24 | pud_t *pud; |
@@ -32,8 +32,10 @@ pte_t *lookup_address(unsigned long address) | |||
32 | pmd = pmd_offset(pud, address); | 32 | pmd = pmd_offset(pud, address); |
33 | if (pmd_none(*pmd)) | 33 | if (pmd_none(*pmd)) |
34 | return NULL; | 34 | return NULL; |
35 | *level = 2; | ||
35 | if (pmd_large(*pmd)) | 36 | if (pmd_large(*pmd)) |
36 | return (pte_t *)pmd; | 37 | return (pte_t *)pmd; |
38 | *level = 3; | ||
37 | 39 | ||
38 | return pte_offset_kernel(pmd, address); | 40 | return pte_offset_kernel(pmd, address); |
39 | } | 41 | } |
@@ -156,11 +158,12 @@ static int __change_page_attr(struct page *page, pgprot_t prot) | |||
156 | struct page *kpte_page; | 158 | struct page *kpte_page; |
157 | unsigned long address; | 159 | unsigned long address; |
158 | pte_t *kpte; | 160 | pte_t *kpte; |
161 | int level; | ||
159 | 162 | ||
160 | BUG_ON(PageHighMem(page)); | 163 | BUG_ON(PageHighMem(page)); |
161 | address = (unsigned long)page_address(page); | 164 | address = (unsigned long)page_address(page); |
162 | 165 | ||
163 | kpte = lookup_address(address); | 166 | kpte = lookup_address(address, &level); |
164 | if (!kpte) | 167 | if (!kpte) |
165 | return -EINVAL; | 168 | return -EINVAL; |
166 | 169 | ||