Re: [patch] per cpu MCA/INIT save areas (take 2)

Russ Anderson
2004-12-09T04:15:57Z

Keith Owens wrote:
> On Tue, 23 Nov 2004 17:36:41 -0600 (CST),
> Russ Anderson <rja@sgi.com> wrote:
> >--- tonyluck2.6.10.new.orig/linux/arch/ia64/kernel/mca_asm.S 2004-11-17 16:22:30.041624520 -0600
> >+++ tonyluck2.6.10.new/linux/arch/ia64/kernel/mca_asm.S 2004-11-23 13:49:27.631179608 -0600
>
> > rse_switch_context(r6,r3,r2);; // RSC management in this new context
> >- movl r12=ia64_mca_stack
> >+
> >+ mov r2=r12;; // phys addr of MCA save area
> >+ addl r2=IA64_MCA_STACK,r2;;
> >+ mov r12=r2
> > mov r2=8*1024;; // stack size must be same as C array
> > add r12=r2,r12;; // stack base @ bottom of array
> > adds r12=-16,r12;; // allow 16 bytes of scratch
> > // (C calling convention)
>
> Replace with mov r2=IA64_MCA_STACK+8*1024-16;; add r12=r12,r2;; plus suitable comments.

Looking closer at the original code, r12 is converted to PA, but isn't used
after that, that I can see. Could someone explain where r12 is used?

// Setup new stack frame for OS_MCA handling
movl r2=ia64_mca_bspstore;; // local bspstore area location in r2
DATA_VA_TO_PA(r2);;
movl r3=ia64_mca_stackframe;; // save stack frame to memory in r3
DATA_VA_TO_PA(r3);;
rse_switch_context(r6,r3,r2);; // RSC management in this new context
movl r12=ia64_mca_stack
mov r2=8*1024;; // stack size must be same as C array
add r12=r2,r12;; // stack base @ bottom of array
adds r12=-16,r12;; // allow 16 bytes of scratch
// (C calling convention)
DATA_VA_TO_PA(r12);;

// Enter virtual mode from physical mode
VIRTUAL_MODE_ENTER(r2, r3, ia64_os_mca_virtual_begin, r4)
ia64_os_mca_virtual_begin:

// Call virtual mode handler
movl r2=ia64_mca_ucmc_handler;;
mov b6=r2;;
br.call.sptk.many b0¶;;
.ret0:
// Revert back to physical mode before going back to SAL
PHYSICAL_MODE_ENTER(r2, r3, ia64_os_mca_virtual_end, r4)
ia64_os_mca_virtual_end:

Thanks,
--
Russ Anderson, OS RAS/Partitioning Project Lead
SGI - Silicon Graphics Inc rja@sgi.com