Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mm/rmap: fixup copying of soft dirty and uffd ptes
During memory migration a pte is temporarily replaced with a migration swap pte. Some pte bits from the existing mapping such as the soft-dirty and uffd write-protect bits are preserved by copying these to the temporary migration swap pte. However these bits are not stored at the same location for swap and non-swap ptes. Therefore testing these bits requires using the appropriate helper function for the given pte type. Unfortunately several code locations were found where the wrong helper function is being used to test soft_dirty and uffd_wp bits which leads to them getting incorrectly set or cleared during page-migration. Fix these by using the correct tests based on pte type. Fixes: a5430dd ("mm/migrate: support un-addressable ZONE_DEVICE page in migration") Fixes: 8c3328f ("mm/migrate: migrate_vma() unmap page from vma while collecting pages") Fixes: f45ec5f ("userfaultfd: wp: support swap and page migration") Signed-off-by: Alistair Popple <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Reviewed-by: Peter Xu <[email protected]> Cc: Jérôme Glisse <[email protected]> Cc: John Hubbard <[email protected]> Cc: Ralph Campbell <[email protected]> Cc: Alistair Popple <[email protected]> Cc: <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
- Loading branch information