lkml.org 
[lkml]   [2020]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] x86/mm: Make pud_present() check _PAGE_PROTNONE and _PAGE_PSE as well
From
Date


On 03/18/2020 10:31 AM, Anshuman Khandual wrote:
> pud_present() should also check _PAGE_PROTNONE and _PAGE_PSE bits like in
> case pmd_present(). This makes a PUD entry test positive for pud_present()
> after getting invalidated with pud_mknotpresent(), hence standardizing the
> semantics with PMD helpers.
>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Borislav Petkov <bp@alien8.de>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Cc: Dave Hansen <dave.hansen@intel.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: x86@kernel.org
> Cc: linux-mm@kvack.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
> ---
> Even though pud_mknotpresent() is not used any where currently, there is
> a discrepancy between PMD and PUD.
>
> WARN_ON(!pud_present(pud_mknotpresent(pud_mkhuge(pud)))) -> Fail
> WARN_ON(!pmd_present(pmd_mknotpresent(pmd_mkhuge(pmd)))) -> Pass
>
> Though pud_mknotpresent() currently clears _PAGE_PROTNONE, pud_present()
> does not check it. This change fixes both inconsistencies.
>
> This has been build and boot tested on x86.

Adding Kirill and Dan.

+Cc: Kirill A. Shutemov <kirill@shutemov.name>
+Cc: Dan Williams <dan.j.williams@intel.com>

\
 
 \ /
  Last update: 2020-03-20 04:24    [W:0.066 / U:1.676 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site