KVM: SVM: Use unsigned integers when dealing with ASIDs
authorSean Christopherson <seanjc@google.com>
Wed, 31 Jan 2024 23:56:07 +0000 (15:56 -0800)
committerSean Christopherson <seanjc@google.com>
Tue, 6 Feb 2024 19:09:34 +0000 (11:09 -0800)
commit466eec4a22a76c462781bf6d45cb02cbedf21a61
treeabccea443ea20f8c0d76ee2ce954e6ad594ee68d
parentcc4ce37bed85989daf8f38bf19ea591f3b36fb0c
KVM: SVM: Use unsigned integers when dealing with ASIDs

Convert all local ASID variables and parameters throughout the SEV code
from signed integers to unsigned integers.  As ASIDs are fundamentally
unsigned values, and the global min/max variables are appropriately
unsigned integers, too.

Functionally, this is a glorified nop as KVM guarantees min_sev_asid is
non-zero, and no CPU supports -1u as the _only_ asid, i.e. the signed vs.
unsigned goof won't cause problems in practice.

Opportunistically use sev_get_asid() in sev_flush_encrypted_page() instead
of open coding an equivalent.

Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Link: https://lore.kernel.org/r/20240131235609.4161407-3-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/sev.c
arch/x86/kvm/trace.h