Re: [RFC][PATCH 05/10] x86/mm: do not auto-massage page protections

From: Nadav Amit
Date: Thu Feb 22 2018 - 16:46:55 EST


Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx> wrote:

>
> From: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
>
>
> +static inline pgprotval_t check_pgprot(pgprot_t pgprot)
> +{
> + pgprotval_t massaged_val = massage_pgprot(pgprot);
> +
> + WARN_ONCE(pgprot_val(pgprot) != massaged_val,
> + "attempted to set unsupported pgprot: %016lx "
> + "bits: %016lx supported: %016lx\n",
> + pgprot_val(pgprot),
> + pgprot_val(pgprot) ^ massaged_val,
> + __supported_pte_mask);

Perhaps use VM_WARN_ONCE instead to avoid any overhead on production
systems?