summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2005-11-16 20:58:40 +0000
committerjhb <jhb@FreeBSD.org>2005-11-16 20:58:40 +0000
commit46154df54a190cc2bd51d884a3be6207e5ccf8f2 (patch)
tree19ed2e5ff4b6fae2b43b25381ac749d1728e117b /sys
parentf575703415ce6a8771cca675214388fd0504146d (diff)
downloadFreeBSD-src-46154df54a190cc2bd51d884a3be6207e5ccf8f2.zip
FreeBSD-src-46154df54a190cc2bd51d884a3be6207e5ccf8f2.tar.gz
Revert a part of the previous commits to these files that made the NMI
IPI_STOP handling code use atomic_readandclear() to execute the restart function on the first CPU to resume and restore the behavior of always executing the restart function on the BSP since this is in fact what the non-NMI IPI_STOP handler does. I did add back in a statement to clear the restart function pointer after it is executed to match the behavior of the non-NMI IPI_STOP handler.
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/mp_machdep.c9
-rw-r--r--sys/i386/i386/mp_machdep.c9
2 files changed, 8 insertions, 10 deletions
diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c
index be4f878..2e02f2c 100644
--- a/sys/amd64/amd64/mp_machdep.c
+++ b/sys/amd64/amd64/mp_machdep.c
@@ -1072,7 +1072,6 @@ ipi_nmi_handler()
{
int cpu = PCPU_GET(cpuid);
int cpumask = PCPU_GET(cpumask);
- void (*restartfunc)(void);
if (!(ipi_nmi_pending & cpumask))
return 1;
@@ -1091,10 +1090,10 @@ ipi_nmi_handler()
atomic_clear_int(&started_cpus, cpumask);
atomic_clear_int(&stopped_cpus, cpumask);
- restartfunc = (void (*)(void))atomic_readandclear_long(
- (u_long *)&cpustop_restartfunc);
- if (restartfunc != NULL)
- restartfunc();
+ if (cpu == 0 && cpustop_restartfunc != NULL) {
+ cpustop_restartfunc();
+ cpustop_restartfunc = NULL;
+ }
return 0;
}
diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c
index bfc3c5b..fab5e0f0 100644
--- a/sys/i386/i386/mp_machdep.c
+++ b/sys/i386/i386/mp_machdep.c
@@ -1311,7 +1311,6 @@ ipi_nmi_handler()
{
int cpu = PCPU_GET(cpuid);
int cpumask = PCPU_GET(cpumask);
- void (*restartfunc)(void);
if (!(ipi_nmi_pending & cpumask))
return 1;
@@ -1330,10 +1329,10 @@ ipi_nmi_handler()
atomic_clear_int(&started_cpus, cpumask);
atomic_clear_int(&stopped_cpus, cpumask);
- restartfunc = (void (*)(void))atomic_readandclear_int(
- (u_int *)&cpustop_restartfunc);
- if (restartfunc != NULL)
- restartfunc();
+ if (cpu == 0 && cpustop_restartfunc != NULL) {
+ cpustop_restartfunc();
+ cpustop_restartfunc = NULL;
+ }
return 0;
}
OpenPOWER on IntegriCloud