diff -ur sys.orig/amd64/amd64/pmap.c sys/amd64/amd64/pmap.c --- sys.orig/amd64/amd64/pmap.c 2022-01-22 10:51:13.042684000 +0700 +++ sys/amd64/amd64/pmap.c 2022-01-22 18:01:08.000000000 +0700 @@ -2337,8 +2337,6 @@ { u_int cpuid, i; - sched_pin(); - cpuid = PCPU_GET(cpuid); if (pmap != PCPU_GET(curpmap)) cpuid = 0xffffffff; /* An impossible value */ @@ -2364,7 +2362,6 @@ static void pmap_invalidate_preipi_nopcid(pmap_t pmap __unused) { - sched_pin(); } DEFINE_IFUNC(static, void, pmap_invalidate_preipi, (pmap_t), static) @@ -2667,7 +2664,6 @@ void pmap_invalidate_cache(void) { - sched_pin(); smp_cache_flush(pmap_invalidate_cache_curcpu_cb); } diff -ur sys.orig/x86/x86/mp_x86.c sys/x86/x86/mp_x86.c --- sys.orig/x86/x86/mp_x86.c 2022-01-22 10:51:13.063203000 +0700 +++ sys/x86/x86/mp_x86.c 2022-01-22 18:04:03.000000000 +0700 @@ -1656,9 +1656,6 @@ * underlying processor, even when this processor is not set in the * mask. So, the callback function must be prepared to handle such * spurious invocations. - * - * This function must be called with the thread pinned, and it unpins on - * completion. */ static void smp_targeted_tlb_shootdown(cpuset_t mask, u_int vector, pmap_t pmap, @@ -1668,6 +1665,8 @@ volatile uint32_t *p_cpudone; uint32_t generation; int cpu; + + sched_pin(); /* * It is not necessary to signal other CPUs while booting or