@@ -121,7 +121,7 @@ static int run_all_cpu_set_hw_mode(struct insn_emulation *insn, bool enable)
121
121
* 0 - If all the hooks ran successfully.
122
122
* -EINVAL - At least one hook is not supported by the CPU.
123
123
*/
124
- static int run_all_insn_set_hw_mode (unsigned long cpu )
124
+ static int run_all_insn_set_hw_mode (unsigned int cpu )
125
125
{
126
126
int rc = 0 ;
127
127
unsigned long flags ;
@@ -131,7 +131,7 @@ static int run_all_insn_set_hw_mode(unsigned long cpu)
131
131
list_for_each_entry (insn , & insn_emulation , node ) {
132
132
bool enable = (insn -> current_mode == INSN_HW );
133
133
if (insn -> ops -> set_hw_mode && insn -> ops -> set_hw_mode (enable )) {
134
- pr_warn ("CPU[%ld ] cannot support the emulation of %s" ,
134
+ pr_warn ("CPU[%u ] cannot support the emulation of %s" ,
135
135
cpu , insn -> ops -> name );
136
136
rc = - EINVAL ;
137
137
}
@@ -617,20 +617,6 @@ static struct insn_emulation_ops setend_ops = {
617
617
.set_hw_mode = setend_set_hw_mode ,
618
618
};
619
619
620
- static int insn_cpu_hotplug_notify (struct notifier_block * b ,
621
- unsigned long action , void * hcpu )
622
- {
623
- int rc = 0 ;
624
- if ((action & ~CPU_TASKS_FROZEN ) == CPU_STARTING )
625
- rc = run_all_insn_set_hw_mode ((unsigned long )hcpu );
626
-
627
- return notifier_from_errno (rc );
628
- }
629
-
630
- static struct notifier_block insn_cpu_hotplug_notifier = {
631
- .notifier_call = insn_cpu_hotplug_notify ,
632
- };
633
-
634
620
/*
635
621
* Invoked as late_initcall, since not needed before init spawned.
636
622
*/
@@ -649,7 +635,9 @@ static int __init armv8_deprecated_init(void)
649
635
pr_info ("setend instruction emulation is not supported on the system" );
650
636
}
651
637
652
- register_cpu_notifier (& insn_cpu_hotplug_notifier );
638
+ cpuhp_setup_state_nocalls (CPUHP_AP_ARM64_ISNDEP_STARTING ,
639
+ "AP_ARM64_ISNDEP_STARTING" ,
640
+ run_all_insn_set_hw_mode , NULL );
653
641
register_insn_emulation_sysctl (ctl_abi );
654
642
655
643
return 0 ;
0 commit comments