Module Name: src Committed By: bouyer Date: Mon Nov 25 08:23:32 UTC 2013
Modified Files: src/sys/arch/x86/acpi [netbsd-6]: acpi_cpu_md.c src/sys/dev/acpi [netbsd-6]: acpi_cpu_tstate.c Log Message: Pull up following revision(s) (requested by jruoho in ticket #987): sys/arch/x86/acpi/acpi_cpu_md.c: revision 1.74 sys/dev/acpi/acpi_cpu_tstate.c: revision 1.32 As discussed with bouyer@, fix a too eager T-state validation check to accomodate new Intel CPUs. Allow 4-bit range for MSR_THERM_CONTROL. To generate a diff of this commit: cvs rdiff -u -r1.71.2.1 -r1.71.2.2 src/sys/arch/x86/acpi/acpi_cpu_md.c cvs rdiff -u -r1.30 -r1.30.8.1 src/sys/dev/acpi/acpi_cpu_tstate.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/acpi/acpi_cpu_md.c diff -u src/sys/arch/x86/acpi/acpi_cpu_md.c:1.71.2.1 src/sys/arch/x86/acpi/acpi_cpu_md.c:1.71.2.2 --- src/sys/arch/x86/acpi/acpi_cpu_md.c:1.71.2.1 Thu Dec 13 23:41:57 2012 +++ src/sys/arch/x86/acpi/acpi_cpu_md.c Mon Nov 25 08:23:31 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_cpu_md.c,v 1.71.2.1 2012/12/13 23:41:57 riz Exp $ */ +/* $NetBSD: acpi_cpu_md.c,v 1.71.2.2 2013/11/25 08:23:31 bouyer Exp $ */ /*- * Copyright (c) 2010, 2011 Jukka Ruohonen <jruoho...@iki.fi> @@ -27,7 +27,7 @@ * SUCH DAMAGE. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.c,v 1.71.2.1 2012/12/13 23:41:57 riz Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.c,v 1.71.2.2 2013/11/25 08:23:31 bouyer Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -992,7 +992,7 @@ acpicpu_md_tstate_set(struct acpicpu_tst uint8_t i; val = ts->ts_control; - val = val & __BITS(1, 4); + val = val & __BITS(0, 4); wrmsr(MSR_THERM_CONTROL, val); Index: src/sys/dev/acpi/acpi_cpu_tstate.c diff -u src/sys/dev/acpi/acpi_cpu_tstate.c:1.30 src/sys/dev/acpi/acpi_cpu_tstate.c:1.30.8.1 --- src/sys/dev/acpi/acpi_cpu_tstate.c:1.30 Wed Jun 22 08:49:54 2011 +++ src/sys/dev/acpi/acpi_cpu_tstate.c Mon Nov 25 08:23:31 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_cpu_tstate.c,v 1.30 2011/06/22 08:49:54 jruoho Exp $ */ +/* $NetBSD: acpi_cpu_tstate.c,v 1.30.8.1 2013/11/25 08:23:31 bouyer Exp $ */ /*- * Copyright (c) 2010 Jukka Ruohonen <jruoho...@iki.fi> @@ -27,7 +27,7 @@ * SUCH DAMAGE. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_tstate.c,v 1.30 2011/06/22 08:49:54 jruoho Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_tstate.c,v 1.30.8.1 2013/11/25 08:23:31 bouyer Exp $"); #include <sys/param.h> #include <sys/kmem.h> @@ -334,9 +334,14 @@ acpicpu_tstate_tss_add(struct acpicpu_ts *p = val[i]; /* - * The minimum should be around 100 / 8 = 12.5 %. + * The minimum should be either 12.5 % or 6.5 %, + * the latter 4-bit dynamic range being available + * in some newer models; see Section 14.5.3.1 in + * + * Intel 64 and IA-32 Architectures Software + * Developer's Manual. Volume 3B, Part 2. 2013. */ - if (ts->ts_percent < 10 || ts->ts_percent > 100) + if (ts->ts_percent < 6 || ts->ts_percent > 100) return AE_BAD_DECIMAL_CONSTANT; if (ts->ts_latency == 0 || ts->ts_latency > 1000)