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

From: Dave Hansen
Date: Fri Mar 23 2018 - 15:38:13 EST


On 03/23/2018 12:34 PM, Nadav Amit wrote:
>>>> + /* mmdebug.h can not be included here because of dependencies */
>>>> +#ifdef CONFIG_DEBUG_VM
>>>> + 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);
>>>> +#endif
>>> Why not to use VM_WARN_ON_ONCE() and avoid the ifdef?
>> I wanted a message. VM_WARN_ON_ONCE() doesn't let you give a message.
> Right (my bad). But VM_WARN_ONCE() lets you.

I put a comment in up there about this ^^. #including mmdebug.h caused
dependency problems, so I basically just reimplemented it using
WARN_ONCE() and an #ifdef.