aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86_64/mm/fault.c2
-rw-r--r--arch/x86_64/mm/init.c2
-rw-r--r--include/asm-x86_64/pgtable.h6
3 files changed, 2 insertions, 8 deletions
diff --git a/arch/x86_64/mm/fault.c b/arch/x86_64/mm/fault.c
index 55250593d8c9..64728898f869 100644
--- a/arch/x86_64/mm/fault.c
+++ b/arch/x86_64/mm/fault.c
@@ -160,7 +160,7 @@ void dump_pagetable(unsigned long address)
160 printk("PGD %lx ", pgd_val(*pgd)); 160 printk("PGD %lx ", pgd_val(*pgd));
161 if (!pgd_present(*pgd)) goto ret; 161 if (!pgd_present(*pgd)) goto ret;
162 162
163 pud = __pud_offset_k((pud_t *)pgd_page(*pgd), address); 163 pud = pud_offset(pgd, address);
164 if (bad_address(pud)) goto bad; 164 if (bad_address(pud)) goto bad;
165 printk("PUD %lx ", pud_val(*pud)); 165 printk("PUD %lx ", pud_val(*pud));
166 if (!pud_present(*pud)) goto ret; 166 if (!pud_present(*pud)) goto ret;
diff --git a/arch/x86_64/mm/init.c b/arch/x86_64/mm/init.c
index a70a8e3e312d..b83645a2e02d 100644
--- a/arch/x86_64/mm/init.c
+++ b/arch/x86_64/mm/init.c
@@ -372,7 +372,7 @@ void __meminit init_memory_mapping(unsigned long start, unsigned long end)
372 pud_t *pud; 372 pud_t *pud;
373 373
374 if (after_bootmem) 374 if (after_bootmem)
375 pud = pud_offset_k(pgd, start & PGDIR_MASK); 375 pud = pud_offset(pgd, start & PGDIR_MASK);
376 else 376 else
377 pud = alloc_low_page(&map, &pud_phys); 377 pud = alloc_low_page(&map, &pud_phys);
378 378
diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h
index 31e83c3bd022..a31ab4e68a9b 100644
--- a/include/asm-x86_64/pgtable.h
+++ b/include/asm-x86_64/pgtable.h
@@ -337,14 +337,8 @@ static inline int pmd_large(pmd_t pte) {
337/* to find an entry in a page-table-directory. */ 337/* to find an entry in a page-table-directory. */
338#define pud_index(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1)) 338#define pud_index(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1))
339#define pud_offset(pgd, address) ((pud_t *) pgd_page(*(pgd)) + pud_index(address)) 339#define pud_offset(pgd, address) ((pud_t *) pgd_page(*(pgd)) + pud_index(address))
340#define pud_offset_k(pgd, addr) pud_offset(pgd, addr)
341#define pud_present(pud) (pud_val(pud) & _PAGE_PRESENT) 340#define pud_present(pud) (pud_val(pud) & _PAGE_PRESENT)
342 341
343static inline pud_t *__pud_offset_k(pud_t *pud, unsigned long address)
344{
345 return pud + pud_index(address);
346}
347
348/* PMD - Level 2 access */ 342/* PMD - Level 2 access */
349#define pmd_page_kernel(pmd) ((unsigned long) __va(pmd_val(pmd) & PTE_MASK)) 343#define pmd_page_kernel(pmd) ((unsigned long) __va(pmd_val(pmd) & PTE_MASK))
350#define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT)) 344#define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT))