When r362031 moved local TLB invalidation after shootdown IPI send, it moved too much. In particular, PCID-mode clearing of the pm_gen must occur before IPIs are send, which is in fact described by the comment before seq_cst fence in the invalidation functions.
Fix it by extracting pm_gen clearing into new helper pmap_invalidate_preipi(), which is executed before a call to smp_masked_invlpg().
Rest of the local invalidation callbacks is simplified as result, and become very similar to the remote shootdown handlers (to be merged in some future).
Reported and tested by: mjg
[List of reviewers is identical to that of D25188]