]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
For amd64 non-PCID machines, and for i386 machines with support for
authorKonstantin Belousov <kib@FreeBSD.org>
Thu, 3 Dec 2015 11:14:14 +0000 (11:14 +0000)
committerKonstantin Belousov <kib@FreeBSD.org>
Thu, 3 Dec 2015 11:14:14 +0000 (11:14 +0000)
commit27691a24ab5e0df1f3d65a735df0974d77910e3d
tree75c40eece99b5dfdb79cdf57b3e74fd84f9976f0
parent906430e4f0653dc09a87b82d13a4d834f67b5765
For amd64 non-PCID machines, and for i386 machines with support for
the PG_G global pte flag, pmap_invalidate_all() fails to flush global
TLB entries [*].  This is because TLB shootdown handler for such
configs reloads CR3, and on i386 pmap_invalidate_all() does the same
for the initiating CPU.  Note that current code does not issue total
invalidation requests for the kernel_pmap.

Rename amd64 function invltlb_globpcid() to invltlb_glob(), it is not
specific for PCID for quite some time, and implement the same
functionality for i386.  Use the function instead of invltlb() in
shootdown handlers and in i386 pmap_invalidate_all(), but only for the
kernel pmap (which maps pages with the PG_G attribute set), which
takes care of PG_G TLB entries on flush.

To detect the affected pmap in i386 TLB shootdown handler, pmap should
be passed to the smp_masked_invltlb() function, which makes amd64 and
i386 TLB shootdown code almost identical.  Merge the code under x86/.

Noted by: jhb [*]
Reviewed by: cem, jhb, pho
Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D4346
sys/amd64/amd64/mp_machdep.c
sys/amd64/amd64/pmap.c
sys/amd64/include/cpufunc.h
sys/amd64/include/smp.h
sys/i386/i386/mp_machdep.c
sys/i386/i386/pmap.c
sys/i386/include/pmap.h
sys/i386/include/smp.h
sys/x86/x86/mp_x86.c