mm: Fix pte update and tlb maintenance ordering in migrate_vma_collect_pmd()
migrate_vma_collect_pmd() was previously modifying ptes while in lazy mmu mode, then performing tlb maintenance for the modified ptes, then leaving lazy mmu mode. But any pte modifications during lazy mmu mode may be deferred until arch_leave_lazy_mmu_mode(), inverting the required ordering between pte modificaiton and tlb maintenance. Let's fix that by leaving mmu mode (forcing all the pte updates to be actioned) before doing the tlb maintenance. This is a theorectical bug discovered during code review. Fixes: 60bae737 ("mm/migrate_device.c: flush TLB while holding PTL") Signed-off-by:Ryan Roberts <ryan.roberts@arm.com>
Loading
Please register or sign in to comment