ANDROID: KVM: arm64: get_shadow_vcpu()'s vcpu_idx should be unsigned

Bug: 216808671
Signed-off-by: Fuad Tabba <tabba@google.com>
Change-Id: Ib6a1dfebfa21e14fbb098ef8c4e21f72ef701458
This commit is contained in:
Fuad Tabba
2022-02-23 11:01:59 +00:00
committed by Quentin Perret
parent 5897711b74
commit 29e2f13805
2 changed files with 3 additions and 3 deletions

View File

@@ -67,7 +67,7 @@ extern phys_addr_t pvmfw_size;
int __pkvm_init_shadow(struct kvm *kvm, void *shadow_va, size_t size, void *pgd);
int __pkvm_teardown_shadow(int shadow_handle);
struct kvm_vcpu *get_shadow_vcpu(int shadow_handle, int vcpu_idx);
struct kvm_vcpu *get_shadow_vcpu(int shadow_handle, unsigned int vcpu_idx);
void put_shadow_vcpu(struct kvm_vcpu *vcpu);
u64 pvm_read_id_reg(const struct kvm_vcpu *vcpu, u32 id);

View File

@@ -257,14 +257,14 @@ static struct kvm_shadow_vm *find_shadow_by_handle(int shadow_handle)
return shadow_table[shadow_index];
}
struct kvm_vcpu *get_shadow_vcpu(int shadow_handle, int vcpu_idx)
struct kvm_vcpu *get_shadow_vcpu(int shadow_handle, unsigned int vcpu_idx)
{
struct kvm_vcpu *vcpu = NULL;
struct kvm_shadow_vm *vm;
hyp_spin_lock(&shadow_lock);
vm = find_shadow_by_handle(shadow_handle);
if (!vm || vcpu_idx < 0 || vm->created_vcpus <= vcpu_idx)
if (!vm || vm->created_vcpus <= vcpu_idx)
goto unlock;
vcpu = &vm->shadow_vcpus[vcpu_idx].vcpu;