From: David Hildenbrand <david@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: linux-mm@kvack.org, David Hildenbrand <david@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
Mike Kravetz <mike.kravetz@oracle.com>,
Peter Xu <peterx@redhat.com>, Muchun Song <muchun.song@linux.dev>,
Miaohe Lin <linmiaohe@huawei.com>
Subject: [PATCH v1 0/2] mm/hugetlb: uffd-wp fixes for hugetlb_change_protection()
Date: Thu, 22 Dec 2022 21:55:09 +0100 [thread overview]
Message-ID: <20221222205511.675832-1-david@redhat.com> (raw)
Playing with virtio-mem and background snapshots (using uffd-wp) on
hugetlb in QEMU, I managed to trigger a VM_BUG_ON(). Looking into the
details, hugetlb_change_protection() seems to not handle uffd-wp correctly
in all cases.
Patch #1 fixes my test case. I don't have reproducers for patch #2, as
it requires running into migration entries.
I did not yet check in detail yet if !hugetlb code requires similar care.
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Miaohe Lin <linmiaohe@huawei.com>
David Hildenbrand (2):
mm/hugetlb: fix PTE marker handling in hugetlb_change_protection()
mm/hugetlb: fix uffd-wp handling for migration entries in
hugetlb_change_protection()
mm/hugetlb.c | 38 ++++++++++++++++----------------------
1 file changed, 16 insertions(+), 22 deletions(-)
--
2.38.1
next reply other threads:[~2022-12-22 20:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-22 20:55 David Hildenbrand [this message]
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
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=20221222205511.675832-1-david@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=linmiaohe@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mike.kravetz@oracle.com \
--cc=muchun.song@linux.dev \
--cc=peterx@redhat.com \
/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