From c96767cc24f1112888d2cbe4fc2b4e453b3d6791 Mon Sep 17 00:00:00 2001 From: Will Deacon Date: Mon, 7 Feb 2022 17:47:20 +0000 Subject: [PATCH] ANDROID: KVM: arm64: Don't repaint PSCI SYSTEM_RESET to SYSTEM_OFF Even if PVMs can't be straightforwardly reset, we should still propagate this information to the VMM. Bug: 216801012 Signed-off-by: Will Deacon Change-Id: I41833748da6744605ec3d68897a785305640ea2b --- arch/arm64/kvm/hyp/nvhe/hyp-main.c | 1 + arch/arm64/kvm/hyp/nvhe/pkvm.c | 7 ------- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/arch/arm64/kvm/hyp/nvhe/hyp-main.c b/arch/arm64/kvm/hyp/nvhe/hyp-main.c index 44d205ae734e..67ed255b1699 100644 --- a/arch/arm64/kvm/hyp/nvhe/hyp-main.c +++ b/arch/arm64/kvm/hyp/nvhe/hyp-main.c @@ -290,6 +290,7 @@ static void handle_pvm_exit_hvc64(struct kvm_vcpu *host_vcpu, struct kvm_vcpu *s case PSCI_0_2_FN_CPU_OFF: case PSCI_0_2_FN_SYSTEM_OFF: + case PSCI_0_2_FN_SYSTEM_RESET: case PSCI_0_2_FN_CPU_SUSPEND: case PSCI_0_2_FN64_CPU_SUSPEND: n = 1; diff --git a/arch/arm64/kvm/hyp/nvhe/pkvm.c b/arch/arm64/kvm/hyp/nvhe/pkvm.c index e19af9e891f7..c431431d22af 100644 --- a/arch/arm64/kvm/hyp/nvhe/pkvm.c +++ b/arch/arm64/kvm/hyp/nvhe/pkvm.c @@ -1017,13 +1017,6 @@ static bool pkvm_handle_psci(struct kvm_vcpu *vcpu) case PSCI_1_0_FN_PSCI_FEATURES: return pvm_psci_features(vcpu); case PSCI_0_2_FN_SYSTEM_RESET: - /* - * NOTE: Until we add proper support for reset for protected - * VMs, repaint reset requests as system off because some VMMs - * use reset when tearing down a VM. - */ - vcpu_set_reg(vcpu, 0, PSCI_0_2_FN_SYSTEM_OFF); - fallthrough; case PSCI_0_2_FN_CPU_SUSPEND: case PSCI_0_2_FN64_CPU_SUSPEND: case PSCI_0_2_FN_SYSTEM_OFF: