diff options
author | Marc Zyngier <maz@kernel.org> | 2021-04-13 16:41:33 +0200 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2021-04-13 16:41:33 +0200 |
commit | c90aad55c52e032b0a39a2459c68702c9de543d4 (patch) | |
tree | 97480e3dd54660e92d51808b1d37dd9e2628d6db /arch/arm64/kvm/vgic/vgic-init.c | |
parent | Merge branch 'kvm-arm64/ptp' into kvmarm-master/next (diff) | |
parent | KVM: arm/arm64: Fix KVM_VGIC_V3_ADDR_TYPE_REDIST read (diff) | |
download | linux-c90aad55c52e032b0a39a2459c68702c9de543d4.tar.xz linux-c90aad55c52e032b0a39a2459c68702c9de543d4.zip |
Merge branch 'kvm-arm64/vgic-5.13' into kvmarm-master/next
Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'arch/arm64/kvm/vgic/vgic-init.c')
-rw-r--r-- | arch/arm64/kvm/vgic/vgic-init.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/arm64/kvm/vgic/vgic-init.c b/arch/arm64/kvm/vgic/vgic-init.c index 052917deb149..58cbda00e56d 100644 --- a/arch/arm64/kvm/vgic/vgic-init.c +++ b/arch/arm64/kvm/vgic/vgic-init.c @@ -335,13 +335,14 @@ static void kvm_vgic_dist_destroy(struct kvm *kvm) kfree(dist->spis); dist->spis = NULL; dist->nr_spis = 0; + dist->vgic_dist_base = VGIC_ADDR_UNDEF; - if (kvm->arch.vgic.vgic_model == KVM_DEV_TYPE_ARM_VGIC_V3) { - list_for_each_entry_safe(rdreg, next, &dist->rd_regions, list) { - list_del(&rdreg->list); - kfree(rdreg); - } + if (dist->vgic_model == KVM_DEV_TYPE_ARM_VGIC_V3) { + list_for_each_entry_safe(rdreg, next, &dist->rd_regions, list) + vgic_v3_free_redist_region(rdreg); INIT_LIST_HEAD(&dist->rd_regions); + } else { + dist->vgic_cpu_base = VGIC_ADDR_UNDEF; } if (vgic_has_its(kvm)) @@ -362,6 +363,7 @@ void kvm_vgic_vcpu_destroy(struct kvm_vcpu *vcpu) vgic_flush_pending_lpis(vcpu); INIT_LIST_HEAD(&vgic_cpu->ap_list_head); + vgic_cpu->rd_iodev.base_addr = VGIC_ADDR_UNDEF; } /* To be called with kvm->lock held */ |