summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorDimitry Andric <dim@cvs.openbsd.org>2006-12-21 22:31:08 +0000
committerDimitry Andric <dim@cvs.openbsd.org>2006-12-21 22:31:08 +0000
commit887485b3231bdbac7613a9368271e056c3362729 (patch)
tree5bc9c5c8dc2c47dbfccb41da36ad8e5928726798 /sys/arch/i386
parent7712ca0e12bd8ea8dc479b8bff845218d6b05ead (diff)
Quick fix for Core 2 Duo X6800, which reports an invalid setperf MSR,
with the same high and low speed, leading to a divide by zero error. A more complete fix will be committed later. Do it now, deraadt@
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/i386/est.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/arch/i386/i386/est.c b/sys/arch/i386/i386/est.c
index 81daf530875..51474a989aa 100644
--- a/sys/arch/i386/i386/est.c
+++ b/sys/arch/i386/i386/est.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: est.c,v 1.25 2006/12/20 17:50:40 gwk Exp $ */
+/* $OpenBSD: est.c,v 1.26 2006/12/21 22:31:07 dim Exp $ */
/*
* Copyright (c) 2003 Michael Eriksson.
* All rights reserved.
@@ -1049,6 +1049,10 @@ est_init(const char *cpu_device, int vendor)
}
low = MSR2MHZ(est_fqlist->table[est_fqlist->n - 1], bus_clock);
high = MSR2MHZ(est_fqlist->table[0], bus_clock);
+ if (low == high) {
+ printf(": high and low speed are the same, disabling EST\n");
+ return;
+ }
perflevel = (mhz - low) * 100 / (high - low);
/*