Skip to content

Commit

Permalink
KVM: arm/arm64: vgic: Cap SPIs to the VM-defined maximum
Browse files Browse the repository at this point in the history
SPIs should be checked against the VMs specific configuration, and
not the architectural maximum.

Cc: [email protected]
Signed-off-by: Marc Zyngier <[email protected]>
  • Loading branch information
Marc Zyngier committed Dec 18, 2018
1 parent 6992195 commit bea2ef8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions virt/kvm/arm/vgic/vgic.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ struct vgic_irq *vgic_get_irq(struct kvm *kvm, struct kvm_vcpu *vcpu,
}

/* SPIs */
if (intid <= VGIC_MAX_SPI) {
intid = array_index_nospec(intid, VGIC_MAX_SPI);
if (intid < (kvm->arch.vgic.nr_spis + VGIC_NR_PRIVATE_IRQS)) {
intid = array_index_nospec(intid, kvm->arch.vgic.nr_spis + VGIC_NR_PRIVATE_IRQS);
return &kvm->arch.vgic.spis[intid - VGIC_NR_PRIVATE_IRQS];
}

Expand Down

0 comments on commit bea2ef8

Please sign in to comment.