Skip to content

Commit 107352a

Browse files
author
Marc Zyngier
committed
arm/arm64: KVM: vgic: Force VM halt when changing the active state of GICv3 PPIs/SGIs
We currently only halt the guest when a vCPU messes with the active state of an SPI. This is perfectly fine for GICv2, but isn't enough for GICv3, where all vCPUs can access the state of any other vCPU. Let's broaden the condition to include any GICv3 interrupt that has an active state (i.e. all but LPIs). Cc: stable@vger.kernel.org Reviewed-by: Christoffer Dall <christoffer.dall@arm.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
1 parent 599d79d commit 107352a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

virt/kvm/arm/vgic/vgic-mmio.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,14 +362,16 @@ static void vgic_mmio_change_active(struct kvm_vcpu *vcpu, struct vgic_irq *irq,
362362
*/
363363
static void vgic_change_active_prepare(struct kvm_vcpu *vcpu, u32 intid)
364364
{
365-
if (intid > VGIC_NR_PRIVATE_IRQS)
365+
if (vcpu->kvm->arch.vgic.vgic_model == KVM_DEV_TYPE_ARM_VGIC_V3 ||
366+
intid > VGIC_NR_PRIVATE_IRQS)
366367
kvm_arm_halt_guest(vcpu->kvm);
367368
}
368369

369370
/* See vgic_change_active_prepare */
370371
static void vgic_change_active_finish(struct kvm_vcpu *vcpu, u32 intid)
371372
{
372-
if (intid > VGIC_NR_PRIVATE_IRQS)
373+
if (vcpu->kvm->arch.vgic.vgic_model == KVM_DEV_TYPE_ARM_VGIC_V3 ||
374+
intid > VGIC_NR_PRIVATE_IRQS)
373375
kvm_arm_resume_guest(vcpu->kvm);
374376
}
375377

0 commit comments

Comments
 (0)