summaryrefslogtreecommitdiff
path: root/arch/arm64
diff options
context:
space:
mode:
authorKunkun Jiang <jiangkunkun@huawei.com>2023-11-20 21:12:10 +0800
committerOliver Upton <oliver.upton@linux.dev>2023-11-20 19:13:32 +0000
commit8e4ece6889a5b1836b6a135827ac831a5350602a (patch)
tree4a33ff3db34bdb72e2d36f0ead2e6d7e14755c73 /arch/arm64
parentb85ea95d086471afb4ad062012a4d73cd328fa86 (diff)
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: 196b136498b3 ("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>
Diffstat (limited to 'arch/arm64')
-rw-r--r--arch/arm64/kvm/vgic/vgic-v4.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/arm64/kvm/vgic/vgic-v4.c b/arch/arm64/kvm/vgic/vgic-v4.c
index 339a55194b2c..74a67ad87f29 100644
--- a/arch/arm64/kvm/vgic/vgic-v4.c
+++ b/arch/arm64/kvm/vgic/vgic-v4.c
@@ -436,6 +436,10 @@ int kvm_vgic_v4_set_forwarding(struct kvm *kvm, int virq,
if (ret)
goto out;
+ /* Silently exit if the vLPI is already mapped */
+ if (irq->hw)
+ goto out;
+
/*
* Emit the mapping request. If it fails, the ITS probably
* isn't v4 compatible, so let's silently bail out. Holding