• Sean Christopherson's avatar
    KVM: SVM: Drop redundant svm_sev_enabled() helper · a5c1c5aa
    Sean Christopherson authored
    Replace calls to svm_sev_enabled() with direct checks on sev_enabled, or
    in the case of svm_mem_enc_op, simply drop the call to svm_sev_enabled().
    This effectively replaces checks against a valid max_sev_asid with checks
    against sev_enabled.  sev_enabled is forced off by sev_hardware_setup()
    if max_sev_asid is invalid, all call sites are guaranteed to run after
    sev_hardware_setup(), and all of the checks care about SEV being fully
    enabled (as opposed to intentionally handling the scenario where
    max_sev_asid is valid but SEV enabling fails due to OOM).
    
    Reviewed by: Tom Lendacky <thomas.lendacky@amd.com>
    Reviewed-by: default avatarBrijesh Singh <brijesh.singh@amd.com>
    Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
    Message-Id: <20210422021125.3417167-14-seanjc@google.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    a5c1c5aa
svm.h 16.6 KB