Index: sys/x86/x86/mp_x86.c =================================================================== --- sys/x86/x86/mp_x86.c +++ sys/x86/x86/mp_x86.c @@ -45,6 +45,7 @@ #ifdef GPROF #include #endif +#include #include #include #include @@ -1269,6 +1270,12 @@ CPU_CLR_ATOMIC(cpu, &started_cpus); CPU_CLR_ATOMIC(cpu, &stopped_cpus); + /* + * We don't broadcast TLB invalidations to other CPUs when they are + * stopped. Hence, we clear the TLB before resuming. + */ + invltlb_glob(); + #if defined(__amd64__) && defined(DDB) amd64_db_resume_dbreg(); #endif @@ -1427,6 +1434,10 @@ uint32_t generation; int cpu; + /* It is not necessary to signal other CPUs while in the debugger. */ + if (kdb_active || panicstr != NULL) + return; + /* * Check for other cpus. Return if none. */