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 Add special handling for model 0x0f steppin...



details:   https://anonhg.NetBSD.org/src/rev/ccd8f1d4f744
branches:  trunk
changeset: 1008578:ccd8f1d4f744
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Fri Mar 27 09:47:03 2020 +0000

description:
Add special handling for model 0x0f stepping >=2 or mode 0x0e to get Tjmax.

diffstat:

 sys/arch/x86/x86/coretemp.c |  18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diffs (46 lines):

diff -r 8b81afa70ee3 -r ccd8f1d4f744 sys/arch/x86/x86/coretemp.c
--- a/sys/arch/x86/x86/coretemp.c       Fri Mar 27 09:19:33 2020 +0000
+++ b/sys/arch/x86/x86/coretemp.c       Fri Mar 27 09:47:03 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: coretemp.c,v 1.36 2018/07/11 03:36:32 msaitoh Exp $ */
+/* $NetBSD: coretemp.c,v 1.37 2020/03/27 09:47:03 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: coretemp.c,v 1.36 2018/07/11 03:36:32 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: coretemp.c,v 1.37 2020/03/27 09:47:03 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -271,6 +271,19 @@
        sc->sc_tjmax = 100;
 
        if ((model == 0x0f && stepping >= 2) || (model == 0x0e)) {
+               /*
+                * Check MSR_IA32_PLATFORM_ID(0x17) bit 28. It's not documented
+                * in the datasheet, but the following page describes the
+                * detail:
+                *   http://software.intel.com/en-us/articles/
+                *     mobile-intel-core2-processor-detection-table/
+                *   Was: http://softwarecommunity.intel.com/Wiki/Mobility/
+                *     720.htm
+                */
+               if (rdmsr_safe(MSR_IA32_PLATFORM_ID, &msr) != 0)
+                       goto notee;
+               if ((model < 0x17) && ((msr & __BIT(28)) == 0))
+                       goto notee;
 
                if (rdmsr_safe(MSR_IA32_EXT_CONFIG, &msr) == EFAULT)
                        return;
@@ -290,6 +303,7 @@
                } else
                        sc->sc_tjmax = 90;
        } else {
+notee:
                /*
                 * Attempt to get Tj(max) from IA32_TEMPERATURE_TARGET,
                 * but only consider the interval [70, 110] C as valid.



Home | Main Index | Thread Index | Old Index