]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit - arch/x86/kvm/svm/svm.c
KVM: nSVM: Expose SVM features to L1 iff nested is enabled
authorSean Christopherson <sean.j.christopherson@intel.com>
Mon, 2 Mar 2020 23:57:07 +0000 (15:57 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 16 Mar 2020 16:58:43 +0000 (17:58 +0100)
commita50718cc3f43f12e6e33b098b5e2a9eb19f13158
tree6d4cd9dad31fcba4575d551bf4c1fe64643ac4e4
parent91661989d17ccec17bca199e7cb1f463ba4e5b78
KVM: nSVM: Expose SVM features to L1 iff nested is enabled

Set SVM feature bits in KVM capabilities if and only if nested=true, KVM
shouldn't advertise features that realistically can't be used.  Use
kvm_cpu_cap_has(X86_FEATURE_SVM) to indirectly query "nested" in
svm_set_supported_cpuid() in anticipation of moving CPUID 0x8000000A
adjustments into common x86 code.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm.c