Re: [PATCH 2/2] x86/mm/KASLR: Adjust the vmemmap size according to paging mode

From: Kirill A. Shutemov
Date: Sun Sep 02 2018 - 16:52:56 EST


On Thu, Aug 30, 2018 at 11:25:12PM +0800, Baoquan He wrote:
> Hi Kirill,
>
> I made a new version according to your suggestion, just a little
> different, I didn't make 1TB as default, just calculate with the actual
> size, then align up to 1TB boundary. Just found kcore is printing more
> entries than before, I thought it's caused by my code, later got it was
> touchde by other people.
>
> Any comment about this? I can change accordingly.

Looks good to me.

But there's corner case when struct page is unreasonably large and
vmemmap_size will be way to large. We probably have to report an error if
we cannot fit vmemmap properly into virtual memory layout.

--
Kirill A. Shutemov