aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYouquan Song <youquan.song@intel.com>2011-04-14 02:36:08 -0400
committerIngo Molnar <mingo@elte.hu>2011-04-19 13:03:30 -0400
commit2b398bd9f8f73be706b41adcbb240ce95793049a (patch)
tree8d8c61fffd0ccd2066ee05afb554d9310534c819
parentf0e615c3cb72b42191b558c130409335812621d8 (diff)
x86, apic: Print verbose error interrupt reason on apic=debug
End users worry about the error interrupt printout we generate currently: pr_debug("APIC error on CPU%d: %02x(%02x)\n", smp_processor_id(), v , v1); ... and would like to know the reason why error interrupts are generated. This patch prints out more detailed debug information. Another practical problem is that dynamic debug is not initialized yet when the APIC initializes, so the pr_debug() will not output the error interrupt debug information on bootup. In this patch, we use apic_printk(APIC_DEBUG, ...), so the apic=debug boot option will print verbose error interupts during bootup. Signed-off-by: Youquan Song <youquan.song@intel.com> Cc: Joe Perches <joe@perches.com> Cc: hpa@linux.intel.com Cc: suresh.b.siddha@intel.com Cc: yong.y.wang@linux.intel.com Cc: jbaron@redhat.com Cc: trenn@suse.de Cc: kent.liu@intel.com Cc: chaohong.guo@intel.com Link: http://lkml.kernel.org/r/1302762968-24380-2-git-send-email-youquan.song@intel.com Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/x86/kernel/apic/apic.c41
1 files changed, 26 insertions, 15 deletions
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index fabf01eff771..ae147126b7b7 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1812,30 +1812,41 @@ void smp_spurious_interrupt(struct pt_regs *regs)
1812 */ 1812 */
1813void smp_error_interrupt(struct pt_regs *regs) 1813void smp_error_interrupt(struct pt_regs *regs)
1814{ 1814{
1815 u32 v, v1; 1815 u32 v0, v1;
1816 u32 i = 0;
1817 static const char * const error_interrupt_reason[] = {
1818 "Send CS error", /* APIC Error Bit 0 */
1819 "Receive CS error", /* APIC Error Bit 1 */
1820 "Send accept error", /* APIC Error Bit 2 */
1821 "Receive accept error", /* APIC Error Bit 3 */
1822 "Redirectable IPI", /* APIC Error Bit 4 */
1823 "Send illegal vector", /* APIC Error Bit 5 */
1824 "Received illegal vector", /* APIC Error Bit 6 */
1825 "Illegal register address", /* APIC Error Bit 7 */
1826 };
1816 1827
1817 exit_idle(); 1828 exit_idle();
1818 irq_enter(); 1829 irq_enter();
1819 /* First tickle the hardware, only then report what went on. -- REW */ 1830 /* First tickle the hardware, only then report what went on. -- REW */
1820 v = apic_read(APIC_ESR); 1831 v0 = apic_read(APIC_ESR);
1821 apic_write(APIC_ESR, 0); 1832 apic_write(APIC_ESR, 0);
1822 v1 = apic_read(APIC_ESR); 1833 v1 = apic_read(APIC_ESR);
1823 ack_APIC_irq(); 1834 ack_APIC_irq();
1824 atomic_inc(&irq_err_count); 1835 atomic_inc(&irq_err_count);
1825 1836
1826 /* 1837 apic_printk(APIC_DEBUG, KERN_DEBUG "APIC error on CPU%d: %02x(%02x)",
1827 * Here is what the APIC error bits mean: 1838 smp_processor_id(), v0 , v1);
1828 * 0: Send CS error 1839
1829 * 1: Receive CS error 1840 v1 = v1 & 0xff;
1830 * 2: Send accept error 1841 while (v1) {
1831 * 3: Receive accept error 1842 if (v1 & 0x1)
1832 * 4: Reserved 1843 apic_printk(APIC_DEBUG, KERN_CONT " : %s", error_interrupt_reason[i]);
1833 * 5: Send illegal vector 1844 i++;
1834 * 6: Received illegal vector 1845 v1 >>= 1;
1835 * 7: Illegal register address 1846 };
1836 */ 1847
1837 pr_debug("APIC error on CPU%d: %02x(%02x)\n", 1848 apic_printk(APIC_DEBUG, KERN_CONT "\n");
1838 smp_processor_id(), v , v1); 1849
1839 irq_exit(); 1850 irq_exit();
1840} 1851}
1841 1852