Skip to contentSkip to conversation

SVM enabled processor should provide cpuid Fn8000_000A

PATCH In review Bernhard Kauer 2 participants 2 messages Dec 18, 2007 – Dec 24, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 SVM enabled processor should provide cpuid Fn8000_000A

An SVM enabled processor should provide the CPUID extended leaf Fn8000_000A (see AMD documentation #25481). The attached patch add this feature.

Bernhard Kauer

Index: target-i386/helper.c
===================================================================
RCS file: /sources/qemu/qemu/target-i386/helper.c,v retrieving revision 1.97

helper.c +6 -0
diff -u -r1.97 helper.c
@@ -1751,6 +1819,12 @@
         ECX = 0;
         EDX = 0;
         break;
+    case 0x8000000A:
+        EAX = 0x00000001;
+        EBX = 0;
+        ECX = 0;
+        EDX = 0;
+	break;
     default:
         /* reserved values: zero */
         EAX = 0;

Index: target-i386/helper2.c
===================================================================
RCS file: /sources/qemu/qemu/target-i386/helper2.c,v retrieving revision 1.60

helper2.c +1 -1
diff -u -r1.60 helper2.c
@@ -150,7 +150,7 @@
         .ext2_features = (PPRO_FEATURES & 0x0183F3FF) | 
             CPUID_EXT2_LM | CPUID_EXT2_SYSCALL | CPUID_EXT2_NX,
         .ext3_features = CPUID_EXT3_SVM,
-        .xlevel = 0x80000008,
+        .xlevel = 0x8000000A,
     },
 #endif
     {
#1 lore raw

Now that you're really using the SVM emulation, please bear in mind that the upper SVM exits don't work due to the 64-bit int limits. I haven't really found a proper solution for that, but in the meantime you can't intercept instructions like MONITOR or WBINVD, as they get shifted out of the TB identifier.

Just so you know.

Quoted 6 lines · Bernhard Kauer

An SVM enabled processor should provide the CPUID extended leaf Fn8000_000A (see AMD documentation #25481). The attached patch add this feature.

Bernhard Kauer
<qemu_cpuid.diff>

This one is really important as it makes current kvm versions run. Please apply.

Alex