Module Name: src
Committed By: jruoho
Date: Sat Aug 21 04:36:29 UTC 2010
Modified Files:
src/sys/arch/x86/acpi: acpi_cpu_md.c
Log Message:
Detect Intel's Turbo Boost and presence of IA32_APERF/IA32_MPERF. The former
is required for a quirk, and the latter is needed for hardware P-state
coordination (once acpicpu(4) will support fine-grained coordination).
To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/x86/acpi/acpi_cpu_md.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.22 src/sys/arch/x86/acpi/acpi_cpu_md.c:1.23
--- src/sys/arch/x86/acpi/acpi_cpu_md.c:1.22 Sat Aug 21 03:55:24 2010
+++ src/sys/arch/x86/acpi/acpi_cpu_md.c Sat Aug 21 04:36:29 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_md.c,v 1.22 2010/08/21 03:55:24 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_md.c,v 1.23 2010/08/21 04:36:29 jruoho Exp $ */
/*-
* Copyright (c) 2010 Jukka Ruohonen <[email protected]>
@@ -27,7 +27,7 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.c,v 1.22 2010/08/21 03:55:24 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.c,v 1.23 2010/08/21 04:36:29 jruoho Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -146,6 +146,21 @@
val |= ACPICPU_FLAG_T_FFH;
/*
+ * See if MSR_APERF, MSR_MPERF,
+ * and Turbo Boost are available.
+ */
+ if (cpuid_level >= 0x06) {
+
+ x86_cpuid(0x06, regs);
+
+ if ((regs[2] & __BIT(0)) != 0) /* ECX.06[0] */
+ val |= ACPICPU_FLAG_P_HW;
+
+ if ((regs[0] & __BIT(1)) != 0)
+ val |= ACPICPU_FLAG_P_TURBO; /* EAX.06[1] */
+ }
+
+ /*
* Detect whether TSC is invariant. If it is not,
* we keep the flag to note that TSC will not run
* at constant rate. Depending on the CPU, this may