Code Review
/
kvmfornfv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "Add the opnfv kernel config file"
[kvmfornfv.git]
/
kernel
/
arch
/
arm64
/
kernel
/
debug-monitors.c
diff --git
a/kernel/arch/arm64/kernel/debug-monitors.c
b/kernel/arch/arm64/kernel/debug-monitors.c
index
b056369
..
70654d8
100644
(file)
--- a/
kernel/arch/arm64/kernel/debug-monitors.c
+++ b/
kernel/arch/arm64/kernel/debug-monitors.c
@@
-271,20
+271,21
@@
static int single_step_handler(unsigned long addr, unsigned int esr,
* Use reader/writer locks instead of plain spinlock.
*/
static LIST_HEAD(break_hook);
* Use reader/writer locks instead of plain spinlock.
*/
static LIST_HEAD(break_hook);
-static DEFINE_
RW
LOCK(break_hook_lock);
+static DEFINE_
SPIN
LOCK(break_hook_lock);
void register_break_hook(struct break_hook *hook)
{
void register_break_hook(struct break_hook *hook)
{
-
write
_lock(&break_hook_lock);
- list_add(&hook->node, &break_hook);
-
write
_unlock(&break_hook_lock);
+
spin
_lock(&break_hook_lock);
+ list_add
_rcu
(&hook->node, &break_hook);
+
spin
_unlock(&break_hook_lock);
}
void unregister_break_hook(struct break_hook *hook)
{
}
void unregister_break_hook(struct break_hook *hook)
{
- write_lock(&break_hook_lock);
- list_del(&hook->node);
- write_unlock(&break_hook_lock);
+ spin_lock(&break_hook_lock);
+ list_del_rcu(&hook->node);
+ spin_unlock(&break_hook_lock);
+ synchronize_rcu();
}
static int call_break_hook(struct pt_regs *regs, unsigned int esr)
}
static int call_break_hook(struct pt_regs *regs, unsigned int esr)
@@
-292,11
+293,11
@@
static int call_break_hook(struct pt_regs *regs, unsigned int esr)
struct break_hook *hook;
int (*fn)(struct pt_regs *regs, unsigned int esr) = NULL;
struct break_hook *hook;
int (*fn)(struct pt_regs *regs, unsigned int esr) = NULL;
- r
ead_lock(&break_hook_lock
);
- list_for_each_entry(hook, &break_hook, node)
+ r
cu_read_lock(
);
+ list_for_each_entry
_rcu
(hook, &break_hook, node)
if ((esr & hook->esr_mask) == hook->esr_val)
fn = hook->fn;
if ((esr & hook->esr_mask) == hook->esr_val)
fn = hook->fn;
- r
ead_unlock(&break_hook_lock
);
+ r
cu_read_unlock(
);
return fn ? fn(regs, esr) : DBG_HOOK_ERROR;
}
return fn ? fn(regs, esr) : DBG_HOOK_ERROR;
}