
From: Andi Kleen <ak@suse.de>

Apart from some ppc32 specific drivers the only drivers/ change needed for
4level pagetables.

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/drivers/char/drm/drm_memory.h |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

diff -puN drivers/char/drm/drm_memory.h~4level-convert-drm-to-4levels drivers/char/drm/drm_memory.h
--- 25/drivers/char/drm/drm_memory.h~4level-convert-drm-to-4levels	2004-11-03 21:53:17.911345136 -0800
+++ 25-akpm/drivers/char/drm/drm_memory.h	2004-11-03 21:53:17.914344680 -0800
@@ -121,10 +121,12 @@ agp_remap (unsigned long offset, unsigne
 	return addr;
 }
 
+/* AK: looks racy */
 static inline unsigned long
 drm_follow_page (void *vaddr)
 {
-	pgd_t *pgd = pgd_offset_k((unsigned long) vaddr);
+	pml4_t *pml4 = pml4_offset_k((unsigned long) vaddr);
+	pgd_t *pgd = pml4_pgd_offset_k(pml4, (unsigned long) vaddr);
 	pmd_t *pmd = pmd_offset(pgd, (unsigned long) vaddr);
 	pte_t *ptep = pte_offset_kernel(pmd, (unsigned long) vaddr);
 	return pte_pfn(*ptep) << PAGE_SHIFT;
_
