The patch titled Subject: mm/hmm: do not ignore specific pte fault flag in hmm_vma_fault() has been added to the -mm tree. Its filename is mm-hmm-use-device-driver-encoding-for-hmm-pfn-v2-fix.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-hmm-use-device-driver-encoding-for-hmm-pfn-v2-fix.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-hmm-use-device-driver-encoding-for-hmm-pfn-v2-fix.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Ralph Campbell <rcampbell@xxxxxxxxxx> Subject: mm/hmm: do not ignore specific pte fault flag in hmm_vma_fault() Save requested fault flags from caller supplied pfns array before overwriting it with the special none value. Without this we would not fault on all cases requested by caller, leading to caller calling us in a loop unless something else did change the CPU page table. Link: http://lkml.kernel.org/r/20180326213009.2460-2-jglisse@xxxxxxxxxx Signed-off-by: Ralph Campbell <rcampbell@xxxxxxxxxx> Signed-off-by: Jérôme Glisse <jglisse@xxxxxxxxxx> Cc: Evgeny Baskakov <ebaskakov@xxxxxxxxxx> Cc: Mark Hairgrove <mhairgrove@xxxxxxxxxx> Cc: John Hubbard <jhubbard@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/hmm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff -puN mm/hmm.c~mm-hmm-use-device-driver-encoding-for-hmm-pfn-v2-fix mm/hmm.c --- a/mm/hmm.c~mm-hmm-use-device-driver-encoding-for-hmm-pfn-v2-fix +++ a/mm/hmm.c @@ -498,10 +498,11 @@ static int hmm_vma_handle_pte(struct mm_ bool fault, write_fault; uint64_t cpu_flags; pte_t pte = *ptep; + uint64_t orig_pfn = *pfn; *pfn = range->values[HMM_PFN_NONE]; cpu_flags = pte_to_hmm_pfn_flags(range, pte); - hmm_pte_need_fault(hmm_vma_walk, *pfn, cpu_flags, + hmm_pte_need_fault(hmm_vma_walk, orig_pfn, cpu_flags, &fault, &write_fault); if (pte_none(pte)) { @@ -528,7 +529,7 @@ static int hmm_vma_handle_pte(struct mm_ range->flags[HMM_PFN_DEVICE_PRIVATE]; cpu_flags |= is_write_device_private_entry(entry) ? range->flags[HMM_PFN_WRITE] : 0; - hmm_pte_need_fault(hmm_vma_walk, *pfn, cpu_flags, + hmm_pte_need_fault(hmm_vma_walk, orig_pfn, cpu_flags, &fault, &write_fault); if (fault || write_fault) goto fault; _ Patches currently in -mm which might be from rcampbell@xxxxxxxxxx are mm-hmm-documentation-editorial-update-to-hmm-documentation.patch mm-hmm-hmm-should-have-a-callback-before-mm-is-destroyed-v3.patch mm-hmm-use-device-driver-encoding-for-hmm-pfn-v2-fix.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html