Revert part of the r338891 which reordered local invalidation and IPI.

For PCID case, there is a dependency between pm_gen zeroing and
reading pm_active for IPI target selection, to ensure that the
invalidation is not missed.

Reported and tested by:	mjg
Sponsored by:	The FreeBSD Foundation
Approved by:	re (gjb)
This commit is contained in:
Konstantin Belousov 2018-09-28 14:08:20 +00:00
parent 9e024036f5
commit f76bec2a28

View File

@ -1807,7 +1807,6 @@ pmap_invalidate_page(pmap_t pmap, vm_offset_t va)
("pmap_invalidate_page: invalid type %d", pmap->pm_type));
sched_pin();
smp_masked_invlpg(pmap_invalidate_cpu_mask(pmap), va, pmap);
if (pmap == kernel_pmap) {
invlpg(va);
} else {
@ -1815,6 +1814,7 @@ pmap_invalidate_page(pmap_t pmap, vm_offset_t va)
invlpg(va);
pmap_invalidate_page_mode(pmap, va);
}
smp_masked_invlpg(pmap_invalidate_cpu_mask(pmap), va, pmap);
sched_unpin();
}
@ -1910,7 +1910,6 @@ pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
("pmap_invalidate_range: invalid type %d", pmap->pm_type));
sched_pin();
smp_masked_invlpg_range(pmap_invalidate_cpu_mask(pmap), sva, eva, pmap);
if (pmap == kernel_pmap) {
for (addr = sva; addr < eva; addr += PAGE_SIZE)
invlpg(addr);
@ -1921,6 +1920,7 @@ pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
}
pmap_invalidate_range_mode(pmap, sva, eva);
}
smp_masked_invlpg_range(pmap_invalidate_cpu_mask(pmap), sva, eva, pmap);
sched_unpin();
}
@ -2021,8 +2021,8 @@ pmap_invalidate_all(pmap_t pmap)
("pmap_invalidate_all: invalid type %d", pmap->pm_type));
sched_pin();
smp_masked_invltlb(pmap_invalidate_cpu_mask(pmap), pmap);
pmap_invalidate_all_mode(pmap);
smp_masked_invltlb(pmap_invalidate_cpu_mask(pmap), pmap);
sched_unpin();
}