]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: SVM: Remove unneeded WBINVD and DF_FLUSH when starting SEV guests
authorTom Lendacky <thomas.lendacky@amd.com>
Thu, 3 Oct 2019 21:17:46 +0000 (21:17 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 22 Oct 2019 11:34:08 +0000 (13:34 +0200)
commitdb065700e36f498169a4b2ceae1ad28cc73bad8e
tree7b01961086b363b48adde581f1eb721bef4d672f
parente73562ab43545ed70afd354f329e2df80012295f
KVM: SVM: Remove unneeded WBINVD and DF_FLUSH when starting SEV guests

Performing a WBINVD and DF_FLUSH are expensive operations. The SEV support
currently performs this WBINVD/DF_FLUSH combination when an SEV guest is
terminated, so there is no need for it to be done before LAUNCH.

However, when the SEV firmware transitions the platform from UNINIT state
to INIT state, all ASIDs will be marked invalid across all threads.
Therefore, as part of transitioning the platform to INIT state, perform a
WBINVD/DF_FLUSH after a successful INIT in the PSP/SEV device driver.
Since the PSP/SEV device driver is x86 only, it can reference and use the
WBINVD related functions directly.

Cc: Gary Hook <gary.hook@amd.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>
Tested-by: David Rientjes <rientjes@google.com>
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm.c
drivers/crypto/ccp/psp-dev.c