--- head-2006-02-07.orig/arch/x86_64/mm/pageattr-xen.c 2006-02-07 12:29:10.225160488 +0100 +++ head-2006-02-07/arch/x86_64/mm/pageattr-xen.c 2006-02-07 11:54:30.000000000 +0100 @@ -40,7 +40,7 @@ static void mm_walk(struct mm_struct *mm int g,u,m; pgd = mm->pgd; - for (g = 0; g <= USER_PTRS_PER_PGD; g++, pgd++) { + for (g = 0; g <= (TASK_SIZE64 - 1) / PGDIR_SIZE; g++, pgd++) { if (pgd_none(*pgd)) continue; pud = pud_offset(pgd, 0);