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 Do not pause many times between testing if ...



details:   https://anonhg.NetBSD.org/src/rev/0644959cff94
branches:  trunk
changeset: 824284:0644959cff94
user:      maya <maya%NetBSD.org@localhost>
date:      Wed May 31 00:19:17 2017 +0000

description:
Do not pause many times between testing if the CPU can go.

This only impacts QEMU as QEMU's implementation of pause is
significantly slower than its implementation of nop.

PR kern/51623: running qemu-x86_64 with -smp 4 - the additional
CPUs don't start.

diffstat:

 sys/arch/x86/x86/cpu.c |  10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diffs (38 lines):

diff -r 714b8f9ff7d1 -r 0644959cff94 sys/arch/x86/x86/cpu.c
--- a/sys/arch/x86/x86/cpu.c    Wed May 31 00:18:21 2017 +0000
+++ b/sys/arch/x86/x86/cpu.c    Wed May 31 00:19:17 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.c,v 1.125 2017/05/23 08:54:39 nonaka Exp $ */
+/*     $NetBSD: cpu.c,v 1.126 2017/05/31 00:19:17 maya Exp $   */
 
 /*-
  * Copyright (c) 2000-2012 NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.125 2017/05/23 08:54:39 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.126 2017/05/31 00:19:17 maya Exp $");
 
 #include "opt_ddb.h"
 #include "opt_mpbios.h"                /* for MPDEBUG */
@@ -802,7 +802,7 @@
 {
        struct cpu_info *ci = (struct cpu_info *)v;
        struct pcb *pcb;
-       int s, i;
+       int s;
 
        cpu_init_msrs(ci, true);
        cpu_probe(ci);
@@ -835,9 +835,7 @@
                        }
                        x86_mwait(0, 0);
                } else {
-                       for (i = 10000; i != 0; i--) {
-                               x86_pause();
-                       }
+                       x86_pause();
                }
        }
 



Home | Main Index | Thread Index | Old Index