diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2017-10-27 15:28:34 +0100 |
---|---|---|
committer | Christoffer Dall <christoffer.dall@linaro.org> | 2017-11-06 17:20:20 +0100 |
commit | b2c9a85dd75a8cfa18da94b19e84eb0199011187 (patch) | |
tree | 07b27bd8b083aeba75d274b11b847c1eb7c32026 /virt | |
parent | 7129a9d8a6f352e93647264a495281f789a87aa0 (diff) | |
download | linux-b2c9a85dd75a8cfa18da94b19e84eb0199011187.tar.gz linux-b2c9a85dd75a8cfa18da94b19e84eb0199011187.tar.bz2 linux-b2c9a85dd75a8cfa18da94b19e84eb0199011187.zip |
KVM: arm/arm64: vgic: Move kvm_vgic_destroy call around
The way we call kvm_vgic_destroy is a bit bizarre. We call it
*after* having freed the vcpus, which sort of defeats the point
of cleaning up things before that point.
Let's move kvm_vgic_destroy towards the beginning of kvm_arch_destroy_vm,
which seems more sensible.
Acked-by: Christoffer Dall <cdall@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/arm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c index 79f8ddd604c1..e1e947fe9bc2 100644 --- a/virt/kvm/arm/arm.c +++ b/virt/kvm/arm/arm.c @@ -177,6 +177,8 @@ void kvm_arch_destroy_vm(struct kvm *kvm) { int i; + kvm_vgic_destroy(kvm); + free_percpu(kvm->arch.last_vcpu_ran); kvm->arch.last_vcpu_ran = NULL; @@ -186,8 +188,6 @@ void kvm_arch_destroy_vm(struct kvm *kvm) kvm->vcpus[i] = NULL; } } - - kvm_vgic_destroy(kvm); } int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) |