• Tom Lendacky's avatar
    KVM: SVM: Remove unneeded WBINVD and DF_FLUSH when starting SEV guests · 0fc5deae
    Tom Lendacky authored
    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: default avatarDavid Rientjes <rientjes@google.com>
    Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    0fc5deae
svm.c 187 KB