svn commit: r331874 - in head/sys: amd64/amd64 i386/i386
Andriy Gapon
avg at FreeBSD.org
Mon Apr 2 07:45:14 UTC 2018
Author: avg
Date: Mon Apr 2 07:45:13 2018
New Revision: 331874
URL: https://svnweb.freebsd.org/changeset/base/331874
Log:
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
Modified:
head/sys/amd64/amd64/vm_machdep.c
head/sys/i386/i386/vm_machdep.c
Modified: head/sys/amd64/amd64/vm_machdep.c
==============================================================================
--- head/sys/amd64/amd64/vm_machdep.c Mon Apr 2 05:15:25 2018 (r331873)
+++ head/sys/amd64/amd64/vm_machdep.c Mon Apr 2 07:45:13 2018 (r331874)
@@ -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)
Modified: head/sys/i386/i386/vm_machdep.c
==============================================================================
--- head/sys/i386/i386/vm_machdep.c Mon Apr 2 05:15:25 2018 (r331873)
+++ head/sys/i386/i386/vm_machdep.c Mon Apr 2 07:45:13 2018 (r331874)
@@ -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)
More information about the svn-src-head
mailing list