diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2016-02-03 03:25:09 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2016-02-03 03:25:09 +0000 |
commit | 9d9767721264ca64b0cad2f9359a5f98671edf19 (patch) | |
tree | 00cb90c38b22d875ccb7939f774e5ae690af88d7 /sys/arch/i386 | |
parent | 43f44b9d916754985b60b76d71ef74f1fd3a16e9 (diff) |
Test cpuid_level or ci->ci_pnfeatset before using a CPUID leaf; some BIOSes
can disable leaves that CPU feature flags would seem to imply. Corrects
signal delivery on systems where the AVX leaf is disabled.
report and debugging help from Marcus MERIGHI (mcmer-openbsd (at) tor.at)
ok kettenis@
Diffstat (limited to 'sys/arch/i386')
-rw-r--r-- | sys/arch/i386/i386/cpu.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arch/i386/i386/cpu.c b/sys/arch/i386/i386/cpu.c index 612c958a94c..7ea5e0c28fa 100644 --- a/sys/arch/i386/i386/cpu.c +++ b/sys/arch/i386/i386/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.70 2015/12/27 04:31:34 jsg Exp $ */ +/* $OpenBSD: cpu.c,v 1.71 2016/02/03 03:25:07 guenther Exp $ */ /* $NetBSD: cpu.c,v 1.1.2.7 2000/06/26 02:04:05 sommerfeld Exp $ */ /*- @@ -784,7 +784,7 @@ cpu_init_mwait(struct device *dv) { unsigned int smallest, largest, extensions, c_substates; - if ((cpu_ecxfeature & CPUIDECX_MWAIT) == 0) + if ((cpu_ecxfeature & CPUIDECX_MWAIT) == 0 || cpuid_level < 0x5) return; /* get the monitor granularity */ |