From: KAMEZAWA Hiroyuki Fixing 2 small issues pointed by Tony Luck. * removing redundant BUG_ON in __ia64_sync_icache_dcache(). * check pte_present() first. Signed-off-by: KAMEZAWA Hiroyuki Cc: "Luck, Tony" Cc: Christoph Lameter Cc: Hugh Dickins Cc: Nick Piggin Cc: David S. Miller Signed-off-by: Andrew Morton --- arch/ia64/mm/init.c | 2 -- include/asm-ia64/pgtable.h | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff -puN arch/ia64/mm/init.c~flush-icache-before-set_pte-on-ia64-flush-icache-at-set_pte-fix arch/ia64/mm/init.c --- a/arch/ia64/mm/init.c~flush-icache-before-set_pte-on-ia64-flush-icache-at-set_pte-fix +++ a/arch/ia64/mm/init.c @@ -60,8 +60,6 @@ __ia64_sync_icache_dcache (pte_t pte) struct page *page; unsigned long order; - BUG_ON(!pte_exec(pte)); - page = pte_page(pte); addr = (unsigned long) page_address(page); diff -puN include/asm-ia64/pgtable.h~flush-icache-before-set_pte-on-ia64-flush-icache-at-set_pte-fix include/asm-ia64/pgtable.h --- a/include/asm-ia64/pgtable.h~flush-icache-before-set_pte-on-ia64-flush-icache-at-set_pte-fix +++ a/include/asm-ia64/pgtable.h @@ -327,8 +327,8 @@ ia64_phys_addr_valid (unsigned long addr extern void __ia64_sync_icache_dcache(pte_t pteval); static inline void set_pte(pte_t *ptep, pte_t pteval) { - if (pte_exec(pteval) && // flush only new executable page. - pte_present(pteval) && // swap out ? + if (pte_present(pteval) &&// swap out ? + pte_exec(pteval) && // flush only new executable page. pte_user(pteval) && // ignore kernel page (!pte_present(*ptep) ||// do_no_page or swap in, migration, pte_pfn(*ptep) != pte_pfn(pteval))) // do_wp_page(), page copy _