Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86/x86 Further reduce the loop counter so that hat...



details:   https://anonhg.NetBSD.org/src/rev/b13dcbfed68a
branches:  trunk
changeset: 824588:b13dcbfed68a
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Sat Jun 10 05:31:34 2017 +0000

description:
Further reduce the loop counter so that hatching completes before the
boot processor times us out.

Add a nice big XXX comment for why the counter is so low.

XXX Will need to pullup to NetBSD-7 branch

diffstat:

 sys/arch/x86/x86/cpu.c |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (33 lines):

diff -r 5c83f76ec8b1 -r b13dcbfed68a sys/arch/x86/x86/cpu.c
--- a/sys/arch/x86/x86/cpu.c    Sat Jun 10 05:29:36 2017 +0000
+++ b/sys/arch/x86/x86/cpu.c    Sat Jun 10 05:31:34 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.c,v 1.130 2017/05/31 14:41:07 kre Exp $    */
+/*     $NetBSD: cpu.c,v 1.131 2017/06/10 05:31:34 pgoyette Exp $       */
 
 /*-
  * Copyright (c) 2000-2012 NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.130 2017/05/31 14:41:07 kre Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.131 2017/06/10 05:31:34 pgoyette Exp $");
 
 #include "opt_ddb.h"
 #include "opt_mpbios.h"                /* for MPDEBUG */
@@ -835,7 +835,13 @@
                        }
                        x86_mwait(0, 0);
                } else {
-                       for (i = 100; i != 0; i--) {
+       /*
+        * XXX The loop repetition count could be a lot higher, but
+        * XXX currently qemu emulator takes a _very_long_time_ to
+        * XXX execute the pause instruction.  So for now, use a low
+        * XXX value to allow the cpu to hatch before timing out.
+        */
+                       for (i = 50; i != 0; i--) {
                                x86_pause();
                        }
                }



Home | Main Index | Thread Index | Old Index