Re: [PATCH v2 2/2] arm64/mm/kasan: don't use vmemmap_populate() to initialize shadow

From: Andrey Ryabinin
Date: Tue Nov 07 2017 - 11:21:32 EST


On 11/06/2017 09:35 PM, Pavel Tatashin wrote:
> From: Will Deacon <will.deacon@xxxxxxx>
>
> The kasan shadow is currently mapped using vmemmap_populate() since that
> provides a semi-convenient way to map pages into init_top_pgt. However,
> since that no longer zeroes the mapped pages, it is not suitable for kasan,
> which requires zeroed shadow memory.
>
> Add kasan_populate_shadow() interface and use it instead of
> vmemmap_populate(). Besides, this allows us to take advantage of gigantic
> pages and use them to populate the shadow, which should save us some memory
> wasted on page tables and reduce TLB pressure.
>
> Signed-off-by: Will Deacon <will.deacon@xxxxxxx>
> Signed-off-by: Pavel Tatashin <pasha.tatashin@xxxxxxxxxx>
> ---

Acked-by: Andrey Ryabinin <aryabinin@xxxxxxxxxxxxx>