K 10 svn:author V 3 alc K 8 svn:date V 27 2019-11-17T17:38:53.248473Z K 7 svn:log V 1255 Achieve two goals at once: (1) Avoid an unnecessary broadcast TLB invalidation in pmap_remove_all(). (2) Prevent an "invalid ASID" assertion failure in pmap_remove_all(). The architecture definition specifies that the TLB will not cache mappings that don't have the "AF" bit set, so pmap_remove_all() needn't issue a TLB invalidation for mappings that don't have the "AF" bit set. We allocate ASIDs lazily. Specifically, we don't allocate an ASID for a pmap until we are activating it. Now, consider what happens on a fork(). Before we activate the child's pmap, we use pmap_copy() to copy mappings from the parent's pmap to the child's. These new mappings have their "AF" bits cleared. Suppose that the page daemon decides to reclaim a page that underlies one of these new mappings. Previously, the pmap_invalidate_page() performed by pmap_remove_all() on a mapping in the child's pmap would fail an assertion because that pmap hasn't yet been assigned an ASID. However, we don't need to issue a TLB invalidation for such mappings because they can't possibly be cached in the TLB. Reported by: bob prohaska Reviewed by: markj MFC after: 1 week X-MFC-before: r354286 Differential Revision: https://reviews.freebsd.org/D22388 END