mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Youquan Song <youquan.song@intel.com>
To: linux-kernel@vger.kernel.org, hpa@linux.intel.com,
	suresh.b.siddha@intel.com
Cc: yong.y.wang@linux.intel.com, joe@perches.com, jbaron@redhat.com,
	arjan@linux.intel.com, trenn@suse.de, kent.liu@intel.com,
	chaohong.guo@intel.com,
	Youquan Song <youquan.song@linux.intel.com>,
	Youquan Song <youquan.song@intel.com>
Subject: [PATCH v2 2/2] apic: Add print error interrupt reason
Date: Sat,  8 Jan 2011 00:36:44 +0800	[thread overview]
Message-ID: <1294418204-15587-3-git-send-email-youquan.song@intel.com> (raw)
In-Reply-To: <1294418204-15587-2-git-send-email-youquan.song@intel.com>

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. 

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


  reply	other threads:[~2011-01-07 16:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-07 16:36 [PATCH v2 0/2] apic: Fix error interrupt report at all APs when boot Youquan Song
2011-01-07 16:36 ` [PATCH v2 1/2] apic: Fix error interrupt report at all APs Youquan Song
2011-01-07 16:36   ` Youquan Song [this message]
2011-01-07 18:41   ` Suresh Siddha
2011-01-08  0:58     ` Yong Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1294418204-15587-3-git-send-email-youquan.song@intel.com \
    --to=youquan.song@intel.com \
    --cc=arjan@linux.intel.com \
    --cc=chaohong.guo@intel.com \
    --cc=hpa@linux.intel.com \
    --cc=jbaron@redhat.com \
    --cc=joe@perches.com \
    --cc=kent.liu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=suresh.b.siddha@intel.com \
    --cc=trenn@suse.de \
    --cc=yong.y.wang@linux.intel.com \
    --cc=youquan.song@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®