Skip to contentSkip to conversation

kvm-userspace: Simulate Intel cpufreq MSRs in kvm guests to influence nice priority

RFC In review Darrick J. Wong 1 participant 1 message Jul 15, 2008 KVM

lore
Share & tools
lore
#0 lore raw

RFC 2/2 kvm-userspace: Simulate Intel cpufreq MSRs in kvm guests to influence nice priority

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.

---

 bios/acpi-dsdt.dsl        |   85 ++++++++++++++++++++++++++++++++++++++++++++-
 qemu/pc-bios/bios.bin     |  Bin
 qemu/target-i386/helper.c |    2 +
 3 files changed, 85 insertions(+), 2 deletions(-)
bios/acpi-dsdt.dsl +84 -1
index d1bfa2c..5f5a3c5 100755
@@ -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)
qemu/pc-bios/bios.bin binary +0 -0
index 3e5d96a..2b76c6e 100644
Binary files a/qemu/pc-bios/bios.bin and b/qemu/pc-bios/bios.bin differ
qemu/target-i386/helper.c +1 -1
index 3c710bf..6684754 100644
@@ -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,