diff options
-rw-r--r-- | arch/um/kernel/tlb.c | 8 | ||||
-rw-r--r-- | include/asm-um/pgtable-2level.h | 3 | ||||
-rw-r--r-- | include/asm-um/pgtable-3level.h | 3 | ||||
-rw-r--r-- | include/asm-um/pgtable.h | 3 |
4 files changed, 8 insertions, 9 deletions
diff --git a/arch/um/kernel/tlb.c b/arch/um/kernel/tlb.c index ef5a2a20d351..8127ca8d5957 100644 --- a/arch/um/kernel/tlb.c +++ b/arch/um/kernel/tlb.c | |||
@@ -207,7 +207,7 @@ static inline int update_pte_range(pmd_t *pmd, unsigned long addr, | |||
207 | else if (pte_newprot(*pte)) | 207 | else if (pte_newprot(*pte)) |
208 | ret = add_mprotect(addr, PAGE_SIZE, prot, hvc); | 208 | ret = add_mprotect(addr, PAGE_SIZE, prot, hvc); |
209 | *pte = pte_mkuptodate(*pte); | 209 | *pte = pte_mkuptodate(*pte); |
210 | } while (pte++, addr += PAGE_SIZE, ((addr != end) && !ret)); | 210 | } while (pte++, addr += PAGE_SIZE, ((addr < end) && !ret)); |
211 | return ret; | 211 | return ret; |
212 | } | 212 | } |
213 | 213 | ||
@@ -229,7 +229,7 @@ static inline int update_pmd_range(pud_t *pud, unsigned long addr, | |||
229 | } | 229 | } |
230 | } | 230 | } |
231 | else ret = update_pte_range(pmd, addr, next, hvc); | 231 | else ret = update_pte_range(pmd, addr, next, hvc); |
232 | } while (pmd++, addr = next, ((addr != end) && !ret)); | 232 | } while (pmd++, addr = next, ((addr < end) && !ret)); |
233 | return ret; | 233 | return ret; |
234 | } | 234 | } |
235 | 235 | ||
@@ -251,7 +251,7 @@ static inline int update_pud_range(pgd_t *pgd, unsigned long addr, | |||
251 | } | 251 | } |
252 | } | 252 | } |
253 | else ret = update_pmd_range(pud, addr, next, hvc); | 253 | else ret = update_pmd_range(pud, addr, next, hvc); |
254 | } while (pud++, addr = next, ((addr != end) && !ret)); | 254 | } while (pud++, addr = next, ((addr < end) && !ret)); |
255 | return ret; | 255 | return ret; |
256 | } | 256 | } |
257 | 257 | ||
@@ -274,7 +274,7 @@ void fix_range_common(struct mm_struct *mm, unsigned long start_addr, | |||
274 | } | 274 | } |
275 | } | 275 | } |
276 | else ret = update_pud_range(pgd, addr, next, &hvc); | 276 | else ret = update_pud_range(pgd, addr, next, &hvc); |
277 | } while (pgd++, addr = next, ((addr != end_addr) && !ret)); | 277 | } while (pgd++, addr = next, ((addr < end_addr) && !ret)); |
278 | 278 | ||
279 | if (!ret) | 279 | if (!ret) |
280 | ret = do_ops(&hvc, hvc.index, 1); | 280 | ret = do_ops(&hvc, hvc.index, 1); |
diff --git a/include/asm-um/pgtable-2level.h b/include/asm-um/pgtable-2level.h index 172a75fde512..f534b73e753e 100644 --- a/include/asm-um/pgtable-2level.h +++ b/include/asm-um/pgtable-2level.h | |||
@@ -41,9 +41,6 @@ static inline void pgd_mkuptodate(pgd_t pgd) { } | |||
41 | #define pfn_pte(pfn, prot) __pte(pfn_to_phys(pfn) | pgprot_val(prot)) | 41 | #define pfn_pte(pfn, prot) __pte(pfn_to_phys(pfn) | pgprot_val(prot)) |
42 | #define pfn_pmd(pfn, prot) __pmd(pfn_to_phys(pfn) | pgprot_val(prot)) | 42 | #define pfn_pmd(pfn, prot) __pmd(pfn_to_phys(pfn) | pgprot_val(prot)) |
43 | 43 | ||
44 | #define pmd_page_vaddr(pmd) \ | ||
45 | ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK)) | ||
46 | |||
47 | /* | 44 | /* |
48 | * Bits 0 through 4 are taken | 45 | * Bits 0 through 4 are taken |
49 | */ | 46 | */ |
diff --git a/include/asm-um/pgtable-3level.h b/include/asm-um/pgtable-3level.h index 48f8f5d96d20..0446f456b428 100644 --- a/include/asm-um/pgtable-3level.h +++ b/include/asm-um/pgtable-3level.h | |||
@@ -87,8 +87,7 @@ static inline void pud_clear (pud_t *pud) | |||
87 | } | 87 | } |
88 | 88 | ||
89 | #define pud_page(pud) phys_to_page(pud_val(pud) & PAGE_MASK) | 89 | #define pud_page(pud) phys_to_page(pud_val(pud) & PAGE_MASK) |
90 | #define pud_page_vaddr(pud) \ | 90 | #define pud_page_vaddr(pud) ((unsigned long) __va(pud_val(pud) & PAGE_MASK)) |
91 | ((struct page *) __va(pud_val(pud) & PAGE_MASK)) | ||
92 | 91 | ||
93 | /* Find an entry in the second-level page table.. */ | 92 | /* Find an entry in the second-level page table.. */ |
94 | #define pmd_offset(pud, address) ((pmd_t *) pud_page_vaddr(*(pud)) + \ | 93 | #define pmd_offset(pud, address) ((pmd_t *) pud_page_vaddr(*(pud)) + \ |
diff --git a/include/asm-um/pgtable.h b/include/asm-um/pgtable.h index fb477774a2e9..4102b443e925 100644 --- a/include/asm-um/pgtable.h +++ b/include/asm-um/pgtable.h | |||
@@ -308,6 +308,9 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | |||
308 | #define pmd_page_vaddr(pmd) ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK)) | 308 | #define pmd_page_vaddr(pmd) ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK)) |
309 | #define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) | 309 | #define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) |
310 | 310 | ||
311 | #define pmd_page_vaddr(pmd) \ | ||
312 | ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK)) | ||
313 | |||
311 | /* | 314 | /* |
312 | * the pte page can be thought of an array like this: pte_t[PTRS_PER_PTE] | 315 | * the pte page can be thought of an array like this: pte_t[PTRS_PER_PTE] |
313 | * | 316 | * |