Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Apr 2018 12:39:33 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r332097 - stable/11/sys/i386/i386
Message-ID:  <201804061239.w36CdX1l015117@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Fri Apr  6 12:39:33 2018
New Revision: 332097
URL: https://svnweb.freebsd.org/changeset/base/332097

Log:
  MFC r331761: align i386 cpu_reset() with amd64 version

Modified:
  stable/11/sys/i386/i386/vm_machdep.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/i386/i386/vm_machdep.c
==============================================================================
--- stable/11/sys/i386/i386/vm_machdep.c	Fri Apr  6 12:23:59 2018	(r332096)
+++ stable/11/sys/i386/i386/vm_machdep.c	Fri Apr  6 12:39:33 2018	(r332097)
@@ -594,7 +594,8 @@ cpu_reset_proxy()
 
 	cpu_reset_proxy_active = 1;
 	while (cpu_reset_proxy_active == 1)
-		;	/* Wait for other cpu to see that we've started */
+		ia32_pause(); /* Wait for other cpu to see that we've started */
+
 	CPU_SETOF(cpu_reset_proxyid, &tcrp);
 	stop_cpus(tcrp);
 	printf("cpu_reset_proxy: Stopped CPU %d\n", cpu_reset_proxyid);
@@ -634,19 +635,21 @@ cpu_reset()
 			printf("cpu_reset: Restarting BSP\n");
 
 			/* Restart CPU #0. */
-			/* XXX: restart_cpus(1 << 0); */
 			CPU_SETOF(0, &started_cpus);
 			wmb();
 
 			cnt = 0;
-			while (cpu_reset_proxy_active == 0 && cnt < 10000000)
+			while (cpu_reset_proxy_active == 0 && cnt < 10000000) {
+				ia32_pause();
 				cnt++;	/* Wait for BSP to announce restart */
+			}
 			if (cpu_reset_proxy_active == 0)
 				printf("cpu_reset: Failed to restart BSP\n");
 			enable_intr();
 			cpu_reset_proxy_active = 2;
 
-			while (1);
+			while (1)
+				ia32_pause();
 			/* NOTREACHED */
 		}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201804061239.w36CdX1l015117>