Re: [Patch v2] x86/head/64: remove redundant check on level2_kernel_pgt's _PAGE_PRESENT bit

From: Kirill A . Shutemov
Date: Thu May 23 2024 - 06:33:39 EST


On Thu, May 23, 2024 at 08:37:52AM +0000, Wei Yang wrote:
> This patch tries to remove a redundant check on kernel code's PMD
> _PAGE_PRESENT attribute before fix up.

Tries? s/This patch tries to r/R/

> Current process looks like this:
>
> pmd in [0, _text)
> unset _PAGE_PRESENT
> pmd in [_text, _end]
> if (_PAGE_PRESENT)
> fix up delta
> pmd in (_end, 512)
> unset _PAGE_PRESENT
>
> Since we have compiled in _PAGE_PRESENT in this page table, it is not
> necessary to check _PAGE_PRESENT again before fixing up delta

level2_kernel_pgt compiled with _PAGE_PRESENT set. The check is
redundant.


--
Kiryl Shutsemau / Kirill A. Shutemov