From 1af05cbf3b5304ea12ab8a0040cb3769800a020e Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Sat, 16 Jul 2016 13:07:46 -0700 Subject: [PATCH] kernel - Refactor Xinvltlb (2) * Backout the optimization where we avoided invalidating the tlb on pte creation when the prior contents of the pte was 0. The time has not yet come for this, there are still a few situations where we appear to clear kernel pte's out without invalidating, which means that we must invalidate when we enter new pte's into a pmap. Reported-by: marino --- sys/platform/pc64/x86_64/pmap.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/platform/pc64/x86_64/pmap.c b/sys/platform/pc64/x86_64/pmap.c index 3906b7fb69..a33b818c94 100644 --- a/sys/platform/pc64/x86_64/pmap.c +++ b/sys/platform/pc64/x86_64/pmap.c @@ -1339,10 +1339,15 @@ pmap_kenter(vm_offset_t va, vm_paddr_t pa) kernel_pmap.pmap_bits[PG_V_IDX]; // pgeflag; ptep = vtopte(va); +#if 1 + pmap_inval_smp(&kernel_pmap, va, ptep, npte); +#else + /* FUTURE */ if (*ptep) pmap_inval_smp(&kernel_pmap, va, ptep, npte); else *ptep = npte; +#endif } /* @@ -1362,7 +1367,12 @@ pmap_kenter_quick(vm_offset_t va, vm_paddr_t pa) kernel_pmap.pmap_bits[PG_V_IDX]; // pgeflag; ptep = vtopte(va); +#if 1 + res = 1; +#else + /* FUTURE */ res = (*ptep != 0); +#endif *ptep = npte; cpu_invlpg((void *)va); -- 2.11.4.GIT