linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86_32: move do_nmi() to nmi_32.c
@ 2008-05-02 23:45 Hiroshi Shimamoto
  2008-05-03 21:11 ` Thomas Gleixner
  2008-05-04  9:40 ` Ingo Molnar
  0 siblings, 2 replies; 6+ messages in thread
From: Hiroshi Shimamoto @ 2008-05-02 23:45 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin; +Cc: linux-kernel

From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>

on x86_64 do_nmi() is in nmi_64.c.

Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
---
 arch/x86/kernel/nmi_32.c   |   30 ++++++++++++++++++++++++++++++
 arch/x86/kernel/traps_32.c |   32 +-------------------------------
 include/asm-x86/nmi.h      |    3 ++-
 3 files changed, 33 insertions(+), 32 deletions(-)

diff --git a/arch/x86/kernel/nmi_32.c b/arch/x86/kernel/nmi_32.c
index 69bdae5..641d2d9 100644
--- a/arch/x86/kernel/nmi_32.c
+++ b/arch/x86/kernel/nmi_32.c
@@ -398,6 +398,36 @@ nmi_watchdog_tick(struct pt_regs *regs, unsigned reason)
 	return rc;
 }
 
+static unsigned ignore_nmis;
+
+notrace __kprobes void do_nmi(struct pt_regs *regs, long error_code)
+{
+	int cpu;
+
+	nmi_enter();
+
+	cpu = smp_processor_id();
+
+	++nmi_count(cpu);
+
+	if (!ignore_nmis)
+		default_do_nmi(regs);
+
+	nmi_exit();
+}
+
+void stop_nmi(void)
+{
+	acpi_nmi_disable();
+	ignore_nmis++;
+}
+
+void restart_nmi(void)
+{
+	ignore_nmis--;
+	acpi_nmi_enable();
+}
+
 #ifdef CONFIG_SYSCTL
 
 static int unknown_nmi_panic_callback(struct pt_regs *regs, int cpu)
diff --git a/arch/x86/kernel/traps_32.c b/arch/x86/kernel/traps_32.c
index 7fad084..b1793ad 100644
--- a/arch/x86/kernel/traps_32.c
+++ b/arch/x86/kernel/traps_32.c
@@ -787,7 +787,7 @@ void notrace __kprobes die_nmi(struct pt_regs *regs, const char *msg)
 	do_exit(SIGSEGV);
 }
 
-static notrace __kprobes void default_do_nmi(struct pt_regs *regs)
+notrace __kprobes void default_do_nmi(struct pt_regs *regs)
 {
 	unsigned char reason = 0;
 
@@ -827,36 +827,6 @@ static notrace __kprobes void default_do_nmi(struct pt_regs *regs)
 	reassert_nmi();
 }
 
-static int ignore_nmis;
-
-notrace __kprobes void do_nmi(struct pt_regs *regs, long error_code)
-{
-	int cpu;
-
-	nmi_enter();
-
-	cpu = smp_processor_id();
-
-	++nmi_count(cpu);
-
-	if (!ignore_nmis)
-		default_do_nmi(regs);
-
-	nmi_exit();
-}
-
-void stop_nmi(void)
-{
-	acpi_nmi_disable();
-	ignore_nmis++;
-}
-
-void restart_nmi(void)
-{
-	ignore_nmis--;
-	acpi_nmi_enable();
-}
-
 #ifdef CONFIG_KPROBES
 void __kprobes do_int3(struct pt_regs *regs, long error_code)
 {
diff --git a/include/asm-x86/nmi.h b/include/asm-x86/nmi.h
index 1e36302..9fd90b6 100644
--- a/include/asm-x86/nmi.h
+++ b/include/asm-x86/nmi.h
@@ -37,13 +37,14 @@ static inline void unset_nmi_pm_callback(struct pm_dev *dev)
 #endif /* CONFIG_PM */
 
 #ifdef CONFIG_X86_64
-extern void default_do_nmi(struct pt_regs *);
 extern void die_nmi(char *str, struct pt_regs *regs, int do_panic);
 extern void nmi_watchdog_default(void);
 #else
 #define nmi_watchdog_default() do {} while (0)
 #endif
 
+extern void default_do_nmi(struct pt_regs *);
+
 extern int check_nmi_watchdog(void);
 extern int nmi_watchdog_enabled;
 extern int unknown_nmi_panic;
-- 
1.5.4.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86_32: move do_nmi() to nmi_32.c
  2008-05-02 23:45 [PATCH] x86_32: move do_nmi() to nmi_32.c Hiroshi Shimamoto
@ 2008-05-03 21:11 ` Thomas Gleixner
  2008-05-04  0:41   ` Hiroshi Shimamoto
  2008-05-04  9:40 ` Ingo Molnar
  1 sibling, 1 reply; 6+ messages in thread
From: Thomas Gleixner @ 2008-05-03 21:11 UTC (permalink / raw)
  To: Hiroshi Shimamoto; +Cc: Ingo Molnar, H. Peter Anvin, linux-kernel

On Fri, 2 May 2008, Hiroshi Shimamoto wrote:
> From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
> 
> on x86_64 do_nmi() is in nmi_64.c.
> 
> Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
> ---

Applied. Are you targeting to merge the 32/64 nmi code eventually ?

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86_32: move do_nmi() to nmi_32.c
  2008-05-03 21:11 ` Thomas Gleixner
@ 2008-05-04  0:41   ` Hiroshi Shimamoto
  0 siblings, 0 replies; 6+ messages in thread
From: Hiroshi Shimamoto @ 2008-05-04  0:41 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Ingo Molnar, H. Peter Anvin, linux-kernel

Thomas Gleixner wrote:
> On Fri, 2 May 2008, Hiroshi Shimamoto wrote:
>> From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
>>
>> on x86_64 do_nmi() is in nmi_64.c.
>>
>> Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
>> ---
> 
> Applied. Are you targeting to merge the 32/64 nmi code eventually ?
> 

Yeah, there are duplicated codes in nmi_*.c.

thanks,
Hiroshi Shimamoto


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86_32: move do_nmi() to nmi_32.c
  2008-05-02 23:45 [PATCH] x86_32: move do_nmi() to nmi_32.c Hiroshi Shimamoto
  2008-05-03 21:11 ` Thomas Gleixner
@ 2008-05-04  9:40 ` Ingo Molnar
  2008-05-04 15:12   ` Hiroshi Shimamoto
  1 sibling, 1 reply; 6+ messages in thread
From: Ingo Molnar @ 2008-05-04  9:40 UTC (permalink / raw)
  To: Hiroshi Shimamoto; +Cc: Thomas Gleixner, H. Peter Anvin, linux-kernel


* Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com> wrote:

> From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
> 
> on x86_64 do_nmi() is in nmi_64.c.

this patch caused build failure on x86.git+sched-devel.git:

arch/x86/kernel/built-in.o: In function `nmi_stack_correct':
arch/x86/kernel/entry_32.S:(.kprobes.text+0x117): undefined reference to `do_nmi'
arch/x86/kernel/built-in.o: In function `nmi_espfix_stack':
arch/x86/kernel/entry_32.S:(.kprobes.text+0x1c3): undefined reference to `do_nmi'
arch/x86/kernel/built-in.o: In function `alternative_instructions':
: undefined reference to `stop_nmi'
arch/x86/kernel/built-in.o: In function `alternative_instructions':
: undefined reference to `restart_nmi'

with this config:

 http://redhat.com/~mingo/misc/config-Sun_May__4_11_25_21_CEST_2008.bad

	Ingo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86_32: move do_nmi() to nmi_32.c
  2008-05-04  9:40 ` Ingo Molnar
@ 2008-05-04 15:12   ` Hiroshi Shimamoto
  2008-05-04 15:22     ` Hiroshi Shimamoto
  0 siblings, 1 reply; 6+ messages in thread
From: Hiroshi Shimamoto @ 2008-05-04 15:12 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Thomas Gleixner, H. Peter Anvin, linux-kernel

Ingo Molnar wrote:
> * Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com> wrote:
> 
>> From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
>>
>> on x86_64 do_nmi() is in nmi_64.c.
> 
> this patch caused build failure on x86.git+sched-devel.git:
> 
> arch/x86/kernel/built-in.o: In function `nmi_stack_correct':
> arch/x86/kernel/entry_32.S:(.kprobes.text+0x117): undefined reference to `do_nmi'
> arch/x86/kernel/built-in.o: In function `nmi_espfix_stack':
> arch/x86/kernel/entry_32.S:(.kprobes.text+0x1c3): undefined reference to `do_nmi'
> arch/x86/kernel/built-in.o: In function `alternative_instructions':
> : undefined reference to `stop_nmi'
> arch/x86/kernel/built-in.o: In function `alternative_instructions':
> : undefined reference to `restart_nmi'
> 
> with this config:
> 
>  http://redhat.com/~mingo/misc/config-Sun_May__4_11_25_21_CEST_2008.bad

Oops, I've missed something.

Will work. If you don't want it soon, please remove it from the queue.

thanks,
Hiroshi Shimamoto

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86_32: move do_nmi() to nmi_32.c
  2008-05-04 15:12   ` Hiroshi Shimamoto
@ 2008-05-04 15:22     ` Hiroshi Shimamoto
  0 siblings, 0 replies; 6+ messages in thread
From: Hiroshi Shimamoto @ 2008-05-04 15:22 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Thomas Gleixner, H. Peter Anvin, linux-kernel

Hiroshi Shimamoto wrote:
> Ingo Molnar wrote:
>> * Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com> wrote:
>>
>>> From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
>>>
>>> on x86_64 do_nmi() is in nmi_64.c.
>> this patch caused build failure on x86.git+sched-devel.git:
>>
>> arch/x86/kernel/built-in.o: In function `nmi_stack_correct':
>> arch/x86/kernel/entry_32.S:(.kprobes.text+0x117): undefined reference to `do_nmi'
>> arch/x86/kernel/built-in.o: In function `nmi_espfix_stack':
>> arch/x86/kernel/entry_32.S:(.kprobes.text+0x1c3): undefined reference to `do_nmi'
>> arch/x86/kernel/built-in.o: In function `alternative_instructions':
>> : undefined reference to `stop_nmi'
>> arch/x86/kernel/built-in.o: In function `alternative_instructions':
>> : undefined reference to `restart_nmi'
>>
>> with this config:
>>
>>  http://redhat.com/~mingo/misc/config-Sun_May__4_11_25_21_CEST_2008.bad
> 
> Oops, I've missed something.
> 
> Will work. If you don't want it soon, please remove it from the queue.
> 

Ah, CONFIG_X86_LOCAL_APIC is needed for nmi_32.o.
I should have noticed before submitting this patch.

thanks,
Hiroshi Shimamoto

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-05-04 15:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-02 23:45 [PATCH] x86_32: move do_nmi() to nmi_32.c Hiroshi Shimamoto
2008-05-03 21:11 ` Thomas Gleixner
2008-05-04  0:41   ` Hiroshi Shimamoto
2008-05-04  9:40 ` Ingo Molnar
2008-05-04 15:12   ` Hiroshi Shimamoto
2008-05-04 15:22     ` Hiroshi Shimamoto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).