summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2012-07-09 09:07:30 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2012-07-09 09:07:30 +0000
commit62c4f876b8ed9eef10a666d78f011ba1fa49bef8 (patch)
tree05f4edcf131ae145078723ff850f5994e3094a38 /sys
parent576a62ad9196583936cbaa168a704dec2f8cefae (diff)
Do not re-initialize ci_randseed on the primary cpu
ok kettenis
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/alpha/alpha/cpu.c3
-rw-r--r--sys/arch/amd64/amd64/cpu.c4
-rw-r--r--sys/arch/i386/i386/cpu.c4
-rw-r--r--sys/arch/mips64/mips64/cpu.c20
4 files changed, 16 insertions, 15 deletions
diff --git a/sys/arch/alpha/alpha/cpu.c b/sys/arch/alpha/alpha/cpu.c
index f73b9a13a79..5c0f7dddccd 100644
--- a/sys/arch/alpha/alpha/cpu.c
+++ b/sys/arch/alpha/alpha/cpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.c,v 1.28 2010/11/28 20:57:09 miod Exp $ */
+/* $OpenBSD: cpu.c,v 1.29 2012/07/09 09:07:25 deraadt Exp $ */
/* $NetBSD: cpu.c,v 1.44 2000/05/23 05:12:53 thorpej Exp $ */
/*-
@@ -396,6 +396,7 @@ cpu_boot_secondary_processors()
continue;
if (ci->ci_flags & CPUF_PRIMARY)
continue;
+ ci->ci_randseed = random();
/* This processor is all set up; boot it! */
cpu_boot_secondary(ci);
diff --git a/sys/arch/amd64/amd64/cpu.c b/sys/arch/amd64/amd64/cpu.c
index f5444285b3d..59363b5daab 100644
--- a/sys/arch/amd64/amd64/cpu.c
+++ b/sys/arch/amd64/amd64/cpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.c,v 1.48 2012/04/17 16:02:33 guenther Exp $ */
+/* $OpenBSD: cpu.c,v 1.49 2012/07/09 09:07:27 deraadt Exp $ */
/* $NetBSD: cpu.c,v 1.1 2003/04/26 18:39:26 fvdl Exp $ */
/*-
@@ -393,13 +393,13 @@ cpu_boot_secondary_processors(void)
ci = cpu_info[i];
if (ci == NULL)
continue;
- ci->ci_randseed = random();
if (ci->ci_idle_pcb == NULL)
continue;
if ((ci->ci_flags & CPUF_PRESENT) == 0)
continue;
if (ci->ci_flags & (CPUF_BSP|CPUF_SP|CPUF_PRIMARY))
continue;
+ ci->ci_randseed = random();
cpu_boot_secondary(ci);
}
}
diff --git a/sys/arch/i386/i386/cpu.c b/sys/arch/i386/i386/cpu.c
index c2d628e9a40..a0361342f41 100644
--- a/sys/arch/i386/i386/cpu.c
+++ b/sys/arch/i386/i386/cpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.c,v 1.42 2010/11/27 13:03:04 kettenis Exp $ */
+/* $OpenBSD: cpu.c,v 1.43 2012/07/09 09:07:28 deraadt Exp $ */
/* $NetBSD: cpu.c,v 1.1.2.7 2000/06/26 02:04:05 sommerfeld Exp $ */
/*-
@@ -395,13 +395,13 @@ cpu_boot_secondary_processors()
ci = cpu_info[i];
if (ci == NULL)
continue;
- ci->ci_randseed = random();
if (ci->ci_idle_pcb == NULL)
continue;
if ((ci->ci_flags & CPUF_PRESENT) == 0)
continue;
if (ci->ci_flags & (CPUF_BSP|CPUF_SP|CPUF_PRIMARY))
continue;
+ ci->ci_randseed = random();
cpu_boot_secondary(ci);
}
}
diff --git a/sys/arch/mips64/mips64/cpu.c b/sys/arch/mips64/mips64/cpu.c
index e1f9e0e70b5..494bafc4df5 100644
--- a/sys/arch/mips64/mips64/cpu.c
+++ b/sys/arch/mips64/mips64/cpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.c,v 1.44 2012/06/24 16:26:04 miod Exp $ */
+/* $OpenBSD: cpu.c,v 1.45 2012/07/09 09:07:29 deraadt Exp $ */
/*
* Copyright (c) 1997-2004 Opsycon AB (www.opsycon.se)
@@ -369,18 +369,18 @@ get_cpu_info(int cpuno)
void
cpu_boot_secondary_processors(void)
{
- struct cpu_info *ci;
+ struct cpu_info *ci;
CPU_INFO_ITERATOR cii;
CPU_INFO_FOREACH(cii, ci) {
- if ((ci->ci_flags & CPUF_PRESENT) == 0)
- continue;
- if (ci->ci_flags & CPUF_PRIMARY)
- continue;
-
- sched_init_cpu(ci);
- ci->ci_randseed = random();
- cpu_boot_secondary(ci);
+ if ((ci->ci_flags & CPUF_PRESENT) == 0)
+ continue;
+ if (ci->ci_flags & CPUF_PRIMARY)
+ continue;
+
+ ci->ci_randseed = random();
+ sched_init_cpu(ci);
+ cpu_boot_secondary(ci);
}
/* This must called after xheart0 has initialized, so here is