aboutsummaryrefslogtreecommitdiffstats
path: root/virt
diff options
context:
space:
mode:
authorMarc Zyngier <maz@kernel.org>2019-06-10 10:20:02 +0100
committerMarc Zyngier <maz@kernel.org>2019-08-18 18:38:51 +0100
commitcbfda481d87e92ce635e426099946cd413b251be (patch)
tree751127f3f01590a2fe7195646690bd286630d8f2 /virt
parentKVM: arm/arm64: vgic-its: Invalidate MSI-LPI translation cache on ITS disable (diff)
downloadlinux-dev-cbfda481d87e92ce635e426099946cd413b251be.tar.xz
linux-dev-cbfda481d87e92ce635e426099946cd413b251be.zip
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 <andre.przywara@arm.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/arm/vgic/vgic-its.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/virt/kvm/arm/vgic/vgic-its.c b/virt/kvm/arm/vgic/vgic-its.c
index 05406bd92ce9..d3e90a9d0a7a 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);