提交 c3e35409 编写于 作者: S Shannon Zhao 提交者: Marc Zyngier

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: NShannon Zhao <shannon.zhao@linux.alibaba.com>
Signed-off-by: NMarc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/1575272531-3204-1-git-send-email-shannon.zhao@linux.alibaba.com
上级 f5523423
...@@ -1537,7 +1537,6 @@ static void teardown_hyp_mode(void) ...@@ -1537,7 +1537,6 @@ static void teardown_hyp_mode(void)
free_hyp_pgds(); free_hyp_pgds();
for_each_possible_cpu(cpu) for_each_possible_cpu(cpu)
free_page(per_cpu(kvm_arm_hyp_stack_page, 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) ...@@ -1751,6 +1750,7 @@ int kvm_arch_init(void *opaque)
return 0; return 0;
out_hyp: out_hyp:
hyp_cpu_pm_exit();
if (!in_hyp_mode) if (!in_hyp_mode)
teardown_hyp_mode(); teardown_hyp_mode();
out_err: out_err:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册