diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2017-11-16 12:58:19 -0500 |
---|---|---|
committer | Christoffer Dall <christoffer.dall@linaro.org> | 2017-11-29 10:46:16 -0500 |
commit | a05d1c0d03fd60ed487991e73850421e735c0135 (patch) | |
tree | d655239c4520daf82da3e90abfaa2746154ccf9b /virt | |
parent | 686f294f2f1ae40705283dd413ca1e4c14f20f93 (diff) |
KVM: arm/arm64: vgic-v4: Only perform an unmap for valid vLPIs
Before performing an unmap, let's check that what we have was
really mapped the first place.
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'virt')
-rw-r--r-- | virt/kvm/arm/vgic/vgic-v4.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/virt/kvm/arm/vgic/vgic-v4.c b/virt/kvm/arm/vgic/vgic-v4.c index 53c324aa44ef..4a37292855bc 100644 --- a/virt/kvm/arm/vgic/vgic-v4.c +++ b/virt/kvm/arm/vgic/vgic-v4.c | |||
@@ -337,8 +337,10 @@ int kvm_vgic_v4_unset_forwarding(struct kvm *kvm, int virq, | |||
337 | goto out; | 337 | goto out; |
338 | 338 | ||
339 | WARN_ON(!(irq->hw && irq->host_irq == virq)); | 339 | WARN_ON(!(irq->hw && irq->host_irq == virq)); |
340 | irq->hw = false; | 340 | if (irq->hw) { |
341 | ret = its_unmap_vlpi(virq); | 341 | irq->hw = false; |
342 | ret = its_unmap_vlpi(virq); | ||
343 | } | ||
342 | 344 | ||
343 | out: | 345 | out: |
344 | mutex_unlock(&its->its_lock); | 346 | mutex_unlock(&its->its_lock); |