mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-09 06:43:09 +00:00
KVM: mips: Use kvm_get_vcpu() instead of open-coded access
As we are about to change the way vcpus are allocated, mandate the use of kvm_get_vcpu() instead of open-coding the access. Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Marc Zyngier <maz@kernel.org> Message-Id: <20211116160403.4074052-3-maz@kernel.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
27592ae8db
commit
75a9869f31
@ -120,7 +120,7 @@ static int loongson_vipi_write(struct loongson_kvm_ipi *ipi,
|
||||
s->status |= data;
|
||||
irq.cpu = id;
|
||||
irq.irq = 6;
|
||||
kvm_vcpu_ioctl_interrupt(kvm->vcpus[id], &irq);
|
||||
kvm_vcpu_ioctl_interrupt(kvm_get_vcpu(kvm, id), &irq);
|
||||
break;
|
||||
|
||||
case CORE0_CLEAR_OFF:
|
||||
@ -128,7 +128,7 @@ static int loongson_vipi_write(struct loongson_kvm_ipi *ipi,
|
||||
if (!s->status) {
|
||||
irq.cpu = id;
|
||||
irq.irq = -6;
|
||||
kvm_vcpu_ioctl_interrupt(kvm->vcpus[id], &irq);
|
||||
kvm_vcpu_ioctl_interrupt(kvm_get_vcpu(kvm, id), &irq);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -479,7 +479,7 @@ int kvm_vcpu_ioctl_interrupt(struct kvm_vcpu *vcpu,
|
||||
if (irq->cpu == -1)
|
||||
dvcpu = vcpu;
|
||||
else
|
||||
dvcpu = vcpu->kvm->vcpus[irq->cpu];
|
||||
dvcpu = kvm_get_vcpu(vcpu->kvm, irq->cpu);
|
||||
|
||||
if (intr == 2 || intr == 3 || intr == 4 || intr == 6) {
|
||||
kvm_mips_callbacks->queue_io_int(dvcpu, irq);
|
||||
|
Loading…
Reference in New Issue
Block a user