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 <[email protected]>

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

Reply via email to