]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
amd64 pmap: fix PCID mode invalidations
authorkib <kib@FreeBSD.org>
Mon, 14 Dec 2020 22:52:29 +0000 (22:52 +0000)
committerkib <kib@FreeBSD.org>
Mon, 14 Dec 2020 22:52:29 +0000 (22:52 +0000)
commitc4d8db0ecac11be8cf8bbe6ee169dbdf18870d47
treed2b1ffc9412c3c3242434e51b795b0573d0257a0
parent8b9ee45f93469c2d2fdbc3331fea8553ee4d169b
amd64 pmap: fix PCID mode invalidations

When r362031 moved local TLB invalidation after shootdown IPI send, it
moved too much.  In particular, PCID-mode clearing of the pm_gen
generation counters 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_tlb_shootdown().

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).

Move pin of the thread to pmap_invalidate_preipi(), and do unpin in
smp_masked_tlb_shootdown().

Reported and tested by: mjg (previous version)
Reviewed by: alc, cem (previous version), markj
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D227588
sys/amd64/amd64/mp_machdep.c
sys/amd64/amd64/pmap.c