Skip to content

Commit 8e4ece6

Browse files
Kunkun Jiangoupton
authored andcommitted
KVM: arm64: GICv4: Do not perform a map to a mapped vLPI
Before performing a map, let's check whether the vLPI has been mapped. Fixes: 196b136 ("KVM: arm/arm64: GICv4: Wire mapping/unmapping of VLPIs in VFIO irq bypass") Signed-off-by: Kunkun Jiang <jiangkunkun@huawei.com> Acked-by: Marc Zyngier <maz@kernel.org> Reviewed-by: Zenghui Yu <yuzenghui@huawei.com> Link: https://lore.kernel.org/r/20231120131210.2039-1-jiangkunkun@huawei.com Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
1 parent b85ea95 commit 8e4ece6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/arm64/kvm/vgic/vgic-v4.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,10 @@ int kvm_vgic_v4_set_forwarding(struct kvm *kvm, int virq,
436436
if (ret)
437437
goto out;
438438

439+
/* Silently exit if the vLPI is already mapped */
440+
if (irq->hw)
441+
goto out;
442+
439443
/*
440444
* Emit the mapping request. If it fails, the ITS probably
441445
* isn't v4 compatible, so let's silently bail out. Holding

0 commit comments

Comments
 (0)