]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
KVM: SVM: Report emulated SVM features to userspace
authorJoerg Roedel <joerg.roedel@amd.com>
Thu, 22 Apr 2010 10:33:12 +0000 (12:33 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 5 Jul 2010 18:16:13 +0000 (11:16 -0700)
This patch implements the reporting of the emulated SVM
features to userspace instead of the real hardware
capabilities. Every real hardware capability needs emulation
in nested svm so the old behavior was broken.

Cc: stable@kernel.org
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
(cherry picked from commit c2c63a493924e09a1984d1374a0e60dfd54fc0b0)

arch/x86/kvm/svm.c

index 33e052c4d62be350f563f2198d67ffa819fde96c..9b99342d75fdb746ee9d07a581efd1186c8bbeb2 100644 (file)
@@ -2887,6 +2887,16 @@ static u64 svm_get_mt_mask(struct kvm_vcpu *vcpu, gfn_t gfn, bool is_mmio)
 
 static void svm_set_supported_cpuid(u32 func, struct kvm_cpuid_entry2 *entry)
 {
+       switch (func) {
+       case 0x8000000A:
+               entry->eax = 1; /* SVM revision 1 */
+               entry->ebx = 8; /* Lets support 8 ASIDs in case we add proper
+                                  ASID emulation to nested SVM */
+               entry->ecx = 0; /* Reserved */
+               entry->edx = 0; /* Do not support any additional features */
+
+               break;
+       }
 }
 
 static const struct trace_print_flags svm_exit_reasons_str[] = {