summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2005-10-24 20:52:26 +0000
committerjhb <jhb@FreeBSD.org>2005-10-24 20:52:26 +0000
commit3e00318de1032463a061de977e2d24d2c7f6bbce (patch)
tree7cd74f9528141c8c620def588b85253aa567773c /sys/i386
parent2f00e0670ed16444e0faedcb9c2ec02736e72002 (diff)
downloadFreeBSD-src-3e00318de1032463a061de977e2d24d2c7f6bbce.zip
FreeBSD-src-3e00318de1032463a061de977e2d24d2c7f6bbce.tar.gz
Use xchg in Xcpustop to close a race and make cpustop_restartfunc truly
one-shot in the SMP case (before using the simple mov / cmp / mov sequence could allow multiple CPUs to execute the restart function on resume).
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/i386/apic_vector.s5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/i386/i386/apic_vector.s b/sys/i386/i386/apic_vector.s
index 99b765f..e8f6f9d 100644
--- a/sys/i386/i386/apic_vector.s
+++ b/sys/i386/i386/apic_vector.s
@@ -340,10 +340,11 @@ IDTVEC(cpustop)
test %eax, %eax
jnz 2f
- movl CNAME(cpustop_restartfunc), %eax
+ xorl %eax, %eax
+ lock
+ xchgl CNAME(cpustop_restartfunc), %eax
test %eax, %eax
jz 2f
- movl $0, CNAME(cpustop_restartfunc) /* One-shot */
call *%eax
2:
OpenPOWER on IntegriCloud