diff options
author | tegge <tegge@FreeBSD.org> | 2000-08-07 02:28:37 +0000 |
---|---|---|
committer | tegge <tegge@FreeBSD.org> | 2000-08-07 02:28:37 +0000 |
commit | e372881b3ce12f98dc8cd41f53e05538b8d117c4 (patch) | |
tree | 1c600834c161f3faf8d6b06c25c7ced06b7dd5e3 | |
parent | fb32fc5d86d0c974cd3ed9f1bd5187f412ee4683 (diff) | |
download | FreeBSD-src-e372881b3ce12f98dc8cd41f53e05538b8d117c4.zip FreeBSD-src-e372881b3ce12f98dc8cd41f53e05538b8d117c4.tar.gz |
Add workaround for livelock problem when starting APs.
With more than 1 AP present, an AP could fail to properly release
the mp lock before waiting for smp_started to become nonzero.
With early startup of APs, the BSP could fail to properly release
the mp lock before waiting for smp_started to become nonzero.
-rw-r--r-- | sys/amd64/amd64/mpboot.S | 4 | ||||
-rw-r--r-- | sys/i386/i386/mpboot.s | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/sys/amd64/amd64/mpboot.S b/sys/amd64/amd64/mpboot.S index ac24c66..d3602d2 100644 --- a/sys/amd64/amd64/mpboot.S +++ b/sys/amd64/amd64/mpboot.S @@ -121,6 +121,8 @@ mp_begin: /* now running relocated at KERNBASE */ call _ap_init call _rel_mplock + lock /* Avoid livelock (PIII Errata 39) */ + addl $0,-4(%esp) 2: cmpl $0, CNAME(smp_started) /* Wait for last AP to be ready */ jz 2b @@ -133,6 +135,8 @@ NON_GPROF_ENTRY(wait_ap) pushl %ebp movl %esp, %ebp call _rel_mplock + lock /* Avoid livelock (PIII Errata 39) */ + addl $0,0(%esp) movl %eax, 8(%ebp) 1: cmpl $0, CNAME(smp_started) diff --git a/sys/i386/i386/mpboot.s b/sys/i386/i386/mpboot.s index ac24c66..d3602d2 100644 --- a/sys/i386/i386/mpboot.s +++ b/sys/i386/i386/mpboot.s @@ -121,6 +121,8 @@ mp_begin: /* now running relocated at KERNBASE */ call _ap_init call _rel_mplock + lock /* Avoid livelock (PIII Errata 39) */ + addl $0,-4(%esp) 2: cmpl $0, CNAME(smp_started) /* Wait for last AP to be ready */ jz 2b @@ -133,6 +135,8 @@ NON_GPROF_ENTRY(wait_ap) pushl %ebp movl %esp, %ebp call _rel_mplock + lock /* Avoid livelock (PIII Errata 39) */ + addl $0,0(%esp) movl %eax, 8(%ebp) 1: cmpl $0, CNAME(smp_started) |