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: 6f93dc7bb9 ("ANDROID: KVM: arm64: Refcount shadow structs on vcpu_{load/put}()")
Signed-off-by: Fuad Tabba <tabba@google.com>
Bug: 209580772
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: Ie09ecde8c9b6f14ea1ee9d27fba62b713c21e484
This commit is contained in:
Fuad Tabba
2022-01-26 18:02:00 +00:00
committed by Will Deacon
parent 9703a8cd4b
commit 9515eed842

View File

@@ -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 */