]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
KVM: x86: nSVM: expose clean bit support to the guest
authorMaxim Levitsky <mlevitsk@redhat.com>
Mon, 7 Feb 2022 15:54:22 +0000 (17:54 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 8 Feb 2022 18:30:49 +0000 (13:30 -0500)
KVM already honours few clean bits thus it makes sense
to let the nested guest know about it.

Note that KVM also doesn't check if the hardware supports
clean bits, and therefore nested KVM was
already setting clean bits and L0 KVM
was already honouring them.

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Message-Id: <20220207155447.840194-6-mlevitsk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/svm.c

index 2ea7985028fe5e0a55cf6c487757c6271b6555de..0e3521316d6b447397a237569aa4f857e91e8bc1 100644 (file)
@@ -4652,6 +4652,7 @@ static __init void svm_set_cpu_caps(void)
        /* CPUID 0x80000001 and 0x8000000A (SVM features) */
        if (nested) {
                kvm_cpu_cap_set(X86_FEATURE_SVM);
+               kvm_cpu_cap_set(X86_FEATURE_VMCBCLEAN);
 
                if (nrips)
                        kvm_cpu_cap_set(X86_FEATURE_NRIPS);