From: Marc Zyngier Date: Mon, 10 Jun 2019 09:20:02 +0000 (+0100) Subject: KVM: arm/arm64: vgic-its: Invalidate MSI-LPI translation cache on vgic teardown X-Git-Tag: v5.15~5362^2~2^2~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cbfda481d87e92ce635e426099946cd413b251be;p=platform%2Fkernel%2Flinux-starfive.git KVM: arm/arm64: vgic-its: Invalidate MSI-LPI translation cache on vgic teardown In order to avoid leaking vgic_irq structures on teardown, we need to drop all references to LPIs before deallocating the cache itself. This is done by invalidating the cache on vgic teardown. Tested-by: Andre Przywara Reviewed-by: Eric Auger Signed-off-by: Marc Zyngier --- diff --git a/virt/kvm/arm/vgic/vgic-its.c b/virt/kvm/arm/vgic/vgic-its.c index 05406bd..d3e90a9 100644 --- a/virt/kvm/arm/vgic/vgic-its.c +++ b/virt/kvm/arm/vgic/vgic-its.c @@ -1731,6 +1731,8 @@ void vgic_lpi_translation_cache_destroy(struct kvm *kvm) struct vgic_dist *dist = &kvm->arch.vgic; struct vgic_translation_cache_entry *cte, *tmp; + vgic_its_invalidate_cache(kvm); + list_for_each_entry_safe(cte, tmp, &dist->lpi_translation_cache, entry) { list_del(&cte->entry);