From: Mike Kravetz <mike.kravetz@oracle.com>
To: David Hildenbrand <david@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Andrew Morton <akpm@linux-foundation.org>,
Peter Xu <peterx@redhat.com>, Muchun Song <muchun.song@linux.dev>,
Miaohe Lin <linmiaohe@huawei.com>,
stable@vger.kernel.org
Subject: Re: [PATCH v1 2/2] mm/hugetlb: fix uffd-wp handling for migration entries in hugetlb_change_protection()
Date: Thu, 22 Dec 2022 15:20:54 -0800 [thread overview]
Message-ID: <Y6TmVtE0gYqWStez@monkey> (raw)
In-Reply-To: <20221222205511.675832-3-david@redhat.com>
On 12/22/22 21:55, David Hildenbrand wrote:
> We have to update the uffd-wp SWP PTE bit independent of the type of
> migration entry. Currently, if we're unlucky and we want to install/clear
> the uffd-wp bit just while we're migrating a read-only mapped hugetlb page,
> we would miss to set/clear the uffd-wp bit.
>
> Further, if we're processing a readable-exclusive
> migration entry and neither want to set or clear the uffd-wp bit, we
> could currently end up losing the uffd-wp bit. Note that the same would
> hold for writable migrating entries, however, having a writable
> migration entry with the uffd-wp bit set would already mean that
> something went wrong.
>
> Note that the change from !is_readable_migration_entry ->
> writable_migration_entry is harmless and actually cleaner, as raised by
> Miaohe Lin and discussed in [1].
>
> [1] https://lkml.kernel.org/r/90dd6a93-4500-e0de-2bf0-bf522c311b0c@huawei.com
>
> Fixes: 60dfaad65aa9 ("mm/hugetlb: allow uffd wr-protect none ptes")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: David Hildenbrand <david@redhat.com>
> ---
> mm/hugetlb.c | 17 +++++++++--------
> 1 file changed, 9 insertions(+), 8 deletions(-)
Thanks,
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
--
Mike Kravetz
next prev parent reply other threads:[~2022-12-22 23:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-22 20:55 [PATCH v1 0/2] mm/hugetlb: uffd-wp fixes for hugetlb_change_protection() David Hildenbrand
2022-12-22 20:55 ` [PATCH v1 1/2] mm/hugetlb: fix PTE marker handling in hugetlb_change_protection() David Hildenbrand
2022-12-22 22:57 ` Mike Kravetz
2022-12-22 20:55 ` [PATCH v1 2/2] mm/hugetlb: fix uffd-wp handling for migration entries " David Hildenbrand
2022-12-22 23:20 ` Mike Kravetz [this message]
2022-12-22 21:17 ` [PATCH v1 0/2] mm/hugetlb: uffd-wp fixes for hugetlb_change_protection() Peter Xu
2022-12-22 21:28 ` Peter Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y6TmVtE0gYqWStez@monkey \
--to=mike.kravetz@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=linmiaohe@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=muchun.song@linux.dev \
--cc=peterx@redhat.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox