]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
amd64 pmap: fix PCID mode invalidations
authorKonstantin Belousov <kib@FreeBSD.org>
Mon, 14 Dec 2020 22:52:29 +0000 (22:52 +0000)
committerKonstantin Belousov <kib@FreeBSD.org>
Mon, 14 Dec 2020 22:52:29 +0000 (22:52 +0000)
commit3fd989da911870732b6a7ef43b6be866a8d79cce
treed2b1ffc9412c3c3242434e51b795b0573d0257a0
parentd5fe384b4d41a5c5adeaa6039d33d59d7bc33e76
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