Skip to content

Commit

Permalink
KVM: ARM: Call hyp_cpu_pm_exit at the right place
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Shannon Zhao authored and Marc Zyngier committed Jan 19, 2020
1 parent f552342 commit c3e3540
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion virt/kvm/arm/arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

/**
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit c3e3540

Please sign in to comment.