if (!new)
return -ENOMEM;
- kasan_populate_pte(new, PAGE_KERNEL_RO);
+ if (early_mmu_has_feature(MMU_FTR_HPTE_TABLE))
+ kasan_populate_pte(new, PAGE_READONLY);
+ else
+ kasan_populate_pte(new, PAGE_KERNEL_RO);
pmd_populate_kernel(&init_mm, pmd, new);
}
return 0;
static void __init kasan_remap_early_shadow_ro(void)
{
- kasan_populate_pte(kasan_early_shadow_pte, PAGE_KERNEL_RO);
+ if (early_mmu_has_feature(MMU_FTR_HPTE_TABLE))
+ kasan_populate_pte(kasan_early_shadow_pte, PAGE_READONLY);
+ else
+ kasan_populate_pte(kasan_early_shadow_pte, PAGE_KERNEL_RO);
flush_tlb_kernel_range(KASAN_SHADOW_START, KASAN_SHADOW_END);
}