On Thu, Mar 09, 2017 at 09:25:11AM +0100, Ard Biesheuvel wrote:
> In preparation of extending the policy for manipulating kernel mappings
> with whether or not contiguous hints may be used in the page tables,
> replace the bool 'page_mappings_only' with a flags field and a flag
> NO_BLOCK_MAPPINGS.
> 
> Signed-off-by: Ard Biesheuvel <[email protected]>

Thanks for attacking this.

I was going to comment on the name change, but I see that the next patch
introduces and uses NO_CONT_MAPPINGS, so that's fine by me.

>  void __init create_pgd_mapping(struct mm_struct *mm, phys_addr_t phys,
>                              unsigned long virt, phys_addr_t size,
>                              pgprot_t prot, bool page_mappings_only)
>  {
> +     int flags;
> +
>       BUG_ON(mm == &init_mm);
>  
> +     if (page_mappings_only)
> +             flags = NO_BLOCK_MAPPINGS;

> +
>       __create_pgd_mapping(mm->pgd, phys, virt, size, prot,
> -                          pgd_pgtable_alloc, page_mappings_only);
> +                          pgd_pgtable_alloc, flags);
>  }

Given we can't pass the flags in to create_pgd_mapping() without
exposing those more generally, this also looks fine.

FWIW:

Reviewed-by: Mark Rutland <[email protected]>

Mark.
_______________________________________________
kvmarm mailing list
[email protected]
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

Reply via email to