diff options
author | Paul E. McKenney <paulmck@us.ibm.com> | 2005-09-06 18:16:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-07 19:57:19 -0400 |
commit | 19306059cd7fedaf96b4b0260a9a8a45e513c857 (patch) | |
tree | 7c32d59c1a5830689d5f85a7f81e89e48d1097ae /arch/i386/kernel/traps.c | |
parent | fe21773d655c2c64641ec2cef499289ea175c817 (diff) |
[PATCH] NMI: Update NMI users of RCU to use new API
Uses of RCU for dynamically changeable NMI handlers need to use the new
rcu_dereference() and rcu_assign_pointer() facilities. This change makes
it clear that these uses are safe from a memory-barrier viewpoint, but the
main purpose is to document exactly what operations are being protected by
RCU. This has been tested on x86 and x86-64, which are the only
architectures affected by this change.
Signed-off-by: <paulmck@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386/kernel/traps.c')
-rw-r--r-- | arch/i386/kernel/traps.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c index 54629bb5893a..029bf94cda7d 100644 --- a/arch/i386/kernel/traps.c +++ b/arch/i386/kernel/traps.c | |||
@@ -657,7 +657,7 @@ fastcall void do_nmi(struct pt_regs * regs, long error_code) | |||
657 | 657 | ||
658 | ++nmi_count(cpu); | 658 | ++nmi_count(cpu); |
659 | 659 | ||
660 | if (!nmi_callback(regs, cpu)) | 660 | if (!rcu_dereference(nmi_callback)(regs, cpu)) |
661 | default_do_nmi(regs); | 661 | default_do_nmi(regs); |
662 | 662 | ||
663 | nmi_exit(); | 663 | nmi_exit(); |
@@ -665,7 +665,7 @@ fastcall void do_nmi(struct pt_regs * regs, long error_code) | |||
665 | 665 | ||
666 | void set_nmi_callback(nmi_callback_t callback) | 666 | void set_nmi_callback(nmi_callback_t callback) |
667 | { | 667 | { |
668 | nmi_callback = callback; | 668 | rcu_assign_pointer(nmi_callback, callback); |
669 | } | 669 | } |
670 | EXPORT_SYMBOL_GPL(set_nmi_callback); | 670 | EXPORT_SYMBOL_GPL(set_nmi_callback); |
671 | 671 | ||