Skip to content

Commit

Permalink
KVM: SVM: Explicitly check max SEV ASID during sev_hardware_setup()
Browse files Browse the repository at this point in the history
Query max_sev_asid directly after setting it instead of bouncing through
its wrapper, svm_sev_enabled().  Using the wrapper is unnecessary
obfuscation.

No functional change intended.

Reviewed by: Tom Lendacky <thomas.lendacky@amd.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210422021125.3417167-12-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
Sean Christopherson authored and Paolo Bonzini committed Apr 26, 2021
1 parent 4cafd0c commit 8cb756b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions arch/x86/kvm/svm/sev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1842,8 +1842,7 @@ void __init sev_hardware_setup(void)

/* Maximum number of encrypted guests supported simultaneously */
max_sev_asid = ecx;

if (!svm_sev_enabled())
if (!max_sev_asid)
goto out;

/* Minimum ASID value that should be used for SEV guest */
Expand Down

0 comments on commit 8cb756b

Please sign in to comment.