Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflictswith existing use

From: Jan Beulich
Date: Thu Aug 22 2013 - 07:34:08 EST


>>> On 22.08.13 at 13:27, Cyrill Gorcunov <gorcunov@xxxxxxxxx> wrote:
> On Thu, Aug 22, 2013 at 08:27:45AM +0100, Jan Beulich wrote:
>> >>> On 22.08.13 at 09:03, Cyrill Gorcunov <gorcunov@xxxxxxxxx> wrote:
>> > Ok, how about this?
>> >
>> > static inline pte_t pte_swp_mksoft_dirty(pte_t pte)
>> > {
>> > BUG_ON(pte_present(pte));
>> > return pte_set_flags(pte, _PAGE_SWP_SOFT_DIRTY);
>> > }
>>
>> Sure, fine with me. Perhaps VM_BUG_ON() or some other similar
>> construct limiting the scope when any extra code gets generated
>> would do too.
>
> Sorry for delay, the patch is below.
>
>>
>> But as said, even better would perhaps be to have it act on a
>> swp_entry_t.
>
> swp_entry_t is too small already to keep additional status bit,
> unfortunately.
> ---
> From: Cyrill Gorcunov <gorcunov@xxxxxxxxx>
> Subject: [PATCH] mm: Make sure _PAGE_SWP_SOFT_DIRTY bit is not set on
> present pte
>
> _PAGE_SOFT_DIRTY bit should never be set on present pte so add
> VM_BUG_ON to catch any potential future abuse.
>
> Also add a comment on _PAGE_SWP_SOFT_DIRTY definition explaining
> scope of its usage.
>
> Signed-off-by: Cyrill Gorcunov <gorcunov@xxxxxxxxxx>

Acked-by: Jan Beulich <jbeulich@xxxxxxxx>

Thanks, Jan

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/