public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Zoltan Menyhart <Zoltan.Menyhart_AT_bull.net@nospam.org>
To: linux-ia64@vger.kernel.org
Subject: Yet another MCA handler - testing
Date: Wed, 14 Jan 2004 10:44:43 +0000	[thread overview]
Message-ID: <40051D9B.869DA5CB@nospam.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 189 bytes --]

Having applied the patch included, you can provoke a single MCA by
setting the variable "test_mca_tr" to non zero.
You can repeat the test by setting this variable again...

Zoltan Menyhart

[-- Attachment #2: mca.test.patch --]
[-- Type: text/plain, Size: 1319 bytes --]

diff -ruN linux-2.6.1/kernel/sched.c linux-2.6.1-jan-14/kernel/sched.c
--- linux-2.6.1/kernel/sched.c	2004-01-13 12:55:50.000000000 +0100
+++ linux-2.6.1-jan-14/kernel/sched.c	2004-01-12 18:46:16.000000000 +0100
@@ -1,3 +1,11 @@
+#define _TEST_
+
+#if defined(_TEST_)
+#include <asm/mca_state.h>
+int test_mca_tr;
+
+#endif
+
 /*
  *  kernel/sched.c
  *
@@ -1467,6 +1475,18 @@
 
 void scheduling_functions_start_here(void) { }
 
+#if defined(_TEST_)
+
+void
+ia64_itr_test(__u64 target_mask, __u64 tr_num, __u64 vmaddr, __u64 pte, __u64 log_page_size){
+	ia64_setreg(_IA64_REG_CR_ITIR, (log_page_size << 2));
+	ia64_setreg(_IA64_REG_CR_IFA, vmaddr);
+	ia64_stop();
+	ia64_itrd(tr_num, pte);
+}
+
+#endif
+
 /*
  * schedule() is the main scheduler function.
  */
@@ -1481,6 +1501,19 @@
 	unsigned long run_time;
 	int idx;
 
+#if defined(_TEST_)
+        if (test_mca_tr != 0){
+		test_mca_tr = 0;
+		printk("Messing up DTR5...\n");
+                __u64 psr = ia64_clear_ic();
+ 		ia64_itr_test(DATA_TRANSLATION,
+				/* DTR5 */ 5,
+				PERCPU_ADDR,
+				pte_val(pfn_pte(ia64_tpa(local_cpu_data) >> PAGE_SHIFT, PAGE_KERNEL)),
+				PERCPU_PAGE_SHIFT);
+		ia64_set_psr(psr);
+        }
+#endif
 	/*
 	 * Test if we are atomic.  Since do_exit() needs to call into
 	 * schedule() atomically, we ignore that path for now.

                 reply	other threads:[~2004-01-14 10:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=40051D9B.869DA5CB@nospam.org \
    --to=zoltan.menyhart_at_bull.net@nospam.org \
    --cc=linux-ia64@vger.kernel.org \
    /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