* [folded-merged] mm-userfaultfd-fix-a-few-thp-pmd-missing-uffd-wp-bit.patch removed from -mm tree
@ 2021-07-01 0:52 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2021-07-01 0:52 UTC (permalink / raw)
To: aarcange, almasrymina, axelrasmussen, bgeffon, dgilbert, hughd,
jglisse, joe, kirill, lokeshgidra, mike.kravetz, mm-commits,
oupton, peterx, rppt, sfr, shli, shuah, viro, wangqing
The patch titled
Subject: mm/userfaultfd: fix a few thp pmd missing uffd-wp bit
has been removed from the -mm tree. Its filename was
mm-userfaultfd-fix-a-few-thp-pmd-missing-uffd-wp-bit.patch
This patch was dropped because it was folded into mm-userfaultfd-fix-uffd-wp-special-cases-for-fork.patch
------------------------------------------------------
From: Peter Xu <peterx@redhat.com>
Subject: mm/userfaultfd: fix a few thp pmd missing uffd-wp bit
These include:
1. When remove migration pmd entry, should keep the uffd-wp bit from
swap pte. Note that we need to do this after setting write bit just in
case we need to remove it.
2. When change huge pmd and convert write -> read migration entry,
persist the same uffd-wp bit.
3. When convert pmd to swap entry, should drop the uffd-wp bit always.
Link: https://lkml.kernel.org/r/20210428225030.9708-4-peterx@redhat.com
Signed-off-by: Peter Xu <peterx@redhat.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Axel Rasmussen <axelrasmussen@google.com>
Cc: Brian Geffon <bgeffon@google.com>
Cc: "Dr . David Alan Gilbert" <dgilbert@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: Joe Perches <joe@perches.com>
Cc: Kirill A. Shutemov <kirill@shutemov.name>
Cc: Lokesh Gidra <lokeshgidra@google.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Cc: Mina Almasry <almasrymina@google.com>
Cc: Oliver Upton <oupton@google.com>
Cc: Shaohua Li <shli@fb.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Wang Qing <wangqing@vivo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
include/linux/swapops.h | 2 ++
mm/huge_memory.c | 4 ++++
2 files changed, 6 insertions(+)
--- a/include/linux/swapops.h~mm-userfaultfd-fix-a-few-thp-pmd-missing-uffd-wp-bit
+++ a/include/linux/swapops.h
@@ -265,6 +265,8 @@ static inline swp_entry_t pmd_to_swp_ent
if (pmd_swp_soft_dirty(pmd))
pmd = pmd_swp_clear_soft_dirty(pmd);
+ if (pmd_swp_uffd_wp(pmd))
+ pmd = pmd_swp_clear_uffd_wp(pmd);
arch_entry = __pmd_to_swp_entry(pmd);
return swp_entry(__swp_type(arch_entry), __swp_offset(arch_entry));
}
--- a/mm/huge_memory.c~mm-userfaultfd-fix-a-few-thp-pmd-missing-uffd-wp-bit
+++ a/mm/huge_memory.c
@@ -1832,6 +1832,8 @@ int change_huge_pmd(struct vm_area_struc
newpmd = swp_entry_to_pmd(entry);
if (pmd_swp_soft_dirty(*pmd))
newpmd = pmd_swp_mksoft_dirty(newpmd);
+ if (pmd_swp_uffd_wp(*pmd))
+ newpmd = pmd_swp_mkuffd_wp(newpmd);
set_pmd_at(mm, addr, pmd, newpmd);
}
goto unlock;
@@ -3242,6 +3244,8 @@ void remove_migration_pmd(struct page_vm
pmde = pmd_mksoft_dirty(pmde);
if (is_write_migration_entry(entry))
pmde = maybe_pmd_mkwrite(pmde, vma);
+ if (pmd_swp_uffd_wp(*pvmw->pmd))
+ pmde = pmd_wrprotect(pmd_mkuffd_wp(pmde));
flush_cache_range(vma, mmun_start, mmun_start + HPAGE_PMD_SIZE);
if (PageAnon(new))
_
Patches currently in -mm which might be from peterx@redhat.com are
mm-gup_benchmark-support-threading.patch
userfaultfd-selftests-use-user-mode-only.patch
userfaultfd-selftests-remove-the-time-check-on-delayed-uffd.patch
userfaultfd-selftests-dropping-verify-check-in-locking_thread.patch
userfaultfd-selftests-only-dump-counts-if-mode-enabled.patch
userfaultfd-selftests-unify-error-handling.patch
mm-thp-simplify-copying-of-huge-zero-page-pmd-when-fork.patch
mm-userfaultfd-fix-uffd-wp-special-cases-for-fork.patch
mm-userfaultfd-fail-uffd-wp-registeration-if-not-supported.patch
mm-pagemap-export-uffd-wp-protection-information.patch
userfaultfd-selftests-add-pagemap-uffd-wp-test.patch
userfaultfd-selftests-reinitialize-test-context-in-each-test-fix.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-07-01 0:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-01 0:52 [folded-merged] mm-userfaultfd-fix-a-few-thp-pmd-missing-uffd-wp-bit.patch removed from -mm tree akpm
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.