]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: SEV: Set sev_info.active after initial checks in sev_guest_init()
authorSean Christopherson <seanjc@google.com>
Tue, 9 Nov 2021 21:50:58 +0000 (21:50 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 18 Nov 2021 07:10:27 +0000 (02:10 -0500)
commit0b321913c982cf9b1e309ddcaf42a9075b2a1aac
tree4e58e579acef8e0a7884feee36a78b9b33a4e85f
parent907c47494045aa8c858600fc329b5856fdb6d89b
KVM: SEV: Set sev_info.active after initial checks in sev_guest_init()

Set sev_info.active during SEV/SEV-ES activation before calling any code
that can potentially consume sev_info.es_active, e.g. set "active" and
"es_active" as a pair immediately after the initial sanity checks.  KVM
generally expects that es_active can be true if and only if active is
true, e.g. sev_asid_new() deliberately avoids sev_es_guest() so that it
doesn't get a false negative.  This will allow WARNing in sev_es_guest()
if the VM is tagged as SEV-ES but not SEV.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20211109215101.2211373-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/sev.c