public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Kazuto MIYOSHI <miyoshi@linux.bs1.fc.nec.co.jp>
To: linux-ia64@vger.kernel.org
Subject: Re: [PATCH] Kernel panic on IA-64 Linux with SELinux
Date: Wed, 09 Jun 2004 14:40:41 +0000	[thread overview]
Message-ID: <20040609234041K.miyoshi@linux.bs1.fc.nec.co.jp> (raw)
In-Reply-To: <013f01c44ddb$636d4aa0$f97d220a@linux.bs1.fc.nec.co.jp>


Hi all, 

> 2) We tried to set the current (r13) of cpu_idle to region 5 address.
>    But it paniced and I could not grab the cause of the panic.
>    Is there any reason we must put init_task in region 5?

Please find the attached patch to make swapper to run on region 5.
It needs extra 2 instructions in ia64_switch_to() to stop mapping of
task stack if we are switching to idle, to avoid TLB entry duplication
caused by kernel text/data mapping and CURRENT_STACK mapping.

I believe swapper (init_task) should be consistent for its all members,
not only for wait_chldexit, and the patch will solve other potential
list_head/current in-consistency raised by swapper initialization,
though I am not so sure if it justifies extra instructions and
complication in context switch.

Best Regards,


--- linux-2.6.6/arch/ia64/kernel/head.S.org	2004-06-09 10:37:40.000000000 +0900
+++ linux-2.6.6/arch/ia64/kernel/head.S	2004-06-09 20:33:55.234192256 +0900
@@ -155,6 +155,10 @@
 #endif
 	;;
 	tpa r3=r2		// r3 = phys addr of task struct
+	;;
+	shr.u r16=r3,IA64_GRANULE_SHIFT
+(isBP)	br.cond.dpnt .load_current	// BP stack is on region 5 and no need to map it
+
 	// load mapping for stack (virtaddr in r2, physaddr in r3)
 	rsm psr.ic
 	movl r17=PAGE_KERNEL
@@ -166,7 +170,6 @@
 	dep r2=-1,r3,61,3	// IMVA of task
 	;;
 	mov r17=rr[r2]
-	shr.u r16=r3,IA64_GRANULE_SHIFT
 	;;
 	dep r17=0,r17,8,24
 	;;
@@ -181,6 +184,7 @@
 	srlz.d
   	;;
 
+.load_current:
 	// load the "current" pointer (r13) and ar.k6 with the current task
 	mov IA64_KR(CURRENT)=r2		// virtual address
 	mov IA64_KR(CURRENT_STACK)=r16


--- linux-2.6.6/arch/ia64/kernel/entry.S.org	2004-06-09 11:47:03.000000000 +0900
+++ linux-2.6.6/arch/ia64/kernel/entry.S	2004-06-09 14:28:21.000000000 +0900
@@ -178,6 +178,9 @@
 	DO_SAVE_SWITCH_STACK
 	.body
 
+	movl r25=init_task
+	;;
+	cmp.eq p7,p6=r25,in0
 	adds r22=IA64_TASK_THREAD_KSP_OFFSET,r13
 	mov r27=IA64_KR(CURRENT_STACK)
 	dep r20=0,in0,61,3		// physical address of "current"
@@ -189,7 +192,7 @@
 	/*
 	 * If we've already mapped this task's page, we can skip doing it again.
 	 */
-	cmp.eq p7,p6=r26,r27
+(p6)	cmp.eq p7,p6=r26,r27
 (p6)	br.cond.dpnt .map
 	;;
 .done:

  reply	other threads:[~2004-06-09 14:40 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-09  4:36 [PATCH] Kernel panic on IA-64 Linux with SELinux 
2004-06-09 14:40 ` Kazuto MIYOSHI [this message]
2004-06-09 21:55 ` David Mosberger
2004-06-09 22:44 ` Luck, Tony
2004-06-09 23:25 ` David Mosberger
2004-06-09 23:35 ` Luck, Tony
2004-06-10  0:58 ` David Mosberger
2004-06-10  5:19 ` Luck, Tony
2004-06-10  5:23 ` David Mosberger
2004-06-10  5:28 ` Luck, Tony
2004-06-15  2:28 ` Kaigai Kohei
2004-06-15  4:17 ` Luck, Tony
2004-06-15  4:23 ` David Mosberger
2004-06-15  4:25 ` Luck, Tony
2004-06-15  4:25 ` David Mosberger
2004-06-15  9:37 ` Kaigai Kohei
2004-06-15 12:52 ` Kaigai Kohei
2004-06-17  1:10 ` David Mosberger
     [not found] <Xine.LNX.4.44.0406101657420.8385-100000@thoron.boston.redhat.com>
2004-06-11  1:13 ` Kaigai Kohei

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=20040609234041K.miyoshi@linux.bs1.fc.nec.co.jp \
    --to=miyoshi@linux.bs1.fc.nec.co.jp \
    --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