|
@@ -1112,10 +1112,17 @@ static void __init hyp_cpu_pm_init(void)
|
|
{
|
|
{
|
|
cpu_pm_register_notifier(&hyp_init_cpu_pm_nb);
|
|
cpu_pm_register_notifier(&hyp_init_cpu_pm_nb);
|
|
}
|
|
}
|
|
|
|
+static void __init hyp_cpu_pm_exit(void)
|
|
|
|
+{
|
|
|
|
+ cpu_pm_unregister_notifier(&hyp_init_cpu_pm_nb);
|
|
|
|
+}
|
|
#else
|
|
#else
|
|
static inline void hyp_cpu_pm_init(void)
|
|
static inline void hyp_cpu_pm_init(void)
|
|
{
|
|
{
|
|
}
|
|
}
|
|
|
|
+static inline void hyp_cpu_pm_exit(void)
|
|
|
|
+{
|
|
|
|
+}
|
|
#endif
|
|
#endif
|
|
|
|
|
|
static void teardown_common_resources(void)
|
|
static void teardown_common_resources(void)
|
|
@@ -1141,9 +1148,7 @@ static int init_subsystems(void)
|
|
/*
|
|
/*
|
|
* Register CPU Hotplug notifier
|
|
* Register CPU Hotplug notifier
|
|
*/
|
|
*/
|
|
- cpu_notifier_register_begin();
|
|
|
|
- err = __register_cpu_notifier(&hyp_init_cpu_nb);
|
|
|
|
- cpu_notifier_register_done();
|
|
|
|
|
|
+ err = register_cpu_notifier(&hyp_init_cpu_nb);
|
|
if (err) {
|
|
if (err) {
|
|
kvm_err("Cannot register KVM init CPU notifier (%d)\n", err);
|
|
kvm_err("Cannot register KVM init CPU notifier (%d)\n", err);
|
|
return err;
|
|
return err;
|
|
@@ -1193,6 +1198,8 @@ 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));
|
|
|
|
+ unregister_cpu_notifier(&hyp_init_cpu_nb);
|
|
|
|
+ hyp_cpu_pm_exit();
|
|
}
|
|
}
|
|
|
|
|
|
static int init_vhe_mode(void)
|
|
static int init_vhe_mode(void)
|