Skip to content
  • Andrey Ryabinin's avatar
    x86/kasan, mm: Introduce generic kasan_populate_zero_shadow() · 69786cdb
    Andrey Ryabinin authored
    Introduce generic kasan_populate_zero_shadow(shadow_start,
    shadow_end). This function maps kasan_zero_page to the
    [shadow_start, shadow_end] addresses.
    This replaces x86_64 specific populate_zero_shadow() and will
    be used for ARM64 in follow on patches.
    The main changes from original version are:
     * Use p?d_populate*() instead of set_p?d()
     * Use memblock allocator directly instead of vmemmap_alloc_block()
     * __pa() instead of __pa_nodebug(). __pa() causes troubles
       iff we use it before kasan_early_init(). kasan_populate_zero_shadow()
       will be used later, so we ok with __pa() here.
    Signed-off-by: default avatarAndrey Ryabinin <>
    Acked-by: default avatarCatalin Marinas <>
    Cc: Alexander Potapenko <>
    Cc: Alexey Klimov <>
    Cc: Andrew Morton <>
    Cc: Aneesh Kumar K.V <>
    Cc: Arnd Bergmann <>
    Cc: David Keitel <>
    Cc: Dmitry Vyukov <>
    Cc: Linus Torvalds <>
    Cc: Linus Walleij <>
    Cc: Peter Zijlstra <>
    Cc: Rik van Riel <>
    Cc: Thomas Gleixner <>
    Cc: Will Deacon <>
    Cc: Yury <>
    Signed-off-by: default avatarIngo Molnar <>