Module Name: src Committed By: jym Date: Sun Aug 8 00:48:46 UTC 2010
Modified Files: src/sys/arch/x86/x86: intel_busclock.c Log Message: Some core i7 CPUs report model 0c. In this case, check for the extended model value. Required to avoid faulting on rdmsr(MSR_FSB_FREQ) early during boot. Will ask for a pull-up. This affects GENERIC, and most likely, install iso too. XXX quick hack. Obtaining FSB through ACPI should be cleaner. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/x86/x86/intel_busclock.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/x86/x86/intel_busclock.c diff -u src/sys/arch/x86/x86/intel_busclock.c:1.10 src/sys/arch/x86/x86/intel_busclock.c:1.11 --- src/sys/arch/x86/x86/intel_busclock.c:1.10 Sun May 23 19:00:28 2010 +++ src/sys/arch/x86/x86/intel_busclock.c Sun Aug 8 00:48:46 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: intel_busclock.c,v 1.10 2010/05/23 19:00:28 christos Exp $ */ +/* $NetBSD: intel_busclock.c,v 1.11 2010/08/08 00:48:46 jym Exp $ */ /*- * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: intel_busclock.c,v 1.10 2010/05/23 19:00:28 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: intel_busclock.c,v 1.11 2010/08/08 00:48:46 jym Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -97,7 +97,19 @@ case 0x9: /* Pentium M (130 nm, Banias) */ bus_clock = 10000; break; - case 0xc: /* Atom, model 1 */ + case 0xc: /* Core i7, Atom, model 1 */ + /* + * XXX (See also case 0xe) + * Some core i7 CPUs can report model 0xc. + * Newer CPUs will GP when attemping to access MSR_FSB_FREQ. + * In the long-term, use ACPI instead of all this. + */ + switch (CPUID2EXTMODEL(ci->ci_signature)) { + case 0x2: + aprint_debug("%s: unable to determine bus speed", + device_xname(ci->ci_dev)); + goto print_msr; + } msr = rdmsr(MSR_FSB_FREQ); bus = (msr >> 0) & 0x7; switch (bus) { @@ -128,7 +140,7 @@ break; case 0xe: /* Core Duo/Solo */ /* - * XXX + * XXX (See also case 0xc) * Newer CPUs will GP when attemping to access MSR_FSB_FREQ. * In the long-term, use ACPI instead of all this. */