[IA64] Make gp value point to Region 5 in mca handler
authorZou Nan hai <nanhai.zou@intel.com>
Thu, 14 Sep 2006 00:25:15 +0000 (08:25 +0800)
committerTony Luck <tony.luck@intel.com>
Tue, 26 Sep 2006 21:13:03 +0000 (14:13 -0700)
MCA dispatch code take physical address of GP passed from SAL, then call
DATA_PA_TO_VA twice on GP before call into C code.  The first time is
in ia64_set_kernel_register, the second time is in VIRTUAL_MODE_ENTER.
The gp is changed to a virtual address in region 7 because DATA_PA_TO_VA
is implemented by dep instruction.

However when notify blocks were called from MCA handler code, because
notify blocks are supported by callback function pointers, gp value
value was switched to region 5 again.

The patch set gp register to kernel gp of region 5 at entry of MCA
dispatch.

Signed-off-by: Zou Nan hai <nanhai.zou@intel.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
arch/ia64/kernel/mca_asm.S
include/asm-ia64/mca_asm.h

index 96047491d1b9241fd06e196672443e1d5f16d7f1..ee3ff76c8a35dbd7a48ef85da761b2f76128a6b4 100644 (file)
@@ -1025,18 +1025,13 @@ ia64_old_stack:
 
 ia64_set_kernel_registers:
        add temp3=MCA_SP_OFFSET, r3
-       add temp4=MCA_SOS_OFFSET+SOS(OS_GP), r3
        mov b0=r2               // save return address
        GET_IA64_MCA_DATA(temp1)
        ;;
-       add temp4=temp4, temp1  // &struct ia64_sal_os_state.os_gp
        add r12=temp1, temp3    // kernel stack pointer on MCA/INIT stack
        add r13=temp1, r3       // set current to start of MCA/INIT stack
        add r20=temp1, r3       // physical start of MCA/INIT stack
        ;;
-       ld8 r1=[temp4]          // OS GP from SAL OS state
-       ;;
-       DATA_PA_TO_VA(r1,temp1)
        DATA_PA_TO_VA(r12,temp2)
        DATA_PA_TO_VA(r13,temp3)
        ;;
index 27c9203d8ce3173bff55753e1882a651faf11bc6..76203f9a8718d6706216a961684205f6beffbdaa 100644 (file)
        movl    temp2 = start_addr;                             \
        ;;                                                      \
        mov     cr.iip = temp2;                                 \
+       movl    gp = __gp                                       \
        ;;                                                      \
        DATA_PA_TO_VA(sp, temp1);                               \
-       DATA_PA_TO_VA(gp, temp2);                               \
        srlz.i;                                                 \
        ;;                                                      \
        nop     1;                                              \