On Tue, 8 Mar 2022 14:32:25 +0100 David Hildenbrand <david@xxxxxxxxxx> wrote: [...] > > > - using set_pte_at() here seems a bit dangerous, as I'm not sure if this will > > always only operate on invalid PTEs. Using it on active valid PTEs could > > result in TLB issues because of missing flush. Also not sure about kvm impact. > > Using ptep_set_access_flags() seems safer, again similar to touch_pmd() and > > also cow_user_page(). > > Yeah, I sticked to what follow_pfn_pte() does for simplicity for now. Uh oh, that set_pte_at() in follow_pfn_pte() also looks dangerous, at least I do not spontaneously see that it would only be used for invalid / pte_none() PTEs. But that is a totally different story, and maybe (hopefully) not affecting s390 until we have proper DAX support...