lkml.org 
[lkml]   [2011]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v3 2/2] apic: Add print error interrupt reason
Date
End user worry about the error interrupt information and intend to know what
kind of error interrupts are generated, so this patch add printing out the
detail debug information of error interrupt.
dynamic debug is not initiated when LAPIC initiation, so the pr_debug will not
output the error interrupt debug information when boot.
In this patch, we use apic_printk(APIC_DEBUG,), so if add kernel option
apic=debug will output the error interrupt during boot.

Signed-off-by: Youquan Song <youquan.song@intel.com>
---
arch/x86/kernel/apic/apic.c | 29 ++++++++++++++++++++++++++++-
1 files changed, 28 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 3f838d5..f0f2809 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1794,6 +1794,32 @@ void smp_spurious_interrupt(struct pt_regs *regs)
irq_exit();
}

+static const char * const error_interrupt_reason[] = {
+ "Send CS error",
+ "Receive CS error",
+ "Send accept error",
+ "Receive accept error",
+ "Redirectable IPI",
+ "Send illegal vector",
+ "Received illegal vector",
+ "Illegal register address",
+};
+
+static void print_error_interrupt_reason(u32 reason)
+{
+ u32 i = 0;
+ reason = reason & 0xff;
+ do {
+ if (reason & 0x1)
+ apic_printk(APIC_DEBUG, " : %s",
+ error_interrupt_reason[i]);
+ i++;
+ reason >>= 1;
+ } while (reason > 0);
+
+ apic_printk(APIC_DEBUG, "\n");
+}
+
/*
* This interrupt should never happen with our APIC/SMP architecture
*/
@@ -1821,8 +1847,9 @@ void smp_error_interrupt(struct pt_regs *regs)
* 6: Received illegal vector
* 7: Illegal register address
*/
- pr_debug("APIC error on CPU%d: %02x(%02x)\n",
+ apic_printk(APIC_DEBUG, "APIC error on CPU%d: %02x(%02x)",
smp_processor_id(), v , v1);
+ print_error_interrupt_reason(v1);
irq_exit();
}

--
1.6.4.2


\
 
 \ /
  Last update: 2011-01-08 03:23    [W:0.046 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site