@@ -186,20 +186,21 @@ static void clear_regs_spsr_ss(struct pt_regs *regs)
186
186
187
187
/* EL1 Single Step Handler hooks */
188
188
static LIST_HEAD (step_hook );
189
- static DEFINE_RWLOCK (step_hook_lock );
189
+ static DEFINE_SPINLOCK (step_hook_lock );
190
190
191
191
void register_step_hook (struct step_hook * hook )
192
192
{
193
- write_lock (& step_hook_lock );
194
- list_add (& hook -> node , & step_hook );
195
- write_unlock (& step_hook_lock );
193
+ spin_lock (& step_hook_lock );
194
+ list_add_rcu (& hook -> node , & step_hook );
195
+ spin_unlock (& step_hook_lock );
196
196
}
197
197
198
198
void unregister_step_hook (struct step_hook * hook )
199
199
{
200
- write_lock (& step_hook_lock );
201
- list_del (& hook -> node );
202
- write_unlock (& step_hook_lock );
200
+ spin_lock (& step_hook_lock );
201
+ list_del_rcu (& hook -> node );
202
+ spin_unlock (& step_hook_lock );
203
+ synchronize_rcu ();
203
204
}
204
205
205
206
/*
@@ -213,15 +214,15 @@ static int call_step_hook(struct pt_regs *regs, unsigned int esr)
213
214
struct step_hook * hook ;
214
215
int retval = DBG_HOOK_ERROR ;
215
216
216
- read_lock ( & step_hook_lock );
217
+ rcu_read_lock ( );
217
218
218
- list_for_each_entry (hook , & step_hook , node ) {
219
+ list_for_each_entry_rcu (hook , & step_hook , node ) {
219
220
retval = hook -> fn (regs , esr );
220
221
if (retval == DBG_HOOK_HANDLED )
221
222
break ;
222
223
}
223
224
224
- read_unlock ( & step_hook_lock );
225
+ rcu_read_unlock ( );
225
226
226
227
return retval ;
227
228
}
0 commit comments