summaryrefslogtreecommitdiffstats
path: root/virt
diff options
context:
space:
mode:
authorShannon Zhao <shannon.zhao@linux.alibaba.com>2019-12-02 15:42:11 +0800
committerMarc Zyngier <maz@kernel.org>2020-01-19 18:03:31 +0000
commitc3e35409b54e8833ab936e667e3e7fcb8bdace00 (patch)
treebd2dfd63bab45040051f45a03e24b85102064f46 /virt
parentf5523423defb0d929e23813c8dd16c0131043a8c (diff)
downloadlinux-c3e35409b54e8833ab936e667e3e7fcb8bdace00.tar.gz
linux-c3e35409b54e8833ab936e667e3e7fcb8bdace00.tar.bz2
linux-c3e35409b54e8833ab936e667e3e7fcb8bdace00.zip
KVM: ARM: Call hyp_cpu_pm_exit at the right place
It doesn't needs to call hyp_cpu_pm_exit() in init_hyp_mode() when some error occurs. hyp_cpu_pm_exit() only needs to be called in kvm_arch_init() if init_subsystems() fails. So move hyp_cpu_pm_exit() out from teardown_hyp_mode() and call it directly in kvm_arch_init(). Signed-off-by: Shannon Zhao <shannon.zhao@linux.alibaba.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/1575272531-3204-1-git-send-email-shannon.zhao@linux.alibaba.com
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/arm/arm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c
index 8de4daf25097..b5d57ed6443c 100644
--- a/virt/kvm/arm/arm.c
+++ b/virt/kvm/arm/arm.c
@@ -1537,7 +1537,6 @@ static void teardown_hyp_mode(void)
free_hyp_pgds();
for_each_possible_cpu(cpu)
free_page(per_cpu(kvm_arm_hyp_stack_page, cpu));
- hyp_cpu_pm_exit();
}
/**
@@ -1751,6 +1750,7 @@ int kvm_arch_init(void *opaque)
return 0;
out_hyp:
+ hyp_cpu_pm_exit();
if (!in_hyp_mode)
teardown_hyp_mode();
out_err: