@@ -500,6 +500,8 @@ struct kvm_ioeventfd {
#define KVM_CAP_PCI_SEGMENT 47
+#define KVM_CAP_SVM_CPUID_FIXED 52
+
#ifdef KVM_CAP_IRQ_ROUTING
struct kvm_irq_routing_irqchip {
@@ -1291,8 +1291,19 @@ int kvm_arch_init_vcpu(CPUState *cenv)
qemu_kvm_cpuid_on_env(©);
limit = copy.regs[R_EAX];
- for (i = 0x80000000; i <= limit; ++i)
- do_cpuid_ent(&cpuid_ent[cpuid_nent++], i, 0, ©);
+ for (i = 0x80000000; i <= limit; ++i) {
+ do_cpuid_ent(&cpuid_ent[cpuid_nent], i, 0, ©);
+ switch (i) {
+ case 0x8000000a:
+ if (!kvm_check_extension(kvm_state, KVM_CAP_SVM_CPUID_FIXED))
+ break;
+ cpuid_ent[cpuid_nent].eax = kvm_arch_get_supported_cpuid(cenv, 0x8000000a, R_EAX);
+ cpuid_ent[cpuid_nent].ebx = kvm_arch_get_supported_cpuid(cenv, 0x8000000a, R_EBX);
+ cpuid_ent[cpuid_nent].edx = kvm_arch_get_supported_cpuid(cenv, 0x8000000a, R_EDX);
+ break;
+ }
+ cpuid_nent += 1;
+ }
kvm_setup_cpuid2(cenv, cpuid_nent, cpuid_ent);
@@ -421,6 +421,8 @@
#define CPUID_EXT3_IBS (1 << 10)
#define CPUID_EXT3_SKINIT (1 << 12)
+#define CPUID_SVM_NPT (1 << 0)
+
#define CPUID_VENDOR_INTEL_1 0x756e6547 /* "Genu" */
#define CPUID_VENDOR_INTEL_2 0x49656e69 /* "ineI" */
#define CPUID_VENDOR_INTEL_3 0x6c65746e /* "ntel" */
@@ -2220,7 +2220,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
*eax = 0x00000001; /* SVM Revision */
*ebx = 0x00000010; /* nr of ASIDs */
*ecx = 0;
- *edx = 0; /* optional features */
+ *edx = 0;
break;
default:
/* reserved values: zero */