]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/ia64/mm/init.c
[IA64] lazy_mmu_prot_update needs to be aware of huge pages
[linux-2.6-omap-h63xx.git] / arch / ia64 / mm / init.c
index 3748768c787b3fc65125d38f1f90e1faa4df5875..674736129b876b1c0ce4204ae6fdae35429aaef8 100644 (file)
@@ -109,6 +109,7 @@ lazy_mmu_prot_update (pte_t pte)
 {
        unsigned long addr;
        struct page *page;
+       unsigned long order;
 
        if (!pte_exec(pte))
                return;                         /* not an executable page... */
@@ -119,7 +120,12 @@ lazy_mmu_prot_update (pte_t pte)
        if (test_bit(PG_arch_1, &page->flags))
                return;                         /* i-cache is already coherent with d-cache */
 
-       flush_icache_range(addr, addr + PAGE_SIZE);
+       if (PageCompound(page)) {
+               order = (unsigned long) (page[1].lru.prev);
+               flush_icache_range(addr, addr + (1UL << order << PAGE_SHIFT));
+       }
+       else
+               flush_icache_range(addr, addr + PAGE_SIZE);
        set_bit(PG_arch_1, &page->flags);       /* mark page as clean */
 }
 
@@ -294,7 +300,7 @@ put_kernel_page (struct page *page, unsigned long address, pgprot_t pgprot)
        return page;
 }
 
-static void
+static void __init
 setup_gate (void)
 {
        struct page *page;
@@ -556,7 +562,7 @@ count_reserved_pages (u64 start, u64 end, void *arg)
  * purposes.
  */
 
-static int nolwsys;
+static int nolwsys __initdata;
 
 static int __init
 nolwsys_setup (char *s)