Skip to content
Commit 2233bd58 authored by Sean Christopherson's avatar Sean Christopherson Committed by Greg Kroah-Hartman
Browse files

KVM: SVM: Use unsigned integers when dealing with ASIDs

[ Upstream commit 466eec4a

 ]

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: default avatarTom Lendacky <thomas.lendacky@amd.com>
Link: https://lore.kernel.org/r/20240131235609.4161407-3-seanjc@google.com


Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
Stable-dep-of: 0aa6b90e

 ("KVM: SVM: Add support for allowing zero SEV ASIDs")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 815c2a1c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment