mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
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:
committed by
Quentin Perret
parent
5897711b74
commit
29e2f13805
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user