From 5d29acd810249a8afdfcea40407a7704d5cc7be7 Mon Sep 17 00:00:00 2001 From: Andriy Gapon Date: Mon, 2 Apr 2018 07:45:13 +0000 Subject: [PATCH] x86 cpu_reset_proxy: no need to stop_cpus() the original processor The processor is "parked" in a spin-loop already and that's sufficient for the reset. There is nothing that stop_cpus() would add here, only extra complexity and fragility. The original processor does not need to enable interrupts now, in fact, it must not do that. MFC after: 2 weeks --- sys/amd64/amd64/vm_machdep.c | 4 ---- sys/i386/i386/vm_machdep.c | 4 ---- 2 files changed, 8 deletions(-) diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index 1e137cb2474..aa0bcb07d0f 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -569,14 +569,11 @@ cpu_set_user_tls(struct thread *td, void *tls_base) static void cpu_reset_proxy() { - cpuset_t tcrp; cpu_reset_proxy_active = 1; while (cpu_reset_proxy_active == 1) ia32_pause(); /* Wait for other cpu to see that we've started */ - CPU_SETOF(cpu_reset_proxyid, &tcrp); - stop_cpus(tcrp); printf("cpu_reset_proxy: Stopped CPU %d\n", cpu_reset_proxyid); DELAY(1000000); cpu_reset_real(); @@ -616,7 +613,6 @@ cpu_reset() } if (cpu_reset_proxy_active == 0) printf("cpu_reset: Failed to restart BSP\n"); - enable_intr(); cpu_reset_proxy_active = 2; while (1) diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index 3f84b2e02c4..1d9324ab1f0 100644 --- a/sys/i386/i386/vm_machdep.c +++ b/sys/i386/i386/vm_machdep.c @@ -581,14 +581,11 @@ kvtop(void *addr) static void cpu_reset_proxy() { - cpuset_t tcrp; cpu_reset_proxy_active = 1; while (cpu_reset_proxy_active == 1) ia32_pause(); /* Wait for other cpu to see that we've started */ - CPU_SETOF(cpu_reset_proxyid, &tcrp); - stop_cpus(tcrp); printf("cpu_reset_proxy: Stopped CPU %d\n", cpu_reset_proxyid); DELAY(1000000); cpu_reset_real(); @@ -628,7 +625,6 @@ cpu_reset() } if (cpu_reset_proxy_active == 0) printf("cpu_reset: Failed to restart BSP\n"); - enable_intr(); cpu_reset_proxy_active = 2; while (1)