> On Mar 19, 2022, at 5:07 PM, Nadav Amit <nadav.amit@xxxxxxxxx> wrote: > > From: Nadav Amit <namit@xxxxxxxxxx> > > Currently, using mprotect() to unprotect a memory region or uffd to > unprotect a memory region causes a TLB flush. However, in such cases the > PTE is often not modified (i.e., remain RO) and therefore not TLB flush > is needed. > > Add an arch-specific pte_needs_flush() which tells whether a TLB flush > is needed based on the old PTE and the new one. Implement an x86 > pte_needs_flush(). > > Always flush the TLB when it is architecturally needed even when > skipping a TLB flush might only result in a spurious page-faults by > skipping the flush. Errr.. Sent the wrong version. Will resend with new version number.