]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
KVM x86: Move kvm cpuid support out of svm
authorPeter Gonda <pgonda@google.com>
Thu, 21 Nov 2019 20:33:43 +0000 (12:33 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 27 Nov 2019 10:39:18 +0000 (11:39 +0100)
Memory encryption support does not have module parameter dependencies
and can be moved into the general x86 cpuid __do_cpuid_ent function.
This changes maintains current behavior of passing through all of
CPUID.8000001F.

Suggested-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Peter Gonda <pgonda@google.com>
Reviewed-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/cpuid.c
arch/x86/kvm/svm.c

index c0aa07487eb82cb3c7fca4491e346c101c54d6aa..813a4d2e5c0ceaa566044642836276847d0bbc7f 100644 (file)
@@ -778,6 +778,11 @@ static inline int __do_cpuid_func(struct kvm_cpuid_entry2 *entry, u32 function,
        case 0x8000001a:
        case 0x8000001e:
                break;
+       /* Support memory encryption cpuid if host supports it */
+       case 0x8000001F:
+               if (!boot_cpu_has(X86_FEATURE_SEV))
+                       entry->eax = entry->ebx = entry->ecx = entry->edx = 0;
+               break;
        /*Add support for Centaur's CPUID instruction*/
        case 0xC0000000:
                /*Just support up to 0xC0000004 now*/
index 362e874297e45b1364b9309052fc4632896a3257..122d4ce3b1ab055d1e7fae7ebb4745382d3346b4 100644 (file)
@@ -5958,13 +5958,6 @@ static void svm_set_supported_cpuid(u32 func, struct kvm_cpuid_entry2 *entry)
                if (npt_enabled)
                        entry->edx |= F(NPT);
 
-               break;
-       case 0x8000001F:
-               /* Support memory encryption cpuid if host supports it */
-               if (boot_cpu_has(X86_FEATURE_SEV))
-                       cpuid(0x8000001f, &entry->eax, &entry->ebx,
-                               &entry->ecx, &entry->edx);
-
        }
 }