svn commit: r331875 - in head/sys: amd64/amd64 i386/i386

Andriy Gapon avg at FreeBSD.org
Mon Apr 2 08:06:19 UTC 2018


Author: avg
Date: Mon Apr  2 08:06:18 2018
New Revision: 331875
URL: https://svnweb.freebsd.org/changeset/base/331875

Log:
  x86 cpu_reset: if failed to switch to BSP proceed to cpu_reset_real
  
  If cpu_reset() is called on an AP and if it somehow fails to wake the
  BSP, then it's better to attempt the reset on the AP than just sit there
  spinning on an unusable and undebuggable system.
  
  MFC after:	16 days

Modified:
  head/sys/amd64/amd64/vm_machdep.c
  head/sys/i386/i386/vm_machdep.c

Modified: head/sys/amd64/amd64/vm_machdep.c
==============================================================================
--- head/sys/amd64/amd64/vm_machdep.c	Mon Apr  2 07:45:13 2018	(r331874)
+++ head/sys/amd64/amd64/vm_machdep.c	Mon Apr  2 08:06:18 2018	(r331875)
@@ -611,13 +611,14 @@ cpu_reset()
 				ia32_pause();
 				cnt++;	/* Wait for BSP to announce restart */
 			}
-			if (cpu_reset_proxy_active == 0)
+			if (cpu_reset_proxy_active == 0) {
 				printf("cpu_reset: Failed to restart BSP\n");
-			cpu_reset_proxy_active = 2;
-
-			while (1)
-				ia32_pause();
-			/* NOTREACHED */
+			} else {
+				cpu_reset_proxy_active = 2;
+				while (1)
+					ia32_pause();
+				/* NOTREACHED */
+			}
 		}
 
 		DELAY(1000000);

Modified: head/sys/i386/i386/vm_machdep.c
==============================================================================
--- head/sys/i386/i386/vm_machdep.c	Mon Apr  2 07:45:13 2018	(r331874)
+++ head/sys/i386/i386/vm_machdep.c	Mon Apr  2 08:06:18 2018	(r331875)
@@ -623,13 +623,14 @@ cpu_reset()
 				ia32_pause();
 				cnt++;	/* Wait for BSP to announce restart */
 			}
-			if (cpu_reset_proxy_active == 0)
+			if (cpu_reset_proxy_active == 0) {
 				printf("cpu_reset: Failed to restart BSP\n");
-			cpu_reset_proxy_active = 2;
-
-			while (1)
-				ia32_pause();
-			/* NOTREACHED */
+			} else {
+				cpu_reset_proxy_active = 2;
+				while (1)
+					ia32_pause();
+				/* NOTREACHED */
+			}
 		}
 
 		DELAY(1000000);


More information about the svn-src-all mailing list