From 10bb2d3f934ef78eba177ccd291fb8c3da914343 Mon Sep 17 00:00:00 2001 From: Fuad Tabba Date: Mon, 16 May 2022 06:54:41 +0000 Subject: [PATCH] ANDROID: KVM: arm64: Remove stale shadow_handle field This field is stale and not being used. Remove it. Bug: 228810735 Signed-off-by: Fuad Tabba Change-Id: I5a734c22f246186b81ffd7bc73b46e0b60518306 --- arch/arm64/include/asm/kvm_host.h | 3 --- arch/arm64/kvm/hyp/nvhe/pkvm.c | 1 - arch/arm64/kvm/pkvm.c | 14 +------------- 3 files changed, 1 insertion(+), 17 deletions(-) diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index 0e04f3c2ba4f..20393bd8f73c 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -214,9 +214,6 @@ struct kvm_arch { }; struct kvm_protected_vcpu { - /* A unique id to the shadow structs in the hyp shadow area. */ - int shadow_handle; - /* A pointer to the host's vcpu. */ struct kvm_vcpu *host_vcpu; diff --git a/arch/arm64/kvm/hyp/nvhe/pkvm.c b/arch/arm64/kvm/hyp/nvhe/pkvm.c index 511b5dd5a6fb..de191428cccf 100644 --- a/arch/arm64/kvm/hyp/nvhe/pkvm.c +++ b/arch/arm64/kvm/hyp/nvhe/pkvm.c @@ -445,7 +445,6 @@ static int init_shadow_structs(struct kvm *kvm, struct kvm_shadow_vm *vm, shadow_state->vm = vm; shadow_vcpu->arch.hw_mmu = &vm->arch.mmu; - shadow_vcpu->arch.pkvm.shadow_handle = vm->shadow_handle; shadow_vcpu->arch.pkvm.shadow_vm = vm; shadow_vcpu->arch.power_off = true; diff --git a/arch/arm64/kvm/pkvm.c b/arch/arm64/kvm/pkvm.c index 23a6b954657f..ceabdc9f2ba6 100644 --- a/arch/arm64/kvm/pkvm.c +++ b/arch/arm64/kvm/pkvm.c @@ -105,14 +105,6 @@ void __init kvm_hyp_reserve(void) hyp_mem_base); } -/* - * Updates the state of the host's version of the vcpu state. - */ -static void update_vcpu_state(struct kvm_vcpu *vcpu, int shadow_handle) -{ - vcpu->arch.pkvm.shadow_handle = shadow_handle; -} - /* * Allocates and donates memory for EL2 shadow structs. * @@ -130,7 +122,7 @@ static int __create_el2_shadow(struct kvm *kvm) void *pgd, *shadow_addr; unsigned long idx; int shadow_handle; - int ret, i; + int ret; if (kvm->created_vcpus < 1) return -EINVAL; @@ -171,10 +163,6 @@ static int __create_el2_shadow(struct kvm *kvm) /* Store the shadow handle given by hyp for future call reference. */ kvm->arch.pkvm.shadow_handle = shadow_handle; - /* Adjust host's vcpu state as it doesn't control it anymore. */ - for (i = 0; i < kvm->created_vcpus; i++) - update_vcpu_state(kvm->vcpus[i], shadow_handle); - return 0; free_shadow: