From 8fd570f1a8b4f498f1b9e91c36d039337a33ab07 Mon Sep 17 00:00:00 2001 From: Will Deacon Date: Thu, 7 Jul 2022 15:49:13 +0100 Subject: [PATCH] Revert "ANDROID: KVM: arm64: Clear pvmfw pages on clean host shutdown" This reverts commit e3b73a4b5e6751218479c461487323a74d82895f. Bug: 233587962 Signed-off-by: Will Deacon Change-Id: I406a474c879d2fe44b850fd25262a70a561a5567 --- arch/arm64/kvm/hyp/include/nvhe/pkvm.h | 1 - arch/arm64/kvm/hyp/nvhe/pkvm.c | 8 -------- arch/arm64/kvm/hyp/nvhe/psci-relay.c | 6 +----- 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/arch/arm64/kvm/hyp/include/nvhe/pkvm.h b/arch/arm64/kvm/hyp/include/nvhe/pkvm.h index 05bd6c2d04af..ddb64ba46aa4 100644 --- a/arch/arm64/kvm/hyp/include/nvhe/pkvm.h +++ b/arch/arm64/kvm/hyp/include/nvhe/pkvm.h @@ -99,6 +99,5 @@ static inline bool ipa_in_pvmfw_region(struct kvm_shadow_vm *vm, u64 ipa) int pkvm_load_pvmfw_pages(struct kvm_shadow_vm *vm, u64 ipa, phys_addr_t phys, u64 size); -void pkvm_clear_pvmfw_pages(void); #endif /* __ARM64_KVM_NVHE_PKVM_H__ */ diff --git a/arch/arm64/kvm/hyp/nvhe/pkvm.c b/arch/arm64/kvm/hyp/nvhe/pkvm.c index 0b1ec45449d5..09dc651647fb 100644 --- a/arch/arm64/kvm/hyp/nvhe/pkvm.c +++ b/arch/arm64/kvm/hyp/nvhe/pkvm.c @@ -712,14 +712,6 @@ int pkvm_load_pvmfw_pages(struct kvm_shadow_vm *vm, u64 ipa, phys_addr_t phys, return 0; } -void pkvm_clear_pvmfw_pages(void) -{ - void *addr = hyp_phys_to_virt(pvmfw_base); - - memset(addr, 0, pvmfw_size); - kvm_flush_dcache_to_poc(addr, pvmfw_size); -} - /* * This function sets the registers on the vcpu to their architecturally defined * reset values. diff --git a/arch/arm64/kvm/hyp/nvhe/psci-relay.c b/arch/arm64/kvm/hyp/nvhe/psci-relay.c index cee6d4a2821f..08508783ec3d 100644 --- a/arch/arm64/kvm/hyp/nvhe/psci-relay.c +++ b/arch/arm64/kvm/hyp/nvhe/psci-relay.c @@ -12,7 +12,6 @@ #include #include -#include #include void kvm_hyp_cpu_entry(unsigned long r0); @@ -250,7 +249,6 @@ static unsigned long psci_0_2_handler(u64 func_id, struct kvm_cpu_context *host_ */ case PSCI_0_2_FN_SYSTEM_OFF: case PSCI_0_2_FN_SYSTEM_RESET: - pkvm_clear_pvmfw_pages(); return psci_forward(host_ctxt); case PSCI_0_2_FN64_CPU_SUSPEND: return psci_cpu_suspend(func_id, host_ctxt); @@ -264,11 +262,9 @@ static unsigned long psci_0_2_handler(u64 func_id, struct kvm_cpu_context *host_ static unsigned long psci_1_0_handler(u64 func_id, struct kvm_cpu_context *host_ctxt) { switch (func_id) { - case PSCI_1_1_FN64_SYSTEM_RESET2: - pkvm_clear_pvmfw_pages(); - fallthrough; case PSCI_1_0_FN_PSCI_FEATURES: case PSCI_1_0_FN_SET_SUSPEND_MODE: + case PSCI_1_1_FN64_SYSTEM_RESET2: return psci_forward(host_ctxt); case PSCI_1_0_FN64_SYSTEM_SUSPEND: return psci_system_suspend(func_id, host_ctxt);