shithub: riscv

Download patch

ref: 215f6cc64a65efbe0a71b8fdba72311201aca4fc
parent: aa125d37e9fcec887dddafc1e4725f0875ed38d9
author: cinap_lenrek <[email protected]>
date: Thu May 29 14:24:40 EDT 2014

pc: initiate machine reset only from boot processors in mpshutdown()

in vmware, mpshutdown() used to hang in i8042reset() when not
called from the boot processor, so instead of reseting from first
cpu that acquires the shutdown lock, we park all application
processors and let the boot processor do the reset.

--- a/sys/src/9/pc/mp.c
+++ b/sys/src/9/pc/mp.c
@@ -620,9 +620,10 @@
 void
 mpshutdown(void)
 {
-	static Lock shutdownlock;
-
-	if(active.rebooting || !canlock(&shutdownlock)){
+	/*
+	 * Park application processors.
+	 */
+	if(active.rebooting || m->machno != 0){
 		splhi();
 		arch->introff();
 		idle();