aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAlexander van Heukelum <heukelum@mailshack.com>2008-07-02 12:39:01 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-09 02:18:15 -0400
commitabd348072798aa88d48fe9f182ac3440fcb7ae47 (patch)
treee3c1754a6c2797104a476ad2d436d3e72efd042a /arch
parent13485ab55bc77f02024e80bcca0374950b0becb3 (diff)
x86: traps_xx: modify default_do_nmi
- local caching of smp_processor_id() in default_do_nmi() - v2: do not split default_do_nmi over two lines On Wed, Jul 02, 2008 at 08:12:20PM +0400, Cyrill Gorcunov wrote: > | -static notrace __kprobes void default_do_nmi(struct pt_regs *regs) > | +static notrace __kprobes void > | +default_do_nmi(struct pt_regs *regs) > | [ ... ] > | -asmlinkage notrace __kprobes void default_do_nmi(struct pt_regs *regs) > | +asmlinkage notrace __kprobes void > | +default_do_nmi(struct pt_regs *regs) > > Hi Alexander, good done, thanks! But why did you split default_do_nmi > definition by two lines? I think it would be better to keep them as it > was before, ie by a single line > > static notrace __kprobes void default_do_nmi(struct pt_regs *regs) Thanks! Here is the replacement patch with default_do_nmi left on a single line. Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Acked-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/traps_32.c9
-rw-r--r--arch/x86/kernel/traps_64.c2
2 files changed, 7 insertions, 4 deletions
diff --git a/arch/x86/kernel/traps_32.c b/arch/x86/kernel/traps_32.c
index c9a0120e510c..fb8e3cce7bfb 100644
--- a/arch/x86/kernel/traps_32.c
+++ b/arch/x86/kernel/traps_32.c
@@ -789,9 +789,12 @@ void notrace __kprobes die_nmi(char *str, struct pt_regs *regs, int do_panic)
789static notrace __kprobes void default_do_nmi(struct pt_regs *regs) 789static notrace __kprobes void default_do_nmi(struct pt_regs *regs)
790{ 790{
791 unsigned char reason = 0; 791 unsigned char reason = 0;
792 int cpu;
793
794 cpu = smp_processor_id();
792 795
793 /* Only the BSP gets external NMIs from the system: */ 796 /* Only the BSP gets external NMIs from the system. */
794 if (!smp_processor_id()) 797 if (!cpu)
795 reason = get_nmi_reason(); 798 reason = get_nmi_reason();
796 799
797 if (!(reason & 0xc0)) { 800 if (!(reason & 0xc0)) {
@@ -805,7 +808,7 @@ static notrace __kprobes void default_do_nmi(struct pt_regs *regs)
805 */ 808 */
806 if (nmi_watchdog_tick(regs, reason)) 809 if (nmi_watchdog_tick(regs, reason))
807 return; 810 return;
808 if (!do_nmi_callback(regs, smp_processor_id())) 811 if (!do_nmi_callback(regs, cpu))
809 unknown_nmi_error(reason, regs); 812 unknown_nmi_error(reason, regs);
810#else 813#else
811 unknown_nmi_error(reason, regs); 814 unknown_nmi_error(reason, regs);
diff --git a/arch/x86/kernel/traps_64.c b/arch/x86/kernel/traps_64.c
index bc21ddc97a02..9b9245f81b9f 100644
--- a/arch/x86/kernel/traps_64.c
+++ b/arch/x86/kernel/traps_64.c
@@ -827,7 +827,7 @@ unknown_nmi_error(unsigned char reason, struct pt_regs * regs)
827 827
828/* Runs on IST stack. This code must keep interrupts off all the time. 828/* Runs on IST stack. This code must keep interrupts off all the time.
829 Nested NMIs are prevented by the CPU. */ 829 Nested NMIs are prevented by the CPU. */
830asmlinkage notrace __kprobes void default_do_nmi(struct pt_regs *regs) 830asmlinkage notrace __kprobes void default_do_nmi(struct pt_regs *regs)
831{ 831{
832 unsigned char reason = 0; 832 unsigned char reason = 0;
833 int cpu; 833 int cpu;