From e372881b3ce12f98dc8cd41f53e05538b8d117c4 Mon Sep 17 00:00:00 2001 From: tegge Date: Mon, 7 Aug 2000 02:28:37 +0000 Subject: 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. --- sys/amd64/amd64/mpboot.S | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sys/amd64') 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) -- cgit v1.1