]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit3337a8ba3b6aefbfdd5f12b1be5ceda4e0c3d1ce
tree6d4cd9dad31fcba4575d551bf4c1fe64643ac4e4
parent355b47b897e1fcd5ae671a245b333b94b6d2ebe5
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