lkml.org 
[lkml]   [2019]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3] x86: mm: Do not use set_{pud,pmd}_safe when splitting the large page
From
Date
On 4/17/19 8:41 AM, Singh, Brijesh wrote:
> Changes since v2:
> - rename variable safe->init
> - rename __set_* -> set_*_init()
> - remame __*_populate -> *_populate_init()

"init" in this context really means "setting non-present PTEs is OK, but
changing present ones is not". It still doesn't do a great job of
conveying that because both the init=0 and init=1 variants are used
during init-time.

> +/*
> + * Create page table mapping for the physical memory for specific physical
> + * addresses. The virtual and physical addresses have to be aligned on PMD level
> + * down. It returns the last physical address mapped.
> + */
> +unsigned long __meminit
> +kernel_physical_mapping_init(unsigned long paddr_start,
> + unsigned long paddr_end,
> + unsigned long page_size_mask)
> +{
> + return __kernel_physical_mapping_init(paddr_start, paddr_end,
> + page_size_mask, true);
> +}

The comment here is missing one key point:
kernel_physical_mapping_init() can only be used to populate non-present
entries. It kinda infers that from "Create...", but I really think we
need to be explicit.

Anyway, it's better than it was, and it does fix a bug, so:

Reviewed-by: Dave Hansen <dave.hansen@intel.com>

But please flesh out that comment if you do another version for some reason.

\
 
 \ /
  Last update: 2019-04-17 19:25    [W:0.052 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site