From: "Chen, Kenneth W" <kenneth.w.chen@intel.com>
To: linux-ia64@vger.kernel.org
Subject: RE: BUG 2.6.7 hangs on boot (rx2600)
Date: Tue, 29 Jun 2004 15:09:00 +0000 [thread overview]
Message-ID: <200406291507.i5TF7JY12544@unix-os.sc.intel.com> (raw)
In-Reply-To: <20040622061505.GA23075@cup.hp.com>
David Mosberger wrote on Friday, June 25, 2004 10:55 PM
> >> True, but it's really ugly to add more special cases. Wouldn't it be
> >> better to explicitly pass the sp/bsp that need to be restored?
> >> (Caveat: can't use the normal calling conventions there; perhaps r17
> >> and r18 could be used?)
>
> Ken> Yeah, but we have to update all the call sites, current efi_call_phys
> Ken> and two other PAL static/stacked calls.
>
> True, but I think there are only 3 call-sites. If it turns out to be
> _really_ ugly we can reonsider, but I think it might be a better
> choice in the long run.
How does this patch look? It is a bit big. But what it does is really
simple: change 3 call sites to save/restore virtual address of sp and
ar.bsp/ar.bspstore.
=== arch/ia64/kernel/efi_stub.S 1.5 vs edited ==--- 1.5/arch/ia64/kernel/efi_stub.S Thu May 15 04:45:02 2003
+++ edited/arch/ia64/kernel/efi_stub.S Mon Jun 28 21:55:00 2004
@@ -44,7 +44,7 @@
GLOBAL_ENTRY(efi_call_phys)
.prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(8)
- alloc loc1=ar.pfs,8,5,7,0
+ alloc loc1=ar.pfs,8,7,7,0
ld8 r2=[in0],8 // load EFI function's entry point
mov loc0=rp
.body
@@ -70,9 +70,13 @@
mov out3=in4
mov out5=in6
mov out6=in7
+ mov loc5=r19
+ mov loc6=r20
br.call.sptk.many rp¶ // call the EFI function
.ret1: mov ar.rsc=0 // put RSE in enforced lazy, LE mode
mov r16=loc3
+ mov r19=loc5
+ mov r20=loc6
br.call.sptk.many rp=ia64_switch_mode_virt // return to virtual mode
.ret2: mov ar.rsc=loc4 // restore RSE configuration
mov ar.pfs=loc1
=== arch/ia64/kernel/head.S 1.24 vs edited ==--- 1.24/arch/ia64/kernel/head.S Wed Jun 16 18:09:33 2004
+++ edited/arch/ia64/kernel/head.S Mon Jun 28 21:55:01 2004
@@ -706,6 +706,9 @@
*
* Inputs:
* r16 = new psr to establish
+ * Output:
+ * r19 = old virtual address of ar.bsp
+ * r20 = old virtual address of sp
*
* Note: RSE must already be in enforced lazy mode
*/
@@ -724,12 +727,13 @@
mov cr.ipsr=r16 // set new PSR
add r3\x1f-ia64_switch_mode_phys,r15
- mov r17=ar.bsp
+ mov r19=ar.bsp
+ mov r20=sp
mov r14=rp // get return address into a general register
;;
// going to physical mode, use tpa to translate virt->phys
- tpa r17=r17
+ tpa r17=r19
tpa r3=r3
tpa sp=sp
tpa r14=r14
@@ -752,6 +756,8 @@
*
* Inputs:
* r16 = new psr to establish
+ * r19 = new bspstore to establish
+ * r20 = new sp to establish
*
* Note: RSE must already be in enforced lazy mode
*/
@@ -770,7 +776,6 @@
mov cr.ipsr=r16 // set new PSR
add r3\x1f-ia64_switch_mode_virt,r15
- mov r17=ar.bsp
mov r14=rp // get return address into a general register
;;
@@ -781,15 +786,14 @@
movl r18=KERNEL_START
dep r3=0,r3,KERNEL_TR_PAGE_SHIFT,64-KERNEL_TR_PAGE_SHIFT
dep r14=0,r14,KERNEL_TR_PAGE_SHIFT,64-KERNEL_TR_PAGE_SHIFT
- dep r17=-1,r17,61,3
- dep sp=-1,sp,61,3
+ mov sp=r20
;;
or r3=r3,r18
or r14=r14,r18
;;
mov r18=ar.rnat // save ar.rnat
- mov ar.bspstore=r17 // this steps on ar.rnat
+ mov ar.bspstore=r19 // this steps on ar.rnat
mov cr.iip=r3
mov cr.ifs=r0
;;
=== arch/ia64/kernel/pal.S 1.7 vs edited ==--- 1.7/arch/ia64/kernel/pal.S Thu May 15 04:45:02 2003
+++ edited/arch/ia64/kernel/pal.S Mon Jun 28 21:55:03 2004
@@ -176,10 +176,14 @@
andcm r16=loc3,r16 // removes bits to clear from psr
br.call.sptk.many rp=ia64_switch_mode_phys
.ret1: mov rp = r8 // install return address (physical)
+ mov loc5 = r19
+ mov loc6 = r20
br.cond.sptk.many b7
1:
mov ar.rsc=0 // put RSE in enforced lazy, LE mode
mov r16=loc3 // r16= original psr
+ mov r19=loc5
+ mov r20=loc6
br.call.sptk.many rp=ia64_switch_mode_virt // return to virtual mode
.ret2:
mov psr.l = loc3 // restore init PSR
@@ -201,7 +205,7 @@
*/
GLOBAL_ENTRY(ia64_pal_call_phys_stacked)
.prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(5)
- alloc loc1 = ar.pfs,5,5,86,0
+ alloc loc1 = ar.pfs,5,7,4,0
movl loc2 = pal_entry_point
1: {
mov r28 = in0 // copy procedure index
@@ -230,10 +234,14 @@
andcm r16=loc3,r16 // removes bits to clear from psr
br.call.sptk.many rp=ia64_switch_mode_phys
.ret6:
+ mov loc5 = r19
+ mov loc6 = r20
br.call.sptk.many rp· // now make the call
.ret7:
mov ar.rsc=0 // put RSE in enforced lazy, LE mode
mov r16=loc3 // r16= original psr
+ mov r19=loc5
+ mov r20=loc6
br.call.sptk.many rp=ia64_switch_mode_virt // return to virtual mode
.ret8: mov psr.l = loc3 // restore init PSR
next prev parent reply other threads:[~2004-06-29 15:09 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-22 6:15 BUG 2.6.7 hangs on boot (rx2600) Grant Grundler
2004-06-22 13:50 ` Jesse Barnes
2004-06-22 14:51 ` Grant Grundler
2004-06-22 15:59 ` Bjorn Helgaas
2004-06-22 21:16 ` Grant Grundler
2004-06-22 21:23 ` Bjorn Helgaas
2004-06-22 22:28 ` Grant Grundler
2004-06-22 22:30 ` Grant Grundler
2004-06-22 22:38 ` Arun Sharma
2004-06-23 14:26 ` Tian, Kevin
2004-06-23 17:03 ` Jesse Barnes
2004-06-23 22:50 ` Bjorn Helgaas
2004-06-24 2:57 ` Tian, Kevin
2004-06-25 0:36 ` Chen, Kenneth W
2004-06-25 16:31 ` Chen, Kenneth W
2004-06-26 5:29 ` David Mosberger
2004-06-26 5:48 ` Chen, Kenneth W
2004-06-26 5:55 ` David Mosberger
2004-06-29 15:09 ` Chen, Kenneth W [this message]
2004-06-29 15:34 ` Chen, Kenneth W
2004-06-29 17:32 ` Jesse Barnes
2004-06-29 17:40 ` Chen, Kenneth W
2004-06-29 17:45 ` Jesse Barnes
2004-06-29 18:03 ` Chen, Kenneth W
2004-06-29 18:13 ` Jesse Barnes
2004-06-29 18:19 ` Chen, Kenneth W
2004-06-29 21:19 ` David Mosberger
2004-06-29 23:18 ` David Mosberger
2004-06-30 16:17 ` Jesse Barnes
2004-06-30 18:11 ` Jesse Barnes
2004-07-06 23:43 ` David Mosberger
2004-07-06 23:45 ` David Mosberger
2004-07-07 16:20 ` Jesse Barnes
2004-07-07 23:56 ` Jesse Barnes
2004-07-08 18:13 ` Jesse Barnes
2004-07-08 18:31 ` Chen, Kenneth W
2004-07-08 18:39 ` Jesse Barnes
2004-07-08 18:43 ` David Mosberger
2004-07-08 18:46 ` Jesse Barnes
2004-07-12 17:59 ` Jesse Barnes
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=200406291507.i5TF7JY12544@unix-os.sc.intel.com \
--to=kenneth.w.chen@intel.com \
--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