From 9515eed842d305bc599f50ede4dc9750aa49456b Mon Sep 17 00:00:00 2001 From: Fuad Tabba Date: Wed, 26 Jan 2022 18:02:00 +0000 Subject: [PATCH] ANDROID: KVM: arm64: Don't remove shadow table entry twice on teardown __pkvm_teardown_shadow() already removes the shadow table entry for the VM being torn down while the shadow_lock is held, so drop the additional removal and avoid corrupting 'num_shadow_entries' in the process. Fixes: 6f93dc7bb931 ("ANDROID: KVM: arm64: Refcount shadow structs on vcpu_{load/put}()") Signed-off-by: Fuad Tabba Bug: 209580772 Signed-off-by: Will Deacon Change-Id: Ie09ecde8c9b6f14ea1ee9d27fba62b713c21e484 --- arch/arm64/kvm/hyp/nvhe/pkvm.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/arm64/kvm/hyp/nvhe/pkvm.c b/arch/arm64/kvm/hyp/nvhe/pkvm.c index 57e1304c3713..e19af9e891f7 100644 --- a/arch/arm64/kvm/hyp/nvhe/pkvm.c +++ b/arch/arm64/kvm/hyp/nvhe/pkvm.c @@ -655,7 +655,6 @@ int __pkvm_teardown_shadow(struct kvm *kvm) /* Reclaim guest pages, and page-table pages */ mc = &vm->host_kvm->arch.pkvm.teardown_mc; reclaim_guest_pages(vm, mc); - remove_shadow_table(shadow_handle); unpin_host_vcpus(vm); /* Push the metadata pages to the teardown memcache */