From: "Darrick J. Wong" Subject: [RFC 2/2] kvm-userspace: Simulate Intel cpufreq MSRs in kvm guests to influence nice priority Date: Tue, 15 Jul 2008 16:18:42 -0700 Message-ID: <20080715231841.GF9465@tree.beaverton.ibm.com> Reply-To: djwong@us.ibm.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: kvm@vger.kernel.org Return-path: Received: from e34.co.us.ibm.com ([32.97.110.152]:41102 "EHLO e34.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753796AbYGOXSo (ORCPT ); Tue, 15 Jul 2008 19:18:44 -0400 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by e34.co.us.ibm.com (8.13.8/8.13.8) with ESMTP id m6FNIhNr003314 for ; Tue, 15 Jul 2008 19:18:43 -0400 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v9.0) with ESMTP id m6FNIh5k174490 for ; Tue, 15 Jul 2008 17:18:43 -0600 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m6FNIgfD024522 for ; Tue, 15 Jul 2008 17:18:42 -0600 Received: from localhost (tree.beaverton.ibm.com [9.47.17.114]) by d03av03.boulder.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id m6FNIgXK024510 for ; Tue, 15 Jul 2008 17:18:42 -0600 Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: This patch adds the necessary cpufreq data that go with the author's patch to the kernel sources to the ACPI tables. Current hokey bits: Since this table is static, the speeds are fixed at 900/1000/1100MHz. These probably ought to be generated dynamically. See part 1 of this patch for a more complete discussion. Signed-off-by: Darrick J. Wong --- bios/acpi-dsdt.dsl | 85 ++++++++++++++++++++++++++++++++++++++++++++- qemu/pc-bios/bios.bin | Bin qemu/target-i386/helper.c | 2 + 3 files changed, 85 insertions(+), 2 deletions(-) diff --git a/bios/acpi-dsdt.dsl b/bios/acpi-dsdt.dsl index d1bfa2c..5f5a3c5 100755 --- a/bios/acpi-dsdt.dsl +++ b/bios/acpi-dsdt.dsl @@ -25,6 +25,66 @@ DefinitionBlock ( 0x1 // OEM Revision ) { + Name (SPSS, Package(0x03) + { + Package (0x06) + { + 0x0000044C, + 0x00000440, + 0x00000100, + 0x00000100, + 0x00000003, + 0x00000003 + }, + Package (0x06) + { + 0x000003E8, + 0x00000220, + 0x00000100, + 0x00000100, + 0x00000002, + 0x00000002 + }, + Package (0x06) + { + 0x00000384, + 0x00000110, + 0x00000100, + 0x00000100, + 0x00000001, + 0x00000001 + } + }) + + Method (SPPC, 0, NotSerialized) + { + Return (Zero) + } + + Method (SPCT, 0, NotSerialized) + { + Return (Package (0x02) + { + ResourceTemplate () + { + Register (FFixedHW, + 0x40, + 0x00, + 0x0000000000000199, + ,) + }, + + ResourceTemplate () + { + Register (FFixedHW, + 0x10, + 0x00, + 0x0000000000000198, + ,) + } + }) + } + Scope (\_PR) { OperationRegion( PRST, SystemIO, 0xaf00, 0x02) @@ -44,11 +104,34 @@ DefinitionBlock ( Method (_STA) { \ Return(0xF) \ } \ + Method (_PPC, 0, NotSerialized) { \ + Return (SPPC) \ + } \ + Method (_PCT, 0, NotSerialized) { \ + Return (SPCT) \ + } \ + Method (_PSS, 0, NotSerialized) { \ + Return (SPSS) \ + } \ } \ - Processor (CPU0, 0x00, 0x0000b010, 0x06) {Method (_STA) { Return(0xF)}} + Processor (CPU0, 0x00, 0x0000b010, 0x06) + { + Method (_STA) { + Return(0xF) + } + Method (_PPC, 0, NotSerialized) { + Return (SPPC) + } + Method (_PCT, 0, NotSerialized) { + Return (SPCT) + } + Method (_PSS, 0, NotSerialized) { + Return (SPSS) + } + } gen_processor(1, 1) gen_processor(2, 2) gen_processor(3, 3) diff --git a/qemu/pc-bios/bios.bin b/qemu/pc-bios/bios.bin index 3e5d96a..2b76c6e 100644 Binary files a/qemu/pc-bios/bios.bin and b/qemu/pc-bios/bios.bin differ diff --git a/qemu/target-i386/helper.c b/qemu/target-i386/helper.c index 3c710bf..6684754 100644 --- a/qemu/target-i386/helper.c +++ b/qemu/target-i386/helper.c @@ -165,7 +165,7 @@ static x86_def_t x86_defs[] = { CPUID_MTRR | CPUID_CLFLUSH | CPUID_MCA | /* this feature is needed for Solaris and isn't fully implemented */ CPUID_PSE36, - .ext_features = CPUID_EXT_SSE3, + .ext_features = CPUID_EXT_SSE3 | CPUID_EXT_EST, .ext2_features = (PPRO_FEATURES & 0x0183F3FF) | CPUID_EXT2_LM | CPUID_EXT2_SYSCALL | CPUID_EXT2_NX | CPUID_EXT2_3DNOW | CPUID_EXT2_3DNOWEXT,