Index: linux-2.6.18-mm3/arch/ia64/mm/init.c =================================================================== --- linux-2.6.18-mm3.orig/arch/ia64/mm/init.c 2006-10-08 18:30:12.453602138 -0700 +++ linux-2.6.18-mm3/arch/ia64/mm/init.c 2006-10-09 13:31:34.479344797 -0700 @@ -496,7 +496,7 @@ create_mem_map_page_table (u64 start, u6 #ifdef CONFIG_VIRTUAL_MEM_MAP_HUGE unsigned long taddr = htlbpage_to_page(address); /* Keep region so that lookups can properly occur */ - pgd = pgd_offset(&init_mm, taddr); + pgd = pgd_offset_memmap(taddr); #else unsigned long taddr = address; pgd = pgd_offset_k(taddr); Index: linux-2.6.18-mm3/arch/ia64/mm/fault.c =================================================================== --- linux-2.6.18-mm3.orig/arch/ia64/mm/fault.c 2006-10-08 18:30:12.454578641 -0700 +++ linux-2.6.18-mm3/arch/ia64/mm/fault.c 2006-10-09 13:31:34.479344797 -0700 @@ -66,9 +66,9 @@ mapped_kernel_page_is_present (unsigned pte_t *ptep, pte; #ifdef CONFIG_VIRTUAL_MEM_MAP_HUGE - if (REGION_NUMBER(address) == RGN_HPAGE && address >= VIRTUAL_MEM_MAP) { + if (REGION_NUMBER(address) == RGN_HPAGE) { address = htlbpage_to_page(address); - pgd = pgd_offset(&init_mm, address); + pgd = pgd_offset_memmap(address); } else #endif pgd = pgd_offset_k(address); Index: linux-2.6.18-mm3/include/asm-ia64/pgtable.h =================================================================== --- linux-2.6.18-mm3.orig/include/asm-ia64/pgtable.h 2006-10-08 18:30:11.837429147 -0700 +++ linux-2.6.18-mm3/include/asm-ia64/pgtable.h 2006-10-09 13:31:34.476415291 -0700 @@ -341,7 +341,12 @@ pgd_offset (struct mm_struct *mm, unsign /* In the kernel's mapped region we completely ignore the region number (since we know it's in region number 5). */ #define pgd_offset_k(addr) \ - (init_mm.pgd + (((addr) >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1))) + (init_mm.pgd + (((REGION_OFFSET(addr)) >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1))) + +/* In the kernel's memory map region we completely ignore the region number + (since we know it's in region number 4). */ +#define pgd_offset_memmap(addr) \ + (memmap_pg_dir + (((REGION_OFFSET(addr)) >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1))) /* Look up a pgd entry in the gate area. On IA-64, the gate-area resides in the kernel-mapped segment, hence we use pgd_offset_k() @@ -440,6 +445,7 @@ pte_same (pte_t a, pte_t b) #define update_mmu_cache(vma, address, pte) do { } while (0) extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; +extern pgd_t memmap_pg_dir[PTRS_PER_PGD]; extern void paging_init (void); /* Index: linux-2.6.18-mm3/arch/ia64/kernel/head.S =================================================================== --- linux-2.6.18-mm3.orig/arch/ia64/kernel/head.S 2006-10-06 18:11:41.839813852 -0700 +++ linux-2.6.18-mm3/arch/ia64/kernel/head.S 2006-10-09 13:31:34.477391793 -0700 @@ -174,6 +174,10 @@ empty_zero_page: swapper_pg_dir: .skip PAGE_SIZE + .global memmap_pg_dir +memmap_pg_dir: + .skip PAGE_SIZE + .rodata halt_msg: stringz "Halting kernel\n"