OSDN Git Service

KVM: SVM: Skip SEV cache flush if no ASIDs have been used
authorSean Christopherson <seanjc@google.com>
Thu, 22 Apr 2021 02:11:25 +0000 (19:11 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 26 Apr 2021 09:27:17 +0000 (05:27 -0400)
commit469bb32b68d5a414fea293c17b532329c6dc9612
tree41833bf693c816cfcb2828f15f12e26b8ab312ff
parent82b7ae0481aeed393094e4f73bf4566a504b86bc
KVM: SVM: Skip SEV cache flush if no ASIDs have been used

Skip SEV's expensive WBINVD and DF_FLUSH if there are no SEV ASIDs
waiting to be reclaimed, e.g. if SEV was never used.  This "fixes" an
issue where the DF_FLUSH fails during hardware teardown if the original
SEV_INIT failed.  Ideally, SEV wouldn't be marked as enabled in KVM if
SEV_INIT fails, but that's a problem for another day.

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