Author: avg
Date: Fri Mar 30 11:25:30 2018
New Revision: 331761
URL: https://svnweb.freebsd.org/changeset/base/331761

Log:
  align i386 cpu_reset() with amd64 version
  
  Maybe this code could be moved to x86.
  
  MFC after:    1 week

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

Modified: head/sys/i386/i386/vm_machdep.c
==============================================================================
--- head/sys/i386/i386/vm_machdep.c     Fri Mar 30 10:55:31 2018        
(r331760)
+++ head/sys/i386/i386/vm_machdep.c     Fri Mar 30 11:25:30 2018        
(r331761)
@@ -585,7 +585,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);
@@ -617,19 +618,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 */
                }
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to