]> git.karo-electronics.de Git - linux-beck.git/commitdiff
x86: traps_xx: modify default_do_nmi
authorAlexander van Heukelum <heukelum@mailshack.com>
Wed, 2 Jul 2008 16:39:01 +0000 (18:39 +0200)
committerIngo Molnar <mingo@elte.hu>
Wed, 9 Jul 2008 06:18:15 +0000 (08:18 +0200)
 - 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>
arch/x86/kernel/traps_32.c
arch/x86/kernel/traps_64.c

index c9a0120e510c97bc69f466f1275ea30d46462537..fb8e3cce7bfb6ba77895fea3ae05f084fec888c9 100644 (file)
@@ -789,9 +789,12 @@ void notrace __kprobes die_nmi(char *str, struct pt_regs *regs, int do_panic)
 static notrace __kprobes void default_do_nmi(struct pt_regs *regs)
 {
        unsigned char reason = 0;
+       int cpu;
+
+       cpu = smp_processor_id();
 
-       /* Only the BSP gets external NMIs from the system: */
-       if (!smp_processor_id())
+       /* Only the BSP gets external NMIs from the system. */
+       if (!cpu)
                reason = get_nmi_reason();
 
        if (!(reason & 0xc0)) {
@@ -805,7 +808,7 @@ static notrace __kprobes void default_do_nmi(struct pt_regs *regs)
                 */
                if (nmi_watchdog_tick(regs, reason))
                        return;
-               if (!do_nmi_callback(regs, smp_processor_id()))
+               if (!do_nmi_callback(regs, cpu))
                        unknown_nmi_error(reason, regs);
 #else
                unknown_nmi_error(reason, regs);
index bc21ddc97a02e33d191bc3befe2b143c74620957..9b9245f81b9f89cadf62554d2418ad5dd5995053 100644 (file)
@@ -827,7 +827,7 @@ unknown_nmi_error(unsigned char reason, struct pt_regs * regs)
 
 /* Runs on IST stack. This code must keep interrupts off all the time.
    Nested NMIs are prevented by the CPU. */
-asmlinkage notrace  __kprobes void default_do_nmi(struct pt_regs *regs)
+asmlinkage notrace __kprobes void default_do_nmi(struct pt_regs *regs)
 {
        unsigned char reason = 0;
        int cpu;